Forums Register Login

Non Blocking Web service session pooling

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Any suggestion will be highly appreciated
+Pie Number of slices to send: Send
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.
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 883 times.
Similar Threads
JspWriter in tomcat
How to end the user's session on closing the browser
session is not refreshing for ajax4jsf request
Java Security MOCK
Connection pool issue
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:37:12.