I am currently doing some load testing of a NIO TCP/IP based Server:
- Server and Client 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 to the Server.
After a few 1000 connections (Task Manager: 130k Handles), I get the following exception:
Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): connect
at sun.nio.ch.Net.connect(Native Method)
.....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?
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
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)?
Does PC's processor speed/RAM have any effect, i.e. will 300MHz, 128 MB be as good as 1GHz, 1GB RAM?