tags:

views:

180

answers:

1

We have a servlet which occupies more virtual memory on the server as it downloads files . For this reason, we would like to limit the concurrent requests to this server say for example we would only want 10 requests processed in parallel. We would want other requests wait in the queue.

Can a custom thread pool be created, and configured to define max number of threads and assign for this servlet to handle this scenario? We are using WebLogic server 9.2. Or is there any other better approach to do this? Appreciate any thoughts.

Could we configure a separate servlet and configure the thread pool to only allow X number of concurrent requests, all other requests would be placed in queue to use the next available servlet. Does this approach throw a timeout error? Can you please share more details around this? Thanks

http://download.oracle.com/docs/cd/E13222%5F01/wls/docs92/perform/appb%5Fqueues.html

+1  A: 

Can a custom thread pool be created and assign for this servlet to handle this scenario? We are using WebLogic server 9.2. Or is there any other better approach to do this? Appreciate any thoughts.

Yes, this is possible. Instead of using the default self-tuning work manager (starting with Weblogic 9.x, execute queues are replaced by work managers for thread pools1), you could create a work manager with specific constraints like the max-threads-constraint and possibly the capacity. You can then assign a Servlet to a specific work manager using the wl-dispatch-policy of the weblogic.xml deployment descriptor file.


1 Note that it's still possible to enable WebLogic 8.1 Thread Pool Model and to use Execute Queues.

Pascal Thivent
Thanks for the above description and confirmation.
stranger001