I have written java server app, it can accept 3800-4000 network connections simultaneously and cpu/network load is low(<40%) But after this threshold it reject new connection or accept it by killing old one, so live connections count is about 3800-4000 (the number varies).
Can anyone give me at least a hint what can be a bottleneck here - my software itself, OS configuration or CPU/NAT(regardless of the fact that they says they are loaded less than 40%)?
CPU: 4-core (one core is loaded 50%, other 3 - 25%) Environment: Amazon EC2, Windows Server 2003 R2
Edit: memory usage is less than 500 Mb JRE is 32bit, 1.6.0_30 MaxUserPort is set to 65534