IIS Application pool private memory varies during startup - iis

We run a Dot.Net MVC website and we have problems with application pool private memory settings in IIS.
Our host provider has set application pool's Private Memory Limit it to 1GByte and it crashes constantly after some minutes, as it far exceeds this limit (2,4 GByte). They had the kindness to share with us their application pool settings.
We configure our local IIS application pool to the same settings, private memory 1024000 Kbytes.
We run several tests with that settings. In our environment, the private memory that w3wp.exe consumes varies from 1,2 GByte to 700 Kbytes at startup and after that and then lowers about 450 to 600 KBytes even when we run a stress test against it with more than 50 simultaneous users. As the number of users increases, the private memory is lowered, even to 400 Kbytes.
My question is: why are there so many differences?

Related

IIS application pool setting Throttle under load

One of our customers has set the application pool to throttle under load at 35%, and at times they noticed the following event
Event ID: 5210
CPU time for application pool 'abc' has been throttled.
They noticed such events show up in the event viewer log, even though the CPU utilization on the web server is not pegged high, for example < 60%
Would like to know:
• Under what condition does the event id 5210 get generated?
• How does IIS detect contention on the CPU? Is it based on a performance counter etc?
The cause of the issue is there is something misconfiguration with your Application Pool.
open iis manager.
Right-click on the appropriate Application Pool and click Advanced Settings.
Set the Limit to 0 and Limit Action value to NoAction.
IIS 8.0 CPU Throttling: Sand-boxing Sites and Applications
This is strange question: you said you had set AppPool to ThrottleUnderLoad and set Limit to 35%. Why do you wonder when it hits the limit and generates a log record? The most common value for the throttle limit is 80%, which allows to throttle the load a little when there are too many requests and the CPU resources are not enough. I don't see sense to set the limit to 35%, this will slow web responses from your server when it has plenty of CPU time.
I suggest increasing the value. This would decrease the number of 5210 warnings.

Running out of memory in Azure with 50% utilization

I ran into a situation where out of memory exceptions were generated in our Azure App Service for a .Net Core Web API even though memory & utilization topped 50% in the App Service Plan (P2V2: 7GB RAM).
I have looked at this SO article to check private bytes and other things but still don't see where the memory of exhaustion comes from. I see a max usage of 1.5GB on the memory working set which is well below the 7GB.
Nothing shows up under Support + Troubleshooting -> Resource Health or App Service Advisor.
I am not sure where to look next and any help would be appreciated.
Azure App Services caps memory usage at 1.5G by default. But you can change this behaviour with this application setting (to be added under Configuration):
WEBSITE_MEMORY_LIMIT_MB = 3072
See also my answer here:
Is there way to determine why Azure App Service restarted?
The Metrics view on the portal can only go up to a 1 minute granularity level.
(The default is 5 minutes)
This means that each metric point is an average value over a 60-second interval.
It may be spiking up and down over 60 seconds, so you need a more real-time view.
Try the SCM console (Advanced Tools > Go), and check the Process Explorer to see the actual memory consumption.

IIS Workers CPU usage on Windows Server 2016

I have been trying to increase max allowed CPU usage by IIS Application on my Windows Server.
Here's the thing :
When I launch my webapi on Visual Studio IIS the request is proceed within 1,7 sec.
When I launch webapi on my PC's IIS the request is proceed within 3,5 sec.
And finally when I launch webapi on my other machine which has WS 2016 the request is proceed within 10 secs.
CPU usage on VS IIS - can reach 90%.
CPU usage on my PC IIS - can reach 35%.
CPU usage on WS 2016 IIS - can reach max 10%.
My question is, how can I increase max cpu usage on IIS process workers? I have been trying everything :
changing limits in Application Pool settings
changed process priority in Task Manager to "Real Time" and cpu usage increased from 3% to 10% but still it's not enough.

IIS 8, Out of memory , MVC Web site

We have an issue on Live site (MVC .Net).
Max users 25
After every 2-3 hours IIS memory usage peak to Max memory
And All users get a exception saying "System Out Memory"
We then need to restart IIS and All work Well.
Let me know if any solution to fix this.
You should check your application if there is no memory leaks. Also IIS has this behavioir during DOS attack.
Also you can set automatic IIS reset after memory usage increased some amount

Application pool private memory limit is 0

I'm new to IIS. I have several questions about recycling application pool:
Private memory limit and Vitual memory limit are all 0 by default. I read the official document of IIS 7.0 (We are using IIS 8.0 and Windows Server 2012 but I think they should be the same in this respect). So there is really no limit for the memory usage? It's just waiting 1740 minutes (by default) for the application to recycle? It won't recycle even if the total memory usage is very high until 1740 minutes later? I searched very hard for the answers but couldn't find any...
I read an article which said application pool should never be recycled. So what is the mechanism of memory management for IIS? When would the memory not being used be released? Is it similar to Java? I think no one said that full GC in Java is no good practice...
Thanks.

Resources