You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Thomas G. Lau" <th...@ntt.com.hk> on 2009/08/07 08:58:32 UTC

tomcat connection limit

Dear All,

I am currently testing tomcat connection limit, while doing so, I have 
meet the 1100connection limit to Tomcat server, it was using two jmeter 
server to "attack" single tomcat. But no matter what, tomcat could never 
be able to handle more than 1100 connection.

I did use
ulimit -n 65535
ulimit -u 65535
 

also tune all variable on server.xml which is higher than 2000, but none 
of them are working. Please help to comment if you have experience on 
tomcat fine tuning, thanks.

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


Re: tomcat connection limit

Posted by Mark Thomas <ma...@apache.org>.
Thomas G. Lau wrote:
> Dear Mark,
> 
> may I ask what did you tune on your tomcat?

Nothing. I just set maxThreads="10000" to give me plenty of head room.
The tuning was all in the application.

> we are still using 5.0

5.0.x has not been supported for some time.

Mark



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


Re: tomcat connection limit

Posted by "Thomas G. Lau" <th...@ntt.com.hk>.
Dear Mark,

may I ask what did you tune on your tomcat? we are still using 5.0




_________
Thomas Lau
Product Engineer
Product Development
NTT Com Asia Limited
Phone: +852 3793-0733
Address: 12/F., Guardian House, 32 Oi Kwan Road, Wan Chai, Hong Kong
Email: thomas.lau@ntt.com.hk


Mark Thomas wrote:
> Thomas G. Lau wrote:
>   
>> Dear All,
>>
>> I am currently testing tomcat connection limit, while doing so, I have
>> meet the 1100connection limit to Tomcat server,
>>     
>
> There is no such limit in Tomcat. I have just tested Tomcat with 3000
> concurrent connections and saw zero errors. I did, however, need to tune
> my load test so I didn't hit CPU or network bottlenecks. I also tried
> 5000 threads but started seeing errors around 4000 concurrent
> connections - I didn't look into why but I suspect I hit an OS limit.
>
>   
>> it was using two jmeter
>> server to "attack" single tomcat. But no matter what, tomcat could never
>> be able to handle more than 1100 connection.
>>     
>
> It is extremely unlikely that Tomcat is the limiting factor. The
> limiting factor will be your application. You have two choices:
> - buy better hardware
> - tune your application
>
> Keep in mind that concurrent connections may not be the performance
> figure you really care about. Is response time is low, you could, for
> example, serve 200 req/s with only 20 connections.
>
> As a guide, the upper limit on requests per second for 6.0.20 on a
> quad-core 2.2GHz machine is more than 6000 req/s. Here CPU is the
> limiting factor and it I can hit that with less than 10 threads.
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   

Re: tomcat connection limit

Posted by Mark Thomas <ma...@apache.org>.
Thomas G. Lau wrote:
> Dear All,
> 
> I am currently testing tomcat connection limit, while doing so, I have
> meet the 1100connection limit to Tomcat server,

There is no such limit in Tomcat. I have just tested Tomcat with 3000
concurrent connections and saw zero errors. I did, however, need to tune
my load test so I didn't hit CPU or network bottlenecks. I also tried
5000 threads but started seeing errors around 4000 concurrent
connections - I didn't look into why but I suspect I hit an OS limit.

> it was using two jmeter
> server to "attack" single tomcat. But no matter what, tomcat could never
> be able to handle more than 1100 connection.

It is extremely unlikely that Tomcat is the limiting factor. The
limiting factor will be your application. You have two choices:
- buy better hardware
- tune your application

Keep in mind that concurrent connections may not be the performance
figure you really care about. Is response time is low, you could, for
example, serve 200 req/s with only 20 connections.

As a guide, the upper limit on requests per second for 6.0.20 on a
quad-core 2.2GHz machine is more than 6000 req/s. Here CPU is the
limiting factor and it I can hit that with less than 10 threads.

Mark


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


Re: tomcat connection limit

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas,

On 8/9/2009 9:33 PM, Thomas G. Lau wrote:
> [root@app1-testing ~]# ulimit -a
> open files                      (-n) 65535
> max user processes              (-u) 65535

Right. What user is Tomcat running as?

>    <Connector port="8082"
>               maxThreads="3000" minSpareThreads="25" maxSpareThreads="75"
>               enableLookups="false"
>               acceptCount="10000" debug="0" connectionTimeout="30000"
>               proxyPort="80" disableUploadTimeout="true" />

What happens when you start Tomcat? Do you get an error?
acceptCount="10000" is a /lot/ of connections to be pending in the
TCP/IP queue. Is that really what you want?

What happens when Tomcat hits this "limit"? Do you get a "connection
refused" for additional connections? Does Tomcat issue an error? Does
the JVM crash?

You are giving so few details, it's difficult to help you.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqAVUAACgkQ9CaO5/Lv0PBS8ACeOo1SziAc0ubvVBjdLhd2w9qY
VmoAoL3knYjjzogyjV3QOgnMaLi21KYx
=Ss6R
-----END PGP SIGNATURE-----

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


Re: tomcat connection limit

Posted by "Thomas G. Lau" <th...@ntt.com.hk>.
[root@app1-testing ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 71680
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65535
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 65535
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
________

    <Connector port="8082"
               maxThreads="3000" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false"
               acceptCount="10000" debug="0" connectionTimeout="30000"
               proxyPort="80" disableUploadTimeout="true" />


Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thomas,
>
> On 8/7/2009 2:58 AM, Thomas G. Lau wrote:
>   
>> I did use
>> ulimit -n 65535
>> ulimit -u 65535
>>     
>
> Were you root? If not, you may not be able to set your ulimits that
> high. Try 'ulimit -a' after "modifying" to see what the limits actually are.
>
>   
>> I have meet the 1100connection limit to Tomcat server
>>     
>
> What leads you to believe that you have hit some kind of limit? An
> error? If so, please provide the error message and/or stack trace. Did
> your CPU catch on fire?
>
>   
>> also tune all variable on server.xml which is higher than 2000
>>     
>
> Please post all the active <Connector> elements from your server.xml and
> tell us which port number(s) you are using in your JMeter tests.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkp8hcsACgkQ9CaO5/Lv0PD5uACfXE3UAxCqahCtIZnb5iQshkz/
> GYcAnA3r29j1hVl7eZbryPHC2SVM1O/U
> =aVQU
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   

Re: tomcat connection limit

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas,

On 8/7/2009 2:58 AM, Thomas G. Lau wrote:
> I did use
> ulimit -n 65535
> ulimit -u 65535

Were you root? If not, you may not be able to set your ulimits that
high. Try 'ulimit -a' after "modifying" to see what the limits actually are.

> I have meet the 1100connection limit to Tomcat server

What leads you to believe that you have hit some kind of limit? An
error? If so, please provide the error message and/or stack trace. Did
your CPU catch on fire?

> also tune all variable on server.xml which is higher than 2000

Please post all the active <Connector> elements from your server.xml and
tell us which port number(s) you are using in your JMeter tests.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkp8hcsACgkQ9CaO5/Lv0PD5uACfXE3UAxCqahCtIZnb5iQshkz/
GYcAnA3r29j1hVl7eZbryPHC2SVM1O/U
=aVQU
-----END PGP SIGNATURE-----

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