Aspnet.config update on Azure Web role

I have a SignalR solution that is deployed to Azure Web Role (a cloud service, not an Azure Web Site), and so that we can maximize the number of connections to each instance, I need to make some changes to various ASP.NET parameters described in detail in this article: http://www.asp.net/signalr/overview/performance/signalr-performance#tuning

The appConcurrentRequestLimit and requestQueueLimit parameters were easily changed using the launch task, which uses APPCMD to make the appropriate changes. However, the maxConcurrentRequestsPerCPU parameter is located in the aspnet.config file, which cannot be changed using the same mechanism.

I tried updating this file directly using the launch task (now just replacing the main file), however, it seems to be replaced by the Azure runtime after the completion of the startup tasks, and so the change is lost. I can run RDP into the machine and make changes manually, so I saw that it works, however it is not sustainable for the service we expect to scale up and down on demand.

Any ideas on how to change this setting in an Azure environment would be appreciated!

+6
source share
1 answer

I ended up using the following registry-based approach, which allowed me to change the maxConcurrentRequestsPerCPU parameter without using aspnet.config

I added the following use of the REG command-line utility to my existing startup.cmd (already used to call APPCMD to change other settings):

REG ADD HKLM\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0 /v MaxConcurrentRequestsPerCPU /t REG_DWORD /d 10000 REG ADD HKLM\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\4.0.30319.0 /v MaxConcurrentRequestsPerCPU /t REG_DWORD /d 10000 

This will configure both 32-bit and 64-bit application pools, although in this case I only needed 64.

+6
source

Source: https://habr.com/ru/post/980916/


All Articles