I have a simple application that listens for TCP connections on a specific port and creates a new thread to handle each connection. The app is written in C#.NET 4.0 and uses the TCPListener object to handle the underlying socket connections.
I also have a simple load testing tool that creates a TCP connection to my service and then disconnects. I can set it to send thousands of requests all at the same time.
So, if I run the tcp server app on windows server 2003 I can send 10,000+ requests to it without any of them failing. But, when I run it on windows server 2008 R2 I can only send about 2,000 without any failures.
Here are the results of my tests for windows server 2008 R2...
D:\>EchoServerTest.exe -server server01 -port 8000 -connections 10000
Creating 10000 connections
All connections in progress
All connections complete in 20816ms
7252 established. 2748 failed.
Connection establishment errors
1693 - The semaphore timeout period has expired.
1055 - The remote computer refused the network connection.
Test Passed
Here are the results of my tests for windows server 2003...
D:\>EchoServerTest.exe -server server02 -port 8000 -connections 10000
Creating 10000 connections
All connections in progress
All connections complete in 3807ms
10000 established. 0 failed.
Connections reset
642 - An existing connection was forcibly closed by the remote host.
Test Passed
Two different OS's but same code being executed. Anyone have any ideas on why the performance is worse on 2008 R2?
Thanks.