Why is intranet so slow on our machines? - asp.net

we are using IIS 5 + Windows XP on our machines,
they have Celeron CPUs # 2.6 ghz, 2 GB RAM
These machines have control system for machinery, control system logs events to database and we want to show reports for machinery usage, operator logins, etc.
We use Windows XP and IIS 5, our applications are ASP.NET (3.5). We use Sql server 2005 express and Crystal Reports 10.5 for reporting.
The problem is, that whenever you open an intranet page after reboot or after longer period of webserver's inactivity, it takes a LOT of time for a page to react, 10-30 seconds. When I open up a page that shows a report, it lags for this amount of time too.
When pages are viewed after the first long load, they render quickly.
The pages are precompiled (helped a bit, but not much), disk is not fragmented, sql server reacts fast (tested with other applications) - I really don't know what's the cause, but I'd like to eliminate it, because this looks very bad with the customer - to wait for half a minute for a report page to display.
Why is this so slow? I have done some sample pages on php/mysql/iis and it was lightning fast... Is there something I can do to 'preload' all of the intranet applications on machine reboot? If nothing helps, I'll make a simple script that will periodically request all pages from the webserver, so it will be 'warmed up', but this is a dumb solution, I think. :(

I guess probably the application pool for the web site is not loaded until the first request - this time is for the out-of-process host process to start running and serve up requests.

IIS takes a few seconds to compile each ASPX page after a recycle. You need to create a warmup script that programatically loads a few of your pages after the recycle. The script will incur the delay so your users don't have to.
Here is an example. http://blogs.msdn.com/joelo/archive/2006/08/13/697044.aspx It's for SharePoint, but the concept is the same and you should be able to adapt it.

Related

Why would deleting my ASP.NET MVC 5 application folder and redeploying speed up my sluggish site

I have an ASP.NET MVC 5 application running on Windows Server 2012 on IIS 8.
Every so often my site gets ridiculously sluggish to the point where it takes at least 5 seconds just to load the basic About page. It tends to feel as though it's running in Debug mode, even though my deploy process is automated, so I'm not accidentally deploying in Debug mode, and I can find no signs that it's in Debug mode. I've sometimes wondered if it's a memory issue, but I don't see the server memory getting out of control. I've also wondered if it's something weird with IIS settings such as Application Pool recycling (or something to that effect). I've been dealing with this issue for over a year, not knowing where to look next. I have MiniProfiler running in my development and staging environments, so I'm pretty familiar with the performance of my various site pages etc. Also, I have another web app on the exact same IIS server that doesn't seem to suffer from the same problem. The only difference I can think of between the 2 is that for one site I use Ninject for dependency injection, but I don't for the other site.
I'm really at a loss, but the only "cure" when the site gets bogged down is to completely delete the application files for the site and redeploy. This does the trick every time and then the site will act snappy again (loading the About page in under 1 second). I seem to have to repeat this ritual every week or 2, or at least once a month (whenever I notice the site is at a crawl).

First request is very slow after website sits idle with ASP.NET MVC 3 (IIS7)

I developed a project in ASP.Net MVC 3, my hosting is using iis7 (Win Web Serv 2008 R2), and the first request after the website sit's idle (during about 1-2 hours) is very slow.
I use VPS with 512Mb RAM. Can this be related with a too little RAM?
Can anyone help me with possible causes of such behaviour?
After a certain amount of inactivity IIS unloads the AppDomain. And then the first request loads the application once again which is slower. You could try to configure this period in the properties of IIS but there might also be other causes that an application unloads such as for example a certain threshold of CPU or memory usage is reached. Those thresholds are also configurable in IIS.
That's not something specific for ASP.NET MVC. It's true for all ASP.NET applications in general.
We had also this problem with ruby and passenger that takes the app out of memory after a while, but I found a nice application that fixed this issue for us without changing anything in the server configuration, the app is called wekkars, and you can find it here: http://www.wekkars.com

How long does IIS retain compiled ASP.NET in cache before needing to be recompiled?

I am testing a piece of software called PowershellASP which lets you run powershell scripts inside an ASP.NET page, which I am driving via IIS 7.
Basically, on my test page, the first time it loads it takes over 60 seconds, which I assume is because the ASP.net needs to compile? It is fast on subsequent loads, except it then goes back to requiring 60 seconds+ if I leave it for an hour or so and then try refreshing the page after an hour... Any insight on the likely culprit for this behaviour (i.e. its "slow" after I try to refresh the page after an hour or so)...
Is this the IIS cache expiring and thus needing to recompile the ASP.NET page I'm trying to load or am I barking up the wrong tree?
regards, ted.
EDITED:To increase the idle timeout of a iis application go to advanced settings of your application pool and change the idle timeout to 0. Default is 20 min. The IIS doesn't exactly compile your application it load it into a worker which can take some time based on your application and the iis settings. After some idle the iis automaticly unload your application to save resources, that is why it takes more time after a while. Ones the app is loaded it runs fast.

asp.net mvc 2 website MUCH slower on IIS 7.5 vs built-in server

I am taking some time to learn how to develop asp.net mvc2 websites, but I'm used to working directly off IIS instead of the built-in web server that uses the random ports when you hit F5.
but I've noticed that using the built-in webserver, requests fly and are immediate. I am using only the default project with the Home and About pages as it comes out of the New ASP.NET MVC 2 Project settings, no database connections, nothing beyond the base install...
but when I setup the IIS website and pointed it to the same directory, each request takes at least 3-5 seconds to complete, sometimes more.
this isn't just the "load" on the first request. EVERY request takes this long on IIS.
but if I F5 and test the project once again, everything zips and the responses are immediate.
What might i have configured incorrectly?
this is on win7 x64 by the way
You can check with a tool like firebug what takes the longest time in the request. If you use firebug it will tell you which part of the request cycles takes a certain amount of time. (I once used this when I encountered problems with the localhost URL, Firebug told me that the DNS request took about 2 seconds while using 127.0.0.1 took 1ms (using google I found out that was an issue due to ipv6 enabled)). So try tracing the requests with Firebug.
If the request to IIS is performed quite fast and the browser is waiting for a response for a long time it must be in the handling of IIS (the built-in server and IIS are different). In that case you can try reinstalling IIS (to make sure no plugins or other data is in IIS making the site slower) by removing and adding IIS via the windows components.
If that still doesn't solve the problem try tracing on the application via the built-in tracing capabilities of ASP.NET (http://msdn.microsoft.com/en-us/library/wwh16c6c.aspx)

ASP.Net application slow to load - VS2008

This is my set up on a stage server
compiled my web application
published website
copied the output directory from my machine to stage server
created domain account
created virtual site on a static IP
website runs under domain account created
impersonate set too true as windows integrated authentication is used with sql server
Now first time i hit my stage site, the page is slow to load which i understand, but subsequent request do take a while for the page to load.
planning to run wire shark to see what the traffic is. is there anything else that i should look for?
Note: My IIS and SQL are on the same machine.
You should run it through a profiler to see what it is spending so much time on. SQL Server includes it's own nice query profiler, and if you want a free profiler for .net, there's nprof. If you want to pay for a profiler for .Net, and it's probably worth it in the long run, there's lots of good offerings available.
Can you define slow? how many seconds?
Definitely check the queries to sql server to see what they are doing.
There is always task manager and take a look at cpu/memory. It is not hard to peg a single cpu for example. Anything else on the server?
When having problems I always like to have an empty aspx page just to eliminate other issues.

Resources