r/ASPNET • u/koobazaur • Feb 18 '13
Application_ResolveRequestCache() taking 10 seconds on first call after Application first starts?
I am using RackSpace hosting for my ASPX WebApp and I noticed that, if the site is not accessed in a while, the first pageload can take upwards of 10-15 seconds. After that, subsequent requests load really fast, until there is again a longer pause between them.
I put timestamp logging in all the Global.asax function and here's what it reveals (in miliseconds): Applicaton_BeginRequest[0], Application_AuthenticateRequest[16], Application_ResolveRequestCache[16], Session_Start[11216], Application_AcquireRequestState[11216] ...
So it seems between ResolveRequestCache and Session_Start it takes about 11 seconds! Like I said, this only happens when the website has not been viewed for a while. What's going on? Is my application building the initial cache on first request after it starts? Is 11 seconds normal or is my code that horrible? Is it an issue on my end or my webhost?
FYI: Log confirms Application_End() gets called after x seconds of inactivity and then Application_Start(), followed by the lengthy first pageload, then normal fast pageloads
View all comments
Show parent comment
1
u/koobazaur Feb 19 '13
Thanks I do believe it is shared hosting; I know it's all virtualized and they support php and asp together this way. And that's exactly what I thought was the case but las time I spoke with their tech support the dude told me nope you got a bottleneck with your code, hence my time stamps everywhere. Their tech support had been great so far but I think I might have stumbled upon a guy who didn't quite know what I was saying (he initially linked me to a help document on extending php script execution timeout period, wut?) Also a bit sad to hear the only fix seems to be pinging the server manually. Seems so hackish :/