IIS Application Pool Settings are important for the performance and stability of your web applications.
Why is this so important ?
- Memory Management:
- Prevent Memory Leaks: Over time, applications may develop memory leaks, consuming more memory than necessary. Recycling helps reclaim resources and prevent these leaks
- Fragmentation: Even without leaks, memory fragmentation can occur, leading to inefficient memory usage. Recycling helps mitigate this issue
- Performance Optimization:
- Resource Reclamation: Recycling ensures that unused resources are freed up, maintaining optimal performance.
- Fresh Start: It provides a fresh start for the application, which can improve responsiveness and reduce latency.
- Stability and Reliability:
- Prevent Crashes: Regular recycling can prevent application crashes caused by resource exhaustion or other issues.
- Consistent Performance: It helps maintain consistent performance by periodically resetting the application state.
- Scheduled Maintenance:
- Off-Peak Hours: Recycling can be scheduled during off-peak hours to minimize disruption to users.
- Application Updates: After deploying updates, recycling ensures that the new code is loaded and running.
- Configuration Flexibility:
- Customizable Settings: IIS allows you to configure recycling based on various parameters such as time intervals, specific times, request limits, and memory usage.
Overall, recycling is a proactive measure to ensure that web applications remain stable, performant, and reliable over time.
A very helpful guide to best practice can be found here: 10 IIS application pool settings best practices
Note: There is no "one size fits all" solution. The settings can vary depending on the physical environment and resources as well on the running application.
Suggested settings for i4SCADA:
-
Idle-Timeout
- reduce the default from 20 to 10
-
Regular interval
- reduce from default 1740 to 720
-
Rapid Fail protection
- Set to True
- Keep default interval 5 errors in 5 minutes
-
Maximum Worker Processes / WEB Garden
- Use a thumb rule of 1 WP per CPU core
- Use this setting with care
- More worker processes will use more ressources
-
CPU-Limit
- Use 80 - 90% as a thumb rule
-
Private memory limit / virtual memory limit
-
Private Memory Limit:
- Definition: Private Memory refers to the physical memory (RAM) allocated exclusively to a worker process. This memory is not shared with other processes
Function: When the private memory limit is reached, the application pool is recycled to prevent excessive memory usage and potential memory leaks - Usage: This limit helps ensure that a single process does not consume too much physical memory, which could affect the overall performance of the server
- Definition: Private Memory refers to the physical memory (RAM) allocated exclusively to a worker process. This memory is not shared with other processes
-
Virtual Memory Limit:
- Definition: Virtual Memory includes both the physical memory and the paging file on the disk. It represents the total memory that a process can reserve
- Function: When the virtual memory limit is reached, the application pool is recycled to prevent the process from reserving more memory than is available
- Usage: This limit is useful for controlling the total memory footprint of a process, including both RAM and disk space
-
Key Differences:
- Scope: Private Memory is limited to physical RAM, while Virtual Memory includes both RAM and disk space
- Impact: Private Memory Limit directly affects the physical memory usage, whereas Virtual Memory Limit controls the overall memory reservation, including paging
- These limits help manage resources efficiently and ensure the stability and performance of web applications hosted on IIS.
-
Settings:
- So private limit can be 1 - 4 GB whereas the virtual limit might be 4 - 8 GB depending on the available ressources. However, a higher limit will hide possible memory leaks as the App Pool will be recycled later.
-
Private Memory Limit:
-
Queue length
-
- As a thumb rule set 4000
-
-
Overlapping recycle
-
- Enable overlapping recycle
-
In addition, not all settings should be changed in one go.
Proceed slowly and step by step to check the performance improvement.
Perhaps start with CPU and virtual/private memory and time-based recycling first. Then adjust the other settings.