tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Questions about the HTTP connector config
Date Wed, 08 Jul 2015 19:50:58 GMT
Hash: SHA256


On 7/8/15 4:09 AM, jingych wrote:
> I desire for using tomcat as the websocket server. But I'm now
> wondering about the tomcat performance. Does anyone know the max
> connections that tomcat could  held? the concurrent number
> requests?

You'll definitely want to use the NIO or NIO2 connectors. For both of
those, the default maximum number of total (and thus concurrent)
connections is 10000. You may want to raise that if you expect lots of
long-running Websocket conversations.

The number of concurrent threads you think you can handle is more
related to your hardware and your application than anything else.

> And I don't quite understand the configurations: acceptCount &
> maxConnections & maxThreads

acceptCount = TCP backlog (c.f. Google)
maxConnections = maximum number of connections Tomcat will maintain at
maxThreads = maximum number of threads Tomcat will use to process
incoming data

I wouldn't change acceptCount unless you have a very good reason. The
only thing you are likely to accomplish by increasing the acceptCount
is causing more connections to time out and masking any underlying
problems -- like that you are trying to accept more traffic than you
can reasonably service.

Tomcat can handle 10k connections with many fewer threads (the default
is 200) as long as those 10k connections aren't trying to all talk at
once. If they are all trying to communicate at once, the 200 threads
are unlikely to be able to keep up with them, and your users will
experience slow performance or possibly read/write timeouts.

> There must be some relationship between the three params.
> if I set [ accpetCount=200, maxConnections=10000, maxThreads=100] 
> dose it means: 1, the max connections that tomcat maintain with the
> client is 10000. and if the 10001 client's connect request is
> coming, the client will timeout.

No, the 10001 client's request will go into the TCP backlog queue.
When it comes out depends upon when one of the other 10000 connections
disconnects and so Tomcat will call accept() on the socket for another

> 2, the max request is 200, and the 201 request will be refused.

There is no maximum number of requests.

> 3, the max concurrent request is 100.

This is pretty much correct. If your transactions are short, then 100
threads can probably comfortably service 10k connections.

The best thing for you to do is work-up a realistic load test and run
it against Tomcat in various configurations with your actual
application doing actual work.

- -chris
Comment: GPGTools -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message