views:

378

answers:

9

Hi all, I've asked this on server fault already but to no avail. So I'm hoping another ASP.Net Developer would have come across my issue.

I've got a Windows VPS running II6 and I'm migrating my ASP.Net applications across to the server. When I navigate to one of those applications it takes approximately 2 minutes to do anything. I created a hello world application and uploaded that, and that to takes 2 minutes to load the first time. If I restart the app pool I get exactly the same issue.

Any application that shares an app pool with another application will work once one application has loaded successfully in that app pool.

I.e. bob.example.com and jane.example.com are in an app pool called ABC1. If I access bob it will take 2-3 minutes to load. After bob has loaded, Jane will work instantly and bob will work instantly. After 5-10 minutes of being idle, or if I restart the app pool, exactly the same process happens again. During the time when bob and jane and working fine, if dave.example.com in app pool XYZ9 is loaded, I must wait 2-3 minutes for that to load too.

Has anyone come across this issue? I am in absolute panic mode at the moment as I need to get these migrated by the end of the weekend.

Oh, and those sites work instantly on the old server. The only difference is that the old server is 32-bit and the new server is 64-bit.

A: 

Could be that the server is probably having problems validating the signed assemblies certificates revocation chain lists. You can disable CRL checks and see if it performs better.

Update

To disable the Certificate Revocation List (CRL) check:

  • Open Internet Explorer
  • Go to Tools —> Internet Options…
  • Go to the Advanced tab
  • Locate the Security section and uncheck the Check for publisher’s certificate revocation option.

This disables globally, for the entire server, the CRL check, and has the side effect of disabling the authenticode CRL checks (ie. the ASP app pool checks). I'm not aware of any more fine grained method. Also, I don't know if this has to be done separately for the x86 version of IE (to apply to 32 bit apps) and to the x64 version of IE (for the 64 bit apps).

Remus Rusanu
What are CRL checks and how do I disable them?
GenericTypeTea
I've updated my post
Remus Rusanu
This makes no differences I'm afraid.
GenericTypeTea
You need to do this on the server, of course, not on the client.
Remus Rusanu
I was doing it on the server. I unchecked the box and OKed it. I then tried to access the page again from the client and it made no difference. It still takes 2-3 minutes.
GenericTypeTea
OK, perhaps is not the CRL check then.
Remus Rusanu
A: 

This could just be the initial appdomain compile startup cost but magnified because you're using a VPS.

What kind of spec have you got on that?

Kieran Benton
It's an 8-way quad core 2.1GHz AMD Opteron with 1GB of RAM. The old server which it all runs fine on is a lesser spec machine with 648MB of RAM. The old server is also a VPS and the sites loads instantly.
GenericTypeTea
Is that the spec of the VPS itself and not the host machine? If so then this obviously isnt the issue :) Another idea would be to run http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx on the box whilst one of these delays is happening and see what kind of IO/registry access is going on.
Kieran Benton
That software doesn't seem to work. When I try to capture it just says "unable to load process monitor device driver".
GenericTypeTea
Is that really the spec of the VPS client? Are you running process monitor as an Administrator? Is there any anti-virus on? That might be causing your problem as well. Which hosting company are you using?
Kieran Benton
GenericTypeTea
I'd try and raise it with them I'm afraid it does sound like something wrong with the instance itself. Any anti-virus running?
Kieran Benton
GenericTypeTea
A: 

I don't have any clue on this question.

However, I read/heard somewhere that - in such a scenario it could be possible that your request goes out on the internet to check for the domain, when it should check first in the local network (related to DNS maybe).

This is totally based on what I can recollect of a similar problem people discussing on an article/podcast.

shahkalpesh
The server is hosted externally. So I don't think this would make any difference? Thanks any way though.
GenericTypeTea
shahkalpesh
Pinging is always around 40-60ms on first time and subsequent attemps.
GenericTypeTea
A: 

Does your application share the same application pool with other web applications? In other words, are you using a third-party VPS and have no control over app pool usage? If so, then the application initialization code for the other apps could be what's causing the slow startup time.

Jacob
Hi, I have full control over the app pools. There's 2 apps in one app pool and one in another. They all share the same problem.
GenericTypeTea
A: 

Under what identity is the application pool running? Domain, or local?

What forms of authentication are you using? If anonymous, what account is it using (domain or local)>

If you check task manager right after iisreset and hitting the website, does it show w3svc running, or are we waiting for it to start at all?

What about a static file, e.g., .htm?

That's all I have - hope this helps.

The App pool is using "IWAM_plesk(default)" as the user. I assume all my user accounts are local as the VPS is part of a workgroup and not a domain. Static pages load instantly. w3svr doesn't run, only w3wp.exe, which loads instantly.
GenericTypeTea
+1  A: 

You say it takes two minutes to start up. What is the system doing during that time? In particular, what is w3wp.exe doing?

I suggest you run SysInternals' Process Monitor to learn a bit about what's going on. It will take a while to come up with a useful filter, but it should be worthwhile.

In particular, the latest versions of this tool can give you information about networking calls being made by the processes you're watching, which will be good if it turns out you've got issues with certificates, proxy servers, or both.

John Saunders
w3wp.exe is using 8-16% of the CPU during the painful load period. I can't get that software to work unfortunately!
GenericTypeTea
You can't get Process Monitor to work? Also, if w3wp.exe is using so little of the CPU, what's your total CPU usage?
John Saunders
Nothing else really of any impact. W3WP runs on its own.
GenericTypeTea
+1  A: 

Instead of requesting a .aspx file, what happens if you request a plain .htm file? The difference is that HTML files don't go through ASP.NET, so if you still get the slowness issue, you'll know that it is more of an IIS thing than an ASP.NET thing.

Though not an answer, it's a step towards isolating the issue.

David Ebbo
HTML pages load instantaneously, sorry, forgot to mention that on this post!
GenericTypeTea
+2  A: 

On shared virtual hosts (VPS), I've found that the disk access can be extraordinarily slow, and vary at times of day. When the application pool spins up, the process has to load from disk and it (presumably) needs to load the .Net framework.

(I asked a similar question here.)

Really, my virtual host is shockingly slow at times so I believe that 2 minutes can be attributable to disk I/O speed. And if your virtual server has a low amount of RAM, it will be worse.

I use a server monitoring service to hit a URL every 30 minutes. This helps keep the app loaded. ASP.net 4.0 has some features which promise to help.

Matt Sherman
A: 

I disabled recycling and that fixed everything...ish. Once it's loaded once it's loaded forever. Still doesn't fix the underlying problem, but 1and1 refuse to help regarding issues with IIS.

GenericTypeTea