I've got an app pool that is recycling exactly every minute. The Private memory is set to 1433600KB Virtual memory is set to 2457600KB (yes its a lot). The recycling regular time interval is left at its default value of 1740. From what I can see the memory limit is not near being reached when the recycling happens. I can't find anything shceduled on the server that could be causing this either.
Does anyone have any ideas as to what could be the cause of this?
We had the same issue. Don't know if is solution for you, but we disabled Virtual memory recycling setup (keep Private memory enabled) and app pool stops recycling.
Check this article about large memory reservations.
Ensure recycle logging is turned on for all possible values (right click on the application pool, select "Recycling", then click "next" to see the logging).
Then when it recycles you should receive a "WAS" sourced event in the System Event Viewer that tells you specifically why it recycled.
We had the same issue. The problem was fixed by changing the Ping Maximum Response Time which was too low.
Related
I have an ASP.net website where I am facing a session timeout issue. In web.config I have set session timeout to 480 (8 hours as session time). But even then session does not stay that long; it goes out after a number of minutes. Why is that and how I can fix it? My site is hosted on a shared hosting server.
By default Session time in asp.net is 20 min, and we can change it by setting Web.config file.
Now in your case you are setting it to 8 hours but went out in 1 min.
Do you know that there are few point by which session can be time out?
*) When it is wrongly configured in Web.Config file.
*) We can set this time out in server (IIS) also, so if its default setting is changed.
*) When the total memory of session is higher that the assign in shared host.
*) When there are some internal error at run time in any page, then session will be lost.
*) When some one or any process is changingadding any aspx file or web.config file at runtime.
So check all these point. I am sure it will resolve your problem...
Also, have you checked the app pool recycling options?
Your hosting provider have probably set some low value in "Recycle worker processes" in IIS for your application pool. Not sure if they can change that for you but you could try to ask them.
There are many reason which cause your session timeout before the actual value configure in web.config file.
one such reason is that if you hosted your applcation and forgot to reset the app pool after deployemnt.
or
once you deploy the application for first time then its corresponding app pool may get reset dusring the first run of application.
or if your app pool may get crash in between the process..
You can diagnose this problem first check your app pool (in advanced settings- if you hosted your application in IIS) now by going to the Event Viewr and check the logs in Custom Views go to server role then find the log by clicking find button at right side pane and paste your app pool name in search box.
check for the error or warning message related to app pool.
i hope this ma help you
When adding items using the default insert method Insert(key, value) and as such using the default behavior of HttpRuntime.Cache, when does the scavenging take place?
The limit on the application pool that hosts my application is 0 (unlimited)... but I see no way to find out how big the cache can get before scavenging occurs? The problem is I am caching a potentially very large amount of data but I have limited memory on the server and I want to avoid recycling of the app pool.
I am asking in the context of IIS6 and IIS7.
Thank you.
The short answer is that the cache begins to scavenge at Cache.EffectivePrivateBytesLimit.
The default limit is calculated using a number of factors, and generally should keep your process from excessive recycling. Ideally an application won't be affected by a recycle, but I realize there are many reasons why that isn't always possible. If needed, you should be able to set memory limits for the cache in coordination with the app pool recycle settings.
Thomas Marquardt from the asp.net team wrote a very interesting post explaining the details.
If the leave the webpage (any webpage) on my web application for a while (say 15 min), if I again click on another page it takes a long time to load (20 seconds)
I had a look through the google chrome --> developer module and found that, it is the web page which is the culprit here and the 'LATENCY' time for it is 17 seconds !!! and the actual 'download' time is only 117 ms.
A. what could be the cause of this issue?
B. What can I do to fix it?
thanks.
By default in IIS, your worker processes will idle timeout after 20 minutes and have to be reloaded. This is a configurable setting.
Here's the documentation for IIS6
I am quite certain that it is caused by your worker process recycling. Go to your IIS and check the application pool setting. There is a setting to say that it will automatically recycle after certain time. Either turn it off or increase it
I can't really give you a specific answer here, as I don't know exactly what you may be doing with your application. However, ASP.NET and IIS will not keep everything your web app uses in memory forever. There are two things that could be the culprit here:
1) Your ASP.NET session is timing out, and you are putting something large with a lengthy load in the user session.
2) The IIS app pool is recycling after its idle timeout.
I think that the timeout for both of those is 20 minutes, which would roughly correspond with the 15 minutes or so you are seeing.
I have a WCF service that requires a certain response time (under 1 minute).
My problem is that every so often, most often in the mornings the service takes a long time to respond (sometimes over 2 minutes).
I'm thinking this is because the app has recycled and the first run must recompile.
Are there other reasons this might happen?
Is it possible to turn off app recycling? And if it is, will that cause any side effects or instability? I'm assuming there must be a reason why asp.net apps are set to recycle.
Is there anything else that can be done to improve that first run performance?
Yes you can prevent the AppPool from recycling. Another option would be to create a keep-alive job to continually ping the service to keep the worker process from sleeping.
Basically the following rules dictate when an application is recycled or unloaded:
After the App Pool Recycle time has been reached - by default this is every 29 hours I think.
A set time after the last request to application.
Using a keep-alive to ping the service would solve 2, and then you'd just have to deal with 1.
Depending on your version of IIS, there are slightly different ways to configure this.
For IIS 6
For IIS 7
The idle time out I think would normally default to "infinte", but can be configured through the processModel element (idleTimeout attribute) of your configuration files.
As to first run performance - without looking at your app it's hard to say, have you run something like DotTrace or another profiler over it?
Are you doing a lot of intensive lookups and caching data in that first load? Can these be deferred?
Performance problems can be caused by anything you haven't ruled out first. Since you haven't ruled anything out, it could be cauased by anything at all.
Maybe a silly idea : could you schedule a console app to hit your service at e.g. 5:30am in the morning, so that this request would take a long time to run, and your regular users coming in after that won't have that problem?
Sure - it's not dealing with the root cause, but for the time being, it might be a useful workaround - no?
Marc
We are having an intermittent problem with some users losing session. Our session settings in the web.config are as follows:
<sessionState mode="InProc" timeout="1440"/>
...which should be 24 hours (a value deliberately set over the top during testing).
Are there any other settings (maybe in IIS7) that I need to be aware of? Or are there any resources that will list the things that could kill a user's session?
Let me know if you need more information.
Thanks!
Dave
Changing the web.config file, or any of the dlls will cause the session to be destroyed, as will the recycling of app pools (this is usually set to a timeout of 20 mins of inactivity, but will also occur under certain exception conditions and possibly memory conditions)
Check Application Pool settings. There are several things there that can interfere with this:
Process recycling settings;
Several processes (then each would be keeping its own session stash);
Changing web.config or other web related files recycles the process immediately.
Anything that recycles the application pool will kill InProc session state.
Check the properties on the application pool by default there are several settings which may cause the pool to recycle in less then 24 hours.
Typically when testing there is little activity on the site and you fall foul of the pool idle timeout.
Thanks for all the replies, it seems it was because the App Pool was set to recycle at 3am and some of the users were just leaving themselves logged in over night and then just carrying on in the morning! We've added better session timeout handling now.
Thanks again!