Tomcat configure maxThreads per webapp

tomcat

i've asked this question once on stackoverflow. Sadly with no response. However i think this place might be more appropriate. Is it possible to configure tomcat to use a predefined number of threads per webapplication? The idear behind this is, if i deploy several applications on tomcat and let's assume one of those has a bug which results into a deadlock.

What happens is that this application will cause tomcat to create new threads until it reaches the maxThreads setting. After that no more Threads can be created which affects the other applications as well. It would be nice to tell tomcat something like "hey you can only serve 50 threads per application". If then the application with the deadlock reaches it's 50 Threads it will just be blocked, but the other applications will stay save.

thx,

kuku

Best Answer

maxThreads setting is specified at connector level so you could define 1 connector per app and serve only one app through each. You will probably need a reverse proxy for that depending on your environment and application needs.

Obviously you could also launch multiple tomcat instances although that would be much more expensive resourcewise but maybe total isolation between apps pays off.

Related Topic