Sunday, September 20, 2009

Lessons Learned from Setting Up One's Own Test Server

I've had occasion to set up a simple test server on which to test an AJAX enabled ASP.Net web app. 99% of the time there'll be just me or a client (in a distant location) testing it. Knowing that this load was quite small, I felt confident using an old P4 machine with Windows XP.

But lo and behold, strange things started occurring. At seemingly random times the app would hang. This was most often noticeable when I was opening a treeview and additional nodes were being loaded on demand. It was strange though because this never happened within the Visual Studio 2008 debug environment. It also never occurred when I opened a browser on the test server itself and connected via the localhost. So what was the problem?

At first I thought it had something to do with the fact that from my workstation I was going out to the Internet and then coming back into the test server. This would explain an increased latency (lag time) but not necessarily explain why it was timing out so frequently.

Eventually, through the help of ASP.Net forums contributor Jeffery Tay, I found the answer! When I mentioned to him that I was using Windows XP on the test server he immediately clued me into the fact that the default number of connections for XP was just 10. Because multiple connections are frequently opened for even simple operations, this might explain why the server appeared to be hanging. After a little research I found this useful discussion. It showed me how to bump up the connection limit to 39.

Only time will tell if this is a complete & final solution but so far it appears to have resolved everything!

Friday, September 18, 2009

Frustrating Deployment Experience!

I've deployed a few simple AJAX-enabled web pages to a local server that is accessed through the Internet by just two people: me & a client.

When running locally in the VS2008 environment it works perfectly fine but when accessed through this server there are frequent and mysterious timeouts. There appears to be no pattern to when & why they occur. Sometimes I get strange errors with codes in the 40000 & 50000 range. Other times it just hangs. There is so little load on this server that I do not understand why this is occurring.

I suspect this is an AJAX related problem but am not sure of that. I'm wondering if anyone else has experienced something similar and might have some tips about how to resolve it?