Score:0

IIS 8.5 and 10, max value that can be set for IIS Requests/Recycle?

id flag

Per DISA we're required to set the recycling option for requests. I can't seem to track down what the max value for this should be or when the counter gets restarted? If app pools are configured to recycle at midnight, shouldn't the requests counter reset to 0? We set what we thought was a high limit at 99,999 but this seems to get hit everyday around noon on all 3 of our balanced servers. Sometimes shortly after the private bytes limit gets hit (also has to be set per STIGs but is roughly 70% of total OS memory) issuing another recycle request, where I believe either too many queued requests are in process or garbage collection is struggling (hence cpu/mem spikes) to issue full garbage collection during peak workload. I've seen that IIS 6.5 had 35,000 request but can't seem to find good guidance on what the max value could be for IIS 8.5 and IIS 10 (for when we migrate). We didn't notice we were hitting the requests limit due to that logging not being enabled by default in IIS 8.5, but is in IIS 10. We also noticed the parent defaultapppool bound to the default site where the ssl cert is bound to does trigger a full garbage collection event against the child app pool (probably because of shared config settings for security). If anyone needs a handy script to set all your pools to recycle at midnight/enable logging for iis 8.5, that's below.

Import-Module WebAdministration
Get-ChildItem –Path IIS:\AppPools | ForEach-Object{

$appPoolName = $_.name
$appPool = Get-Item "IIS:\AppPools\$appPoolName"
$appPool.recycling.logEventOnRecycle = "Time, Requests, Schedule, Memory, IsapiUnhealthy, OnDemand, ConfigChange, PrivateMemory"
$appPool.Recycling.periodicRestart.time = "0"
clear-ItemProperty "IIS:\AppPools\$appPoolName" -Name Recycling.periodicRestart.schedule #clear values
set-ItemProperty "IIS:\AppPools\$appPoolName" -Name Recycling.periodicRestart.schedule -Value @{value="00:00:00"}
$appPool | Set-Item

}
Lex Li avatar
vn flag
Which setting(s) are you referring to? `time` under `periodicRestart`? The proper data you should provide is of `timeSpan` type, not an integer, https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/recycling/periodicrestart/
Nicholas McQuillen avatar
id flag
No, recycle setting in app pool for requests. Sorry, thought that was clear. It's also under periodic restart as far as application hosts xml file
Nicholas McQuillen avatar
id flag
This is a web forms application using .net 4.8 as target framework and currently only at EF 6.1 with upgrades to 6.4 in process (mainly to use d functions.like for better performing string evals than .contains()). Not a lot of operations saturating loh, but gc1 skyrockets during full gc as far as perfmon counters. I don't see substantial pinned objects to believe compacts from gcsever should alleviate, so a bit confused.
Lex Li avatar
vn flag
So you were referring to `requests` in https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/recycling/periodicrestart/#attributes. That setting has no upper bound at least from the schema. You can set any value as long as it is a valid `uint`.
Lex Li avatar
vn flag
Please treat IIS application pool recycle separately from .NET GC processing, as pool recycle happens even for non-.NET web apps (classic ASP, PHP and others). If you try to analyze further on your web apps with ASP.NET/.NET ETW enabled, you can see what CLR/GC does under the hood, https://docs.microsoft.com/en-us/dotnet/framework/performance/garbage-collection-etw-events and no need to guess what happens.
Nicholas McQuillen avatar
id flag
Lex Li, your answer on unit was what I was looking for. If you add it as an answer I'll note as answered per you. Thank you for the GC guidance, we noticed full GC was occurring at the same time as pool recycles so I'll have to dive into that a bit further.
Score:0
vn flag

Copied from the comment.

If we limit the discussion scope to a specific setting (aka requests in IIS application pool configuration), then that setting has no upper bound (at least concluded from the IIS XML schema).

You can set any value as long as it is a valid uint.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.