Forum Discussion
IIS performance issues after more than 100 concurrent request.
Modify the machine.config or Web.config to increase the worker threads and I/O threads for your sites:
In Web.config (for individual sites) or machine.config (for global settings):
<system.web>
<processModel maxWorkerThreads="100" maxIoThreads="100" />
</system.web>
Modify maxConcurrentRequestsPerCpu
To allow more requests per CPU, you need to modify the IIS settings for maxConcurrentRequestsPerCpu:
Update aspnet.config or Web.config:
<system.webServer>
<serverRuntime appConcurrentRequestLimit="5000" />
</system.webServer>
Increase ASP.NET Queue Length
Adjust the request queue length to allow the server to queue more requests during high traffic times.
In Web.config:
<system.web>
<httpRuntime executionTimeout="300" maxRequestLength="4096" requestQueueLimit="5000" />
</system.web>
Session Management
If you're using in-process sessions, they might be a bottleneck. Consider moving sessions to Out-of-Process or SQL Server session state to better manage memory and worker thread resources.
Move Session to SQL Server (in Web.config):
<sessionState mode="SQLServer" sqlConnectionString="your-sql-connection-string" cookieless="false" timeout="30" />
Modify IIS Application Pool Settings
Increase Queue Length: In IIS, go to Application Pools > Advanced Settings for each pool, and increase the Queue Length setting (default is 1000, you can increase it to 5000 or higher based on your needs).
Idle Timeout: Ensure the Idle Timeout of the application pool is set to an appropriate value to keep workers alive during periods of low traffic.
Increase CPU Cap for Application Pool
In the Advanced Settings of the IIS Application Pool, adjust the CPU Limit if you’ve set a maximum limit on CPU usage per application pool. This can help prevent worker starvation during high loads.
Consider Load Balancing
If performance issues persist after tuning the above settings, consider distributing the load across multiple servers using a load balancer.
- dayanandsagarSep 07, 2024Copper ContributorShowing error when added
<system.web>
<processModel maxWorkerThreads="100" maxIoThreads="100" />
</system.web>
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineOnly' beyond machine.config.- kyazaferrSep 07, 2024MCT
Solution:
If you need to configure the process model, you must edit the machine.config file instead of web.config.
1. Locate machine.config:
• For a 64-bit machine:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
• For a 32-bit machine:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
2. Edit the machine.config file:
Add the <processModel> section under the <system.web> section in this file.<system.web>
<processModel maxWorkerThreads="100" maxIoThreads="100" />
</system.web>
3. Restart IIS after making the changes by running iisreset from the command line.Note: Changes in machine.config apply globally to all .NET applications running on the machine. Make sure you fully understand the impact of these changes on your environment.