Hi @Alessandro,
By default, IIS application pools may not utilize all available resources. You can adjust application pool settings to increase the number of worker processes to better utilize CPU cores. To do this, follow these steps:
- Open IIS Manager.
- Select your application pool.
- Click Advanced Settings.
- In the Process Model section, adjust the value for Maximum worker processes.
The following will discuss 5 best practices for setting the IIS Maximum Worker Process and how to monitor and adjust settings to ensure optimal performance. By following these best practices, you can ensure that your web server is running at peak efficiency.
1. Set the MaxProcesses value to a number equal to or greater than the total number of logical processors.
When the MaxProcesses value is set to a number that is less than the total number of logical processors, IIS will not be able to fully utilize all available resources. This can result in reduced performance and scalability. By setting the MaxProcesses value to a number equal to or greater than the total number of logical processors, you ensure that IIS can use all available resources for maximum efficiency.
2. If you set the MaxProcesses value to 0, IIS uses the following formula to calculate the maximum number of worker processes:
The formula is: MaxProcesses = (number of CPUs * number of cores) + 1. This ensures that the maximum number of worker processes is equal to or greater than the total number of cores available on the server, which helps ensure optimal performance and scalability. Additionally, setting this value to 0 allows IIS to automatically adjust the number of worker processes as needed based on system load.
3. The MaxProcesses value must be between 1 and 20 for 32-bit systems and between 1 and 512 for 64-bit systems.
This value is used to determine the maximum number of worker processes that can be created for the application pool. It's important to set this value correctly because too few worker processes can cause poor performance, and too many can cause memory and CPU issues. The best practice is to start with a lower MaxProcesses value and increase it as needed until you find the best setting for your environment.
4. Do not set the MaxProcesses value to a number that is less than the number of CPUs on the server.
When the MaxProcesses value is set to a number that is less than the number of CPUs on the server, it can cause performance issues. This is because IIS will not be able to fully utilize all available CPU resources and bottlenecks may occur. Additionally, setting the MaxProcesses value too low can cause increased memory usage because each process requires more memory to handle the same number of requests.
5. For example, if you have four CPUs on your server, do not set the MaxProcesses value to 2. When the MaxProcesses value is set to 2, IIS will only use two of the four CPUs. This means you are not fully utilizing all available resources on the server and may be limiting its performance. By setting the MaxProcesses value to 4 (or higher, if necessary), you can ensure that IIS uses all available CPU cores and maximizes the performance of the server.
Finally, if you do need to change the MaxProcesses value, regularly monitor the performance of your IIS server to ensure that the MaxProcesses value remains appropriate. If you notice any performance degradation or other issues, you may need to adjust the MaxProcesses value accordingly.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the email notification for this thread.
Best regards,
Yurong Dai