更新aspnet.config在Azure Web角色 [英] Updating aspnet.config on Azure Web Role

查看:244
本文介绍了更新aspnet.config在Azure Web角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个部署到Azure的Web角色(云服务,而不是Azure的网站)一个SignalR解决方案,以确保我们能够连接的数量最大化每个实例,我需要做出一些改变各种ASP.NET设置详见本文: http://www.asp.net/ signalr /概述/性能/ signalr性能#调整

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

该appConcurrentRequestLimit和requestQueueLimit设置很容易与使用APPCMD做出相关修改启动任务改变。然而,maxConcurrentRequestsPerCPU设置驻留在其中无法通过相同的机制被更改的aspnet.config文件

The appConcurrentRequestLimit and requestQueueLimit settings were easily changed with a startup task that uses APPCMD to make the relevant changes. However, the maxConcurrentRequestsPerCPU setting resides in the aspnet.config file which cannot be changed via the same mechanism.

我曾尝试直接与启动任务(只是一个基本的文件替换现在)更新该文件,但它似乎得到了Azure的运行时更换了启动任务已经完成,因此改变丢失后。我可以RDP到机器并进行手动更改,所以我已经看到,它的作品当然,这是不可持续的,我们预计规模向上和向下的需求服务。

I have tried updating that file directly with a startup task (just a basic file replacement for now), however it seems to get replaced by the Azure runtime after the startup tasks have completed and so the change is lost. I can RDP into the machine and make the change manually so I have seen that it works however that is not sustainable for a service that we expect to scale up and down on demand.

这是如何在Azure的环境更改此设置将AP preciated任何想法!

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

推荐答案

我最终使用下面的注册表基础的方法这让我改变maxConcurrentRequestsPerCPU设置,而无需使用aspnet.config

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

我添加了REG命令行实用程序的以下使用到现有的STARTUP.CMD(已用于调用APPCMD更改其它设置):

I added the following usage of the REG command line utility to my existing startup.cmd (already in use for calling 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

这将配置32位和64位应用程序池,虽然我只有在这种情况下需要64。

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

这篇关于更新aspnet.config在Azure Web角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆