views:

96

answers:

4

I have a website that is hanging every 5 or 10 requests. When it works, it works fast, but if you leave the browser sit for a couple minutes and then click a link, it just hangs without responding. The user has to push refresh a few times in the browser and then it runs fast again.

I'm running .NET 3.5, ASP.NET MVC 1.0 on IIS 7.0 (Windows Server 2008). The web app connects to a SQLServer 2005 DB that is running locally on the same instance. The DB has about 300 Megs of RAM and the rest is free for web requests I presume.

It's hosted on GoGrid's cloud servers, and this instance has 1GB of RAM and 1 Core. I realize that's not much, but currently I'm the only one using the site, and I still receive these hangs.

I know it's a difficult thing to troubleshoot, but I was hoping that someone could point me in the right direction as to possible IIS configuration problems, or what the "rough" average hardware requirements would be using these technologies per 1000 users, etc. Maybe for a webserver the minimum I should have is 2 cores so that if it's busy you still get a response. Or maybe the slashdot people are right and I'm an idiot for using Windows period, lol. In my experience though, it's usually MY algorithm/configuration error and not the underlying technology's fault.

Any insights are appreciated.

A: 

Is the site getting significant traffic? If so I'd look for poorly-optimized queries or queries that are being looped.

Your configuration sounds fine assuming your overall traffic is relatively low.

davidcl
no traffic yet, site hasn't launched. the queries are fast when they run, but sometimes there is no response from the server for the same query.
+1  A: 

What diagnistics are available to you? Can you tell what happens when the user first hits the button? Does your application see that request, and then take ages to process it, or is there a delay and then your app gets going and works as quickly as ever? Or does that first request just get lost completely?

My guess is that there's some kind of paging going on, I beleive that Windows tends to have a habit of putting non-recently used apps out of the way and then paging them back in. Is that happening to your app, or the DB, or both?

As an experiment - what happens if you have a sneekly little "howAreYou" page in your app. Does the tiniest possible amount of work, such as getting a use count from the db and displaying it. Have a little monitor client hit that page every minute or so. Measure Performance over time. Spikes? Consistency? Does the very presence of activity maintain your applicaition's presence and prevent paging?

Another idea: do you rely on any caching? Do you have any kind of aging on that cache?

djna
A: 

To many data base connections without being release? Connecting some service/component that is causing timeout? Bad resource release? Network traffic? Looping queries or in code logic?

Ricardo
+1  A: 

Your application pool may be shutting down because of inactivity. There is an Idle Time-out setting per pool, in minutes (it's under the pool's Advanced Settings - Process Model). It will take some time for the application to start again once it shuts down.

Of course, it might just be the virtualization like others suggested, but this is worth a shot.

Thorarin
ya, that's a good guess. But I doubt it's the culprit because the idle time is set to 20 mins, and the FormsAuthentication is set to 15 mins, so if the app pool was idle, the user would have already been booted out to the login screen. These hangs can occur very quickly. so if I click the various links/filters on the menu within a 1 minute timespan, one of those links will just hang until the user refreshes the browser.