tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Can not understand how maxThreads of Connectors works
Date Wed, 16 Jan 2013 17:52:39 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hermes,

On 1/16/13 11:01 AM, Hermes Flying wrote:
> I am trying to understand how the maxThreads attribute of
> Connectors works. I did some tests in order to configure Tomcat to
> limit the number of concurrent client requests (as asked in my
> previous mail).

Please copy anything relevant into this thread. Otherwise the archives
don't work very well.

> Did the following trivial configuration.
> 
> maxThreads=1 and acceptCount=1
> 
> Then I send 2 concurrent requests from 2 clients and both were
> served!

I would expect both to be served: one request was served immediately
(maxThreads=1) and one was queued (acceptCount=1). When the first
request was completed, the second one came out of the queue and was
served.

If you had acceptCount="0" (which may or may not be legal for your
TCP/IP stack) or you had sent 10 simultaneous connections, I would
have expected at least some of them to be dropped with a connection
error (assuming that they really are simultaneous and the response
time is long enough to cover any variance in the connection-attempt time).

Please provide more details about your test setup.

> I was expecting that one would get a network failure!

Woah, you thought you'd take-down your network? You must be running
some shaky hardware.

> I even tried maxThreads=0 and still the clients were served! How is
> this possible?

maxThreads="0" is an illegal configuration. Are you sure Tomcat
started properly? Tomcat 6+ uses an Executor whether you configure one
of not, and the StandardThreadExecutor simply passes the maxThreads
value off to Java's ThreadPoolExecutor, which will throw
IllegalArgumentException if maxThreads is 0.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlD26OcACgkQ9CaO5/Lv0PCgLQCffw+xQflDLr4Ps8vYkQkcXUYw
EZ0AoKU7bMkUJkmx21IgaRkNpQVV20dh
=9xBW
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message