tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: VERY HIGH TRAFFIC TUNING
Date Fri, 11 Jul 2014 17:06:53 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Leon,

On 7/10/14, 3:27 PM, Leon Rosenberg wrote:
> answering only to the one directed at me (or so I think):

;)

> On Thu, Jul 10, 2014 at 4:09 PM, Christopher Schultz < 
> chris@christopherschultz.net> wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>> 
>> Leon,
>> 
>>> If you have very fast connections, go for a smaller amount. If
>>> you have keepalive and slow connections, remember that every
>>> connection can hold 1-2 threads without doing anything at all.
>> 
>> Hmm?
>> 
> 
> If you have keepalive enabled, then every client will held an open 
> connection for some period of time.

Correct.

> Depending on browser brand and version, the browser will typically 
> hold 1-2 connections to the server.

These days, it's more like 8.

http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/
http://www.browserscope.org/?category=network
http://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser

I think most browsers will hang up the phone, though, if they aren't
making any requests.

> So for every logged in users that is clicking or issuing a request 
> regularly (maybe once a minute or so), you can end up having one
> or two threads, dependending on how many connections the browsers 
> holds.
> 
> Those threads would be idle most of the time, but still not
> available to your threadpool. Usually they show up as Runnable
> somewhere in socket.read in the thread dump. So if you have 100
> users with 150 connections and 151 threads in your threadpool you
> can end up with a completely blocked server with zero cpu usage.

This is one of the reasons /not/ to use a BIO-based connector, even
for AJP connections: while waiting for the next keepalive request over
a connection, the BIO thread will be bound to the connection, sitting
there waiting and not getting anything done. The NIO connector throws
the connection into a poller queue and the thread is free to do more work.

So, you can either get the same amount of work done with fewer
threads, or handle more work with the same number of threads. This is
important when you've got many frontends and many backends so the F x
B product is high, but the effective load on any server really
shouldn't be anywhere near F x B. If you use BIO, your maxThreads
needs to be somewhere near F x B unless you want nasty hangs, etc. If
you use NIO, then maxConnections should probably be exactly F x B, but
maxThreads can be significantly less than that.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTwBmtAAoJEBzwKT+lPKRYmxUQAJRoZCYvmFZWHddPlUETaOt6
2kTX08L19V16W7I5iyEhT8Zrw5mYdGXnA9FzQO0xtl7PMvfY59iIjvN+rapf347+
oFJ73cqaA4oBt7UtaMcLV5+By6CebFp2r/xb9bD0rNZ5DOBhBUJgbGbwLGTeKtAj
P3LpaoodwDvWli75VLj4sgHEaAPWybuaLqRpud8W9DkhCT6DVt+RkQj3j9aDxOmu
gQRB9qRGKCVExu+j5Tictmd8FHuI2Dx6gC8jsNIoMr1RUePJq835CM2OW6WPP+pa
SUzddehtVAET5k4HLbFzviavMf1kBmFxSH616KRtbbZ/vtdqccWEO10GiHuCzBgH
3NlfRAsmCJWhse93zWRwX9p8HGXN2vHFl0cUlkU8yjOmGGPwSBmfE3xXtOFgFio1
yisSkCPTF0Xieyo8UcsxZkHusr/hZ6o1rCaV46zFYVMSLU7j9FDhJS+GMdljGa6y
jlWnyHPGte5jbT3LsHvIxC+TBSdrX8nVXjvgV21h5YJqGimokPftHKEkiI48eebW
zx5xYAJik5riAruhf+CBVCdOfQfZgIJu0S1WJ4S91HBkTLieaHHnGYuDPcoALYlC
mVbyUfCnSVWpUtYVIdxEoxJeuK0jvndA2Knj/Q9D1u9fbu2ZD5heNfM0ed+3taDj
ocPfNolGUZE2gMMjbkOk
=v25m
-----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