tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: How can I limit the number of thread that tomcat spawn for my servlet
Date Fri, 25 May 2007 19:26:30 GMT
Hash: SHA1


Herman Schultz wrote:
> My understanding is tomcat will spawn a thread for each request to my
> servlet.

I think you might be misinterpreting this part of the spec. It just says
that each request will be handled by a separate thread. That doesn't
mean that a thread will be created for each request. Most app servers
will use thread pools and re-use threads since they are relatively heavy
to just create and discard all the time.

> How can I limit the number of thread that tomcat spawn for my servlet
> simultaneously?

Tomcat's connector specifies the number of threads that will be created
for request handling. Check out the documentation for the Tomcat connectors:


(Note that these are for TC 5.5, so if you are using a different
version, you should use the documentation appropriate for that version).

Specifically, look for settings including the word "thread", as well as
the "backlog" setting. Actually, it's worth reading the whole thing.

> And let say if I limit the simulaneous thread for my servlet to 10, what
> happens to the 11th request? Will it get dropped? Or Will it get queued?

That depends on other settings (such as "backlog"). The links above
should explain everything.

- -chris
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message