tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: attempting to achieve 100K concurrent websocket connections on Tomcat 7.0.48 NIO
Date Sat, 02 Nov 2013 11:06:46 GMT
On 02/11/2013 00:02, Bob DeRemer wrote:
> In monitoring the memory, it's not nearing the max available we
> configured for the JVM, but perhaps there's something going on GC
> wise.  I don't have GC logging enabled and probably should.  I
> haven't done much with that aspect of tuning yet.

Just keep in mind that you are going to use a lot of memory from the
Java Object heap (so the part controlled by Xmx and friends) and well as
a fair amount outside of the process heap and PermGen. You should keep
an eye on heap usage as reported by the JVM well as total process memory
usage as reported by the OS.

> From a Tomcat connector standpoint, should we consider increasing any
> of the acceptThreadCount and acceptCount values - given it's such a
> large machine?

acceptThreadCount: There is little point increasing this beyond the
default of 2. Socket.accept() is synchronised so extra threads don't
help very much. You get a little bit more throughput with 2 threads than
1 as one thread can be handing off the connection to the worker thread
while the other processes the next connection. If the hand-off was slow
then extra threads might help but I'd be wondering why the handoff was
slow rather than increasing the acceptThreadCount.

acceptCount: You only need to increase this if you experience spikes in
new connections you otherwise can't handle. Increasing the acceptCount
does nothing to help you handle load and nearly always makes the
situation worse if a system is struggling to handle current load.

I'm wondering if the VMs are somehow limiting the ports available. It
might be worth writing a simple two simple test programs. The first that
accepts a new connection and sticks it in List and the second that makes
new connections and sticks them in a List just so see how many
connections you can establish from one of these VMs without any of the
overhead (as minimal as it is) of the WebSocket implementation.

Mark

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


Mime
View raw message