Is there a way to set the no of threads of the web container(tomcat) to allocate a fixed no of threads on a per servlet basis in say the web.xml or any other way?
no. A servlet container will launch at most one instance of every servlet defined in the web.xml and will thereafter create a single thread for each concurrent request to that servlet.
Limiting the number of Thread is possible but it is not part of the servlet API and web.xml. With the Tomcat server, look at the server.xml file entry:
It is up to each server architect to provide for limiting simultaneous request processing Threads. In this case it is the whole port 80 Connector that is limited, not the individual servlet. If you want to control the number of requests per servlet you will have to write your own code. Bill