Fog Creek Software
Discussion Board

Win2K Pro, JVMs and Tomcat Scalability

I am currently testing the behavior of an application running on tomcat and am hitting a limit when it comes to the number of available connections.

I am using JMeter to test the app.

Up to 50 concurrent users, it works fine (some refused connections, but not much) but when I try with 100, I start receiving "connection refused".

The application uses a cache, so this is okay on that front.
The server.xml in Tomcat is configured for quite a large number of connections:

<Connector className="org.apache.catalina.connector.http.HttpConnector"

The JVM is started with those options:

-Xms350m -Xmx350m -Xss32k -Xincgc

I am aware that W2K pro is limited to 10 inbound cnx but it doesn't seem to apply here (or I would have those 50 working).

I would like to know what to expect when it comes to this because here (, it appears to go much further.

Is it due to W2KPro or not ? Should I move the whole thing to Linux ? I would like to run it on W2KPro for a series of reasons tough...

Philippe Back
Monday, March 3, 2003

Maybe not worth worrying to much after all, I found this setting for the registry that does the trick:



I have put 200 in this DWORD, rebooted and it works fine now.

Next try is to put 2000 in there...

So, on the same front, up to where can we go using this approach ?

Philippe Back
Monday, March 3, 2003

We are seeing similar problems on our W2k Server box running Tomcat/Apache.  We have our maxProcessors at 75 (not 100), and when we hit 75 everything goes to hell.  We are luckily in a rather controlled environment where we will NEVER see 75 connections in production.  This was only seen during our testing when we were pounding the crap out of it. 
If you increase that number from 100 to something else higher you can get some more connections out of it.  The problem is you still will have the cap that you set.
Another issue that we have ran into is a memory cap on Tomcat.  We found that when tomcat uses too much memory (100 Mb+) it doesn't know what to do with it and basically you have to reboot to clean it back up.  We think that this is caused by a memory leak in a third party product but we can't prove that. 

Matt Watson
Monday, March 3, 2003

I've set TcpConnections to 1000 (way too high, but so I am sure).
So, now I am able to get 200 connections working together without trouble.

I used this setting:

    <Connector className="org.apache.catalina.connector.http.HttpConnector"

I will try with 300 to see if it behaves like yours.
Tomcat currently went up to 150 Megs of RAM usage but I am able to shut it down without trouble.

I guess the best is to have more than one JVM and using Apache + mod_jk for load balancing...

BTW, you say that 75 connections are never seen in production. What is the size of your user base ?

Philippe Back
Monday, March 3, 2003

You should be trying/using Caucho's Resin ( SUPER FAST. Super stable. Amazing community of very bright people following all of its details. I've been using Resin for years with IIS. But it works well on its own.

David Geller
Monday, March 3, 2003

Yes, I used it in the past (not free, $500/CPU).
I want a really cheap software base to work on (busy w/ PostgreSQL).

But I'll try my app on it. A good pair could then be Sybase Anywhere and Resin. But then, I am up to $1000 to start, which is quite expensive for some clients... :-(

There is a good article about these issues here:

and especially this one:

It's amazing to see that Resin is better than Apache 1.x or 2.x ...

Philippe Back
Monday, March 3, 2003

This discussion on connection backlogs (and it's pointer into a Microsoft Knowledge Base article) may be of use:

Cheers, Carl.

Carl Wicklow
Monday, March 3, 2003

*  Recent Topics

*  Fog Creek Home