Can anyone please suggest some help in following Problem and Requirement
Problem:
It was found that the performance of web service xyz is not good.
Current Code:
a. Caller opens a http session and does an authorization using a trusted system id?
b. Once session is open ( session is valid for 30 minutes).
c. Callers processes a request with the session.
d. Once the request is processed, caller invalidates the session.
Root cause:
Since we are opening and closing session every time we make a call , the processing is taking more time.
Code:
Design change:
a. Design team looked at the problem and saw that the session was valid for 30 min, so they decided to keep the session cached and reuses until 30 min. But the design failed to handle low volume scenario where you get 1 call per 1 hour.
Finally , they wanted to implement a non-blocking pool of sessions
Requirement:
a. Create a pool once you make a first session , initial capacity 5 (configurable at user level)and no upper limit
b. At any point of time there must be pool 5 minimum no of connection available in pool.
c. A session should be shared by multiple request of a thread until it is expired and should only seek connection from pool once expired.
d. If there is no session available in pool, then it must create its own session, but it should not wait for sessions.
e. There must be some process to fill in the session in the pool in order to maintain minimum pool size ( here 5).
f. The collection storing the sessions should be non-blocking hence producer and consumer should not wait or lock the collection.
Problem:
It was found that the performance of web service xyz is not good.
Current Code:
a. Caller opens a http session and does an authorization using a trusted system id?
b. Once session is open ( session is valid for 30 minutes).
c. Callers processes a request with the session.
d. Once the request is processed, caller invalidates the session.
Root cause:
Since we are opening and closing session every time we make a call , the processing is taking more time.
Code:
Design change:
a. Design team looked at the problem and saw that the session was valid for 30 min, so they decided to keep the session cached and reuses until 30 min. But the design failed to handle low volume scenario where you get 1 call per 1 hour.
Finally , they wanted to implement a non-blocking pool of sessions
Requirement:
a. Create a pool once you make a first session , initial capacity 5 (configurable at user level)and no upper limit
b. At any point of time there must be pool 5 minimum no of connection available in pool.
c. A session should be shared by multiple request of a thread until it is expired and should only seek connection from pool once expired.
d. If there is no session available in pool, then it must create its own session, but it should not wait for sessions.
e. There must be some process to fill in the session in the pool in order to maintain minimum pool size ( here 5).
f. The collection storing the sessions should be non-blocking hence producer and consumer should not wait or lock the collection.