如何限制webdeploy连接数,ERROR_EXCEEDED_MAX_SITE_CONNECTIONS [英] How to limit webdeploy connection number, ERROR_EXCEEDED_MAX_SITE_CONNECTIONS

查看:272
本文介绍了如何限制webdeploy连接数,ERROR_EXCEEDED_MAX_SITE_CONNECTIONS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有10-20个Web项目的解决方案,并且我试图使用msbuild webdeploy进行部署.

I have a solution that has 10-20 web projects, and I am trying to use msbuild webdeploy to deploy them.

msbuild "mysolution.sln" /p:DeployOnBuild=true /p:PublishProfile="Debug"

但是,我在部署过程中遇到了这个错误:

However, I got this error in the middle of deploy:

C:\ Program Files(x86)\ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ Web \ Microsoft.Web.Publishing.targets(4295,5):msdeploy错误ERROR_EXCEEDED_MAX_SITE_CONNECTIONS:Web部署任务失败. (已超过此站点的最大连接数.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5): msdeploy error ERROR_EXCEEDED_MAX_SITE_CONNECTIONS: Web deployment task failed. (The maximum number of connections for this site has been exceeded.

在此错误之前的日志中,已部署了一些项目并更新了文件.似乎msbuild正在尝试同时部署尽可能多的项目,并且超出了最大连接数.

In the log, before this error, a few projects were being deployed and files were updated. It seems that msbuild is trying to deploy as many as projects at the same time as possible, and exceeded the max connection number.

那么我如何限制连接数,发布配置文件中是否有一个选项?

So how can I limit the connection number, is there an option in the publish profile?

更新-解决方法

我在Sitecore闲置频道中遇到了来自viet.hoang的变通办法.基本上,它会增加服务器上的最大连接数和/或在发布配置文件中重试尝试次数.

I have got a workaround from viet.hoang in Sitecore slack channel. It basically increases the max connection number on the server and/or retry attemps in the publish profile.

  1. 增加最大连接数:转到目标服务器,然后将以下内容添加到注册表中:[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ IIS Extensions \ MSDeploy \ 3]"MaxSiteConnections" = dword:00000010.然后重新启动Web管理服务.
  2. 增加重试次数:在发布配置文件中,有一个选项"RetryAttemptsForDeployment",将其添加并将其值设置为20.

解决方法有效,部署中没有更多错误.但是我仍然希望有人能够提供一些见解和适当的解决方案,而无需修改注册表,并且可以迅速抛出其他类型的错误,而无需重试20次.

The workaround works, no more error in the deployment. But I am still hopeful that someone will be able to provide some insights and a proper solution that doesn't require registry modification and can throw other types of errors quickly without retry 20 times.

推荐答案

方法1-通过MSBuild限制连接

有一种方法可以限制MSBuild可以使用的线程数.

Method 1 - Limit connection via MSBuild

There is a way to limit how many thread MSBuild can use.

msbuild.exe mysln.sln /maxcpucount:3  

"maxcpucount"限制了MSBuild线程,因此限制了可以同时发布多少个项目.如果未定义,则MSBuild实际上将使用最多计算机上的处理器数量.

The "maxcpucount" limits the MSBuild threads, thus limit how many projects can be published at the same time. If it is not defined, MSBuild will actually use up to the number of processors on the computer.

参考: https://msdn.microsoft.com/zh-CN /library/bb651793.aspx

向服务器添加注册表值

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ IIS Extensions \ MSDeploy \ 3]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3]

"MaxSiteConnections"(DWORD值):0

"MaxSiteConnections" (DWORD Value) : 0

然后重新启动"Web管理服务".

Then restart "Web Management Service".

将注册表值设置为0时,表示无限连接.

When you set the registry value to 0, it means unlimited connection.

参考:此 Microsoft文档

这篇关于如何限制webdeploy连接数,ERROR_EXCEEDED_MAX_SITE_CONNECTIONS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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