0

I have two Servlets providing a different service each. I don't want requests for one of them to block if the other Servlet is turning very slow at handling incoming requests.
This is a problem today as both share the same thread pool.

Can I configure a dedicated thread pool for each Servlet (WebSphere)?

Perneel
  • 3,317
  • 7
  • 45
  • 66
Gili Nachum
  • 5,288
  • 4
  • 31
  • 33
  • I think I'll end up KISS: Having a static AtomicInteger per service that counts in flight transaction. Blocking more than X concurrent executions per servlet, where the thread pool size is about 2X. – Gili Nachum Nov 09 '14 at 19:13

1 Answers1

2

No, you cannot create dedicated pool for given Servelt. You could define it for new web container transport chain, and have two application mapped to different virtual hosts using different chains/pools, but it is quite complicated.

For your issue I'd suggest using asynchronous servlets. Make your very slow servlet async one, then the original thread is return to the pool for your other servlet and your long running servlet will be run using separate thread.

Gas
  • 17,601
  • 4
  • 46
  • 93