On 5/30/06, Matt Keane <[EMAIL PROTECTED]> wrote:
Hi

I am currently doing some load testing of a NIO TCP/IP based Server:
- Server and Client (MINA based) on same machine.
- PC: P4, 3GHz, 1GB RAM, Windows XP, SP2

I seem to always reach a limit on the number of connections to the Server
(not sending any messages), i.e. using a single client making multiple
connection requests, after a few 1000 connections (Task Manager: 130k
Handles), I get the[code][/code] following exception:
...
java.io.IOException: Failed to get the session.
at ....
Caused by: java.net.SocketException: No buffer space available (maximum
connections reached?): connect
at sun.nio.ch.Net.connect(Native Method)
.....

This seems like you are running out of memory.

I have tried the following, (with little or no success):
- Changing some of the registry settings, e.g. TCPNumConnections,
MaxUserPort. (No effect)
- Using Heap buffers (No effect)
- Using the compiler options (CPU usage went from 100% to 75%): -Xmn
100M -Xms -500M -Xmx 500M

Will using a non-NIO Client help?

Shouldn't make a difference, since it ultimately comes down to number
of sockets that can be held open.

Is this problem Win XP O.S. specific. Does Win XP place a limit on the
number of:
- Simultaneous TCP connections
- File Handles/Descriptors
- Socket buffer size

I've seen that Windows Server 2003 is best for this kind of job.  It
handles multiple concurrent connections much more effectively.
Windows XP is a desktop OS, not designed for running servers.

If the problem is O.S. related:
- Can any of the above parameters be changed, e.g. Registry settings
- What would the best OS for a Server, e.g. Windows Server 2000/2003, or
Linux (which version: Redhat, Fedora, Debian)?

I'm biased towards UNIX based systems, so I wouldn't be the right
person to ask.  The latest 2.6 based kernels have excellent networking
support.

Does PC's processor speed/RAM have any effect, i.e. will 300MHz, 128 MB be
as good as 1GHz, 1GB RAM?

RAM is the concern in your case.  You should try reducing the amount
of memory being used per file descriptor, thread etc.  Increasing RAM
will be the biggest help IMO.  I've noticed that the JVM even drops
connections when it starts running out of memory.

As a final resort, if you want me to run some tests on my machines,
you could send me the source/binaries and I'll try to get it done.
I've seen the following stats with just a connector client/server -

with notifyIdleSessions() commented



total connections - 103432

jvm mem usage - 541M

jvm vm size - 1.5G

file handles - 311,392

cpu usage - 30%



total file handles - 421919

mem usage - 1915M


HTH,
Vinod.

Reply via email to