I have a web server with my web site and I am trying to stress test it but I don’t seem to be able. I think that the problem is that there is a limited number of concurrent connections in XP (Pro).
I wrote a simple client in C# for stress testing:
... for (int i = 0; i < _numThread; i++) { Thread t = new Thread(CallGetHttp); t.Start(); } ... private void CallGetHttp() { WebRequest wrGETURL; wrGETURL = WebRequest.Create(_url); WebProxy myProxy = new WebProxy('myproxy', 80); myProxy.BypassProxyOnLocal = true; wrGETURL.Proxy = WebProxy.GetDefaultProxy(); Stream objStream; objStream = wrGETURL.GetResponse().GetResponseStream(); StreamReader objReader = new StreamReader(objStream); .. }
Is this proper? If so, how can I increase the number of concurrent connections?
The connection limit is on inbound sockets, and it’s hardcoded into XP’s network stack to prevent them being used as servers (more money for Microsoft…) Your only choice is to move to Windows Server if your on a microsoft stack, or legally move to linux if your code will suppport it. Look into mono provided that your not doing anything too specific.
Also be careful to fall into the virtual PC trap. Network access from microsoft virtual PC is via the XP network stack. So if you run linux inside a VM inside XP, you’re still constrained to the 10 inbound connections.