• Post Reply Bookmark Topic Watch Topic
  • New Topic

Non Blocking Web service session pooling

 
Biswajit Banerjee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Biswajit Banerjee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestion will be highly appreciated
 
Tim Cooke
Sheriff
Posts: 3295
153
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This smells like homework. Nobody here is going to do your homework for you, but if you show us what you've done so far and explain exactly what part you are having difficulty with then you are more likely to get some help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!