You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Smith <to...@gmail.com> on 2014/03/10 16:43:16 UTC
Executor thread pool
How dumb am I being by not using an Executor with a named thread pool?
Currently I just have a Connector in server.xml:
<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="20000"
redirectPort="8443" />
Assuming ~2000 simultaneous connections. Tomcat 7.0.42. RHEL6.
Best,
John
RE: Executor thread pool
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: John Smith [mailto:tomcat.random@gmail.com]
> Subject: Executor thread pool
> How dumb am I being by not using an Executor with a named thread pool?
> Currently I just have a Connector in server.xml:
> <Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
> connectionTimeout="20000"
> redirectPort="8443" />
If you only have one <Connector>, it doesn't really make much difference. An <Executor> does give you a bit more control due to its additional configuration options; whether or not that's important in your environment is something you'll have to decide.
> Assuming ~2000 simultaneous connections. Tomcat 7.0.42. RHEL6.
For NIO, it's not the number of connections that matters, it's the number of concurrent requests.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Executor thread pool
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Jeffrey,
On 3/10/14, 4:15 PM, Jeffrey Janner wrote:
>> -----Original Message----- From: Christopher Schultz
>> [mailto:chris@christopherschultz.net] Sent: Monday, March 10,
>> 2014 11:22 AM To: Tomcat Users List Subject: Re: Executor thread
>> pool
>>
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>>
>> John,
>>
>> On 3/10/14, 11:43 AM, John Smith wrote:
>>> How dumb am I being by not using an Executor with a named
>>> thread
>> pool?
>>> Currently I just have a Connector in server.xml:
>>>
>>> <Connector port="8080"
>>> protocol="org.apache.coyote.http11.Http11NioProtocol"
>>> connectionTimeout="20000" redirectPort="8443" />
>>
>> An executor is being used under the covers... you just aren't
>> configuring it yourself.
>>
>> If you don't configure it yourself you lose out on these
>> benefits:
>>
>> 1. Shared executor for multiple Connectors. If you only have a
>> single connector, obviously this matters little.
>>
>> 2. You have less control over the underlying Executor if you
>> don't manually configure it and let the Connector auto-create
>> one. Check the documentation for
>> http://tomcat.apache.org/tomcat-7.0- doc/config/executor.html
>> against the thread-related configuration attributes available
>> for, say, the HTTP connector here
>> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html and
>> you'll see what I mean.
>>
>>> Assuming ~2000 simultaneous connections. Tomcat 7.0.42. RHEL6.
>>
>> 2000 simultaneous connections really is quite a lot. Are you
>> sure? 2000 simultaneous sessions isn't a stretch, but 2k
>> connections is a big deal. How long are your transactions? What
>> is the incoming request rate?
>>
>
> How about the more likely 2 connector scenario, one for port 80 one
> for port 443? Any benefit of using the executor here? Assuming
> sharing one between connectors, and web.xml configured to
> auto-route everything to SSL, i.e. time spent on 80 is minimal
> (redirect)?
+1
This allows you to handle N connections in-progress regardless of
which connector they connect through. Instead of having 50 threads for
HTTP and 500 threads for HTTPS, you can just drop the 50 threads for
HTTP and share all of them.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJTHipaAAoJEBzwKT+lPKRY2TAP/jpcAioKUsOQ1lLVbLd7mFo0
F/Wq8OwpLnJtnUYQpMQXqNYvgyNF0PYj806rj2YZq1WQcAuzDiwsli+ox7GiSzv/
POEYiN7odnyKaoYIXbPTYt8SWP4xdd/5B/Qc+iVyzBvuHkK4eqoHeuyCZj9bmMEk
nLieDH9m+O3EHgvmEBLfjpe76seHFUzyGfFU62oh0eXcwe4Y4uUDnNTZtcVBf43b
MLTu5YsuYMJkGr9yB/egAqsVzrtN67czXEcrEzBl5ZDVdKRqbnaSfW3q+ntnJfGL
0iNdrKqJOLZnQNgOdfhCxxMCvD5XBlfntkRWvL+8BE2y5B5F0bH6Y7h7HUZPvA49
GNEuMiSaLILwAJP87lykQTiOhrOktCJzA5BvkVQPBDNCHg0b4+QONYOARRGAFhAQ
C+sLepOoj+XCr/2icZpuHOEFtr+OqCzzVxxOFCPy/dxsbVwlavWkq+dr6Wa4/lyf
UUetK4QBfaL4heoGHh5osW6aen/leZTHiYJvlPwlZxlJ0RZtqlhFkpOcNsLbky1R
6yT57Wivqa19HR7zWqvew0t0S0LmLB+FaILsN20W0nXCYMBFUGjsUislVsbXpSCD
R9wNykbM4BtR4I9RI5ltJ/npR63h4Yw0XYsVnsJewNgxeYEyiNPDK3t39Qpyxe2c
ciegPT6xwnyhCnwxnK3E
=e8Oj
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Executor thread pool
Posted by Jeffrey Janner <Je...@PolyDyne.com>.
> -----Original Message-----
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Sent: Monday, March 10, 2014 11:22 AM
> To: Tomcat Users List
> Subject: Re: Executor thread pool
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> John,
>
> On 3/10/14, 11:43 AM, John Smith wrote:
> > How dumb am I being by not using an Executor with a named thread
> pool?
> > Currently I just have a Connector in server.xml:
> >
> > <Connector port="8080"
> > protocol="org.apache.coyote.http11.Http11NioProtocol"
> > connectionTimeout="20000" redirectPort="8443" />
>
> An executor is being used under the covers... you just aren't
> configuring it yourself.
>
> If you don't configure it yourself you lose out on these benefits:
>
> 1. Shared executor for multiple Connectors. If you only have a single
> connector, obviously this matters little.
>
> 2. You have less control over the underlying Executor if you don't
> manually configure it and let the Connector auto-create one. Check the
> documentation for http://tomcat.apache.org/tomcat-7.0-
> doc/config/executor.html against the thread-related configuration
> attributes available for, say, the HTTP connector here
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html and you'll see
> what I mean.
>
> > Assuming ~2000 simultaneous connections. Tomcat 7.0.42. RHEL6.
>
> 2000 simultaneous connections really is quite a lot. Are you sure?
> 2000 simultaneous sessions isn't a stretch, but 2k connections is a big
> deal. How long are your transactions? What is the incoming request
> rate?
>
How about the more likely 2 connector scenario, one for port 80 one for port 443?
Any benefit of using the executor here? Assuming sharing one between connectors, and web.xml configured to auto-route everything to SSL, i.e. time spent on 80 is minimal (redirect)?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Executor thread pool
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
John,
On 3/10/14, 11:43 AM, John Smith wrote:
> How dumb am I being by not using an Executor with a named thread
> pool? Currently I just have a Connector in server.xml:
>
> <Connector port="8080"
> protocol="org.apache.coyote.http11.Http11NioProtocol"
> connectionTimeout="20000" redirectPort="8443" />
An executor is being used under the covers... you just aren't
configuring it yourself.
If you don't configure it yourself you lose out on these benefits:
1. Shared executor for multiple Connectors. If you only have a single
connector, obviously this matters little.
2. You have less control over the underlying Executor if you don't
manually configure it and let the Connector auto-create one. Check the
documentation for
http://tomcat.apache.org/tomcat-7.0-doc/config/executor.html against
the thread-related configuration attributes available for, say, the
HTTP connector here
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html and you'll
see what I mean.
> Assuming ~2000 simultaneous connections. Tomcat 7.0.42. RHEL6.
2000 simultaneous connections really is quite a lot. Are you sure?
2000 simultaneous sessions isn't a stretch, but 2k connections is a
big deal. How long are your transactions? What is the incoming request
rate?
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJTHeazAAoJEBzwKT+lPKRYTA4P/0K95yUlujhru68MAE7cL6Wu
Sk1IC2FCqfYYEuLOLChpA+P/49EUcqZ4BOn22LHIl3ijcUcP0re6vGXwCL0etOuB
qvrYH7tKPsNN4SQJ8tXkXdEKLVukK2RLx0AEZlmRheksYgu8G9lF7EZlPm65i1fr
vE9JWti5UtRuVMQiPjhmJZrlfEjdiNcRNr8ClKJmhRxGEeeV+dHMzNpsDbnxoD5e
vGGItrFVvfA7ffgYixRDhyGL1gO+T2DWoo4UA8wXNVGg+5Xr5jSoZBf66kY8voy4
3sQBjH5eH8yqmbOaFvX5msGyoDjwQ3o8GDcz0PnMBqNfF/sg1673FIWHjScQCx4/
mltvXJOev3joNycKr4uxFB832JAt7uyUkslowQ50a0RFvsiVC8u1CZ9pwNxcTnVP
BTQcvGSGSa5KTQdSfeWWb4LQg6WqxgQM/WI3uOvoEraUBMTvETVv/aQMsh5qPVB6
199PN7rE9XOGObJ7PQDOOm6Y2i+wUeKunZCOfPpzqEFKhKE4GIdD6qoEJnFySIjN
x4ita0F2Y8XJs6EiOQsvDE5g3ZlMjV5YDsJXJRnCx1rqxNxHdGyc4+jBzEpybMJ2
W81XThlbMiK7byufAN7YH+7W0Utd7iRMIxE2Z8bcFwm9ZfAd1GogdsNH6iyAh6Ry
zn+O78QonFrFbmPvEBLy
=+F+E
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org