我需要更改 TCP InitialCongestionWindow 的默认值
我读过这个文件: https://www.iispeed.com/blog/windows-server-2012-and-tcp-slow-start
我在我们的 hyper-v 托管虚拟服务器 2012 R2 上尝试了它。
PS C:\>Set-NetTCPSetting -SettingName Custom -InitialCongestionWindow 10 -CongestionProvider CTCP
我收到错误:
Set-NetTCPSetting : No MSFT_NetTCPSetting objects found with property 'SettingName' equal to 'Custom'. Verify the valu
e of the property and retry.
At line:1 char:1
+ Set-NetTCPSetting -SettingName Custom -InitialCongestionWindow 10 -CongestionPro ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Custom:String) [Set-NetTCPSetting], CimJobException
+ FullyQualifiedErrorId : CmdletizationQuery_NotFound_SettingName,Set-NetTCPSetting
问题是我如何才能实现 IISspeed 文档中所说的内容?如果我在 Hyper-v 机器上更改此设置,是否还需要在 hypers-v 主机上进行更改才能真正产生效果?
我是否也应该对 SSL 端口 443 进行同样的更改?
我运行了这个命令:
PS C:\Users\Administrator> Get-NetTCPSetting
SettingName : Automatic
MinRto(ms) :
InitialCongestionWindow(MSS) :
CongestionProvider :
CwndRestart :
DelayedAckTimeout(ms) :
DelayedAckFrequency :
MemoryPressureProtection :
AutoTuningLevelLocal :
AutoTuningLevelGroupPolicy :
AutoTuningLevelEffective :
EcnCapability :
Timestamps :
InitialRto(ms) :
ScalingHeuristics :
DynamicPortRangeStartPort :
DynamicPortRangeNumberOfPorts :
AutomaticUseCustom :
NonSackRttResiliency :
ForceWS :
MaxSynRetransmissions :
SettingName : InternetCustom
MinRto(ms) : 300
InitialCongestionWindow(MSS) : 4
CongestionProvider : CTCP
CwndRestart : False
DelayedAckTimeout(ms) : 50
DelayedAckFrequency : 2
MemoryPressureProtection : Enabled
AutoTuningLevelLocal : Normal
AutoTuningLevelGroupPolicy : NotConfigured
AutoTuningLevelEffective : Local
EcnCapability : Enabled
Timestamps : Disabled
InitialRto(ms) : 3000
ScalingHeuristics : Disabled
DynamicPortRangeStartPort : 49152
DynamicPortRangeNumberOfPorts : 16384
AutomaticUseCustom : Disabled
NonSackRttResiliency : Disabled
ForceWS : Disabled
MaxSynRetransmissions : 2
SettingName : DatacenterCustom
MinRto(ms) : 20
InitialCongestionWindow(MSS) : 4
CongestionProvider : DCTCP
CwndRestart : True
DelayedAckTimeout(ms) : 10
DelayedAckFrequency : 2
MemoryPressureProtection : Enabled
AutoTuningLevelLocal : Normal
AutoTuningLevelGroupPolicy : NotConfigured
AutoTuningLevelEffective : Local
EcnCapability : Enabled
Timestamps : Disabled
InitialRto(ms) : 3000
ScalingHeuristics : Disabled
DynamicPortRangeStartPort : 49152
DynamicPortRangeNumberOfPorts : 16384
AutomaticUseCustom : Disabled
NonSackRttResiliency : Disabled
ForceWS : Disabled
MaxSynRetransmissions : 2
SettingName : Compat
MinRto(ms) : 300
InitialCongestionWindow(MSS) : 2
CongestionProvider : Default
CwndRestart : False
DelayedAckTimeout(ms) : 200
DelayedAckFrequency : 2
MemoryPressureProtection : Enabled
AutoTuningLevelLocal : Normal
AutoTuningLevelGroupPolicy : NotConfigured
AutoTuningLevelEffective : Local
EcnCapability : Enabled
Timestamps : Disabled
InitialRto(ms) : 3000
ScalingHeuristics : Disabled
DynamicPortRangeStartPort : 49152
DynamicPortRangeNumberOfPorts : 16384
AutomaticUseCustom : Disabled
NonSackRttResiliency : Disabled
ForceWS : Disabled
MaxSynRetransmissions : 2
SettingName : Datacenter
MinRto(ms) : 20
InitialCongestionWindow(MSS) : 4
CongestionProvider : DCTCP
CwndRestart : True
DelayedAckTimeout(ms) : 10
DelayedAckFrequency : 2
MemoryPressureProtection : Enabled
AutoTuningLevelLocal : Normal
AutoTuningLevelGroupPolicy : NotConfigured
AutoTuningLevelEffective : Local
EcnCapability : Enabled
Timestamps : Disabled
InitialRto(ms) : 3000
ScalingHeuristics : Disabled
DynamicPortRangeStartPort : 49152
DynamicPortRangeNumberOfPorts : 16384
AutomaticUseCustom : Disabled
NonSackRttResiliency : Disabled
ForceWS : Disabled
MaxSynRetransmissions : 2
SettingName : Internet
MinRto(ms) : 300
InitialCongestionWindow(MSS) : 4
CongestionProvider : CTCP
CwndRestart : False
DelayedAckTimeout(ms) : 50
DelayedAckFrequency : 2
MemoryPressureProtection : Enabled
AutoTuningLevelLocal : Normal
AutoTuningLevelGroupPolicy : NotConfigured
AutoTuningLevelEffective : Local
EcnCapability : Enabled
Timestamps : Disabled
InitialRto(ms) : 3000
ScalingHeuristics : Disabled
DynamicPortRangeStartPort : 49152
DynamicPortRangeNumberOfPorts : 16384
AutomaticUseCustom : Disabled
NonSackRttResiliency : Disabled
ForceWS : Disabled
MaxSynRetransmissions : 2
答案1
您需要首先创建传输过滤器,它将 TCP 设置指定为NetTcpSetting
对象,如下例所示。
New-NetTransportFilter -SettingName Custom -LocalPortStart 80 -LocalPortEnd 80 -RemotePortStart 0 -RemotePortEnd 65535
当Set-NetTCPSetting
您需要调整一个设置。这就是为什么您会收到有关未找到自定义对象的错误。创建传输过滤器后,您修改设置的原始命令应该可以正常工作。
Set-NetTCPSetting -SettingName Custom -InitialCongestionWindow 10 -CongestionProvider CTCP
答案2
嗨,我运行时遇到同样的错误:
PS C:\Windows\system32> Get-NetTransportFilter
SettingName : Automatic
Protocol : TCP
LocalPortStart : 0
LocalPortEnd : 65535
RemotePortStart : 0
RemotePortEnd : 65535
DestinationPrefix : *
SettingName : DatacenterCustom
Protocol : TCP
LocalPortStart : 80
LocalPortEnd : 80
RemotePortStart : 0
RemotePortEnd : 65535
DestinationPrefix : *
换句话说,已经有一个针对端口 80 的过滤器(数据中心定制) 和另一个用于其他端口 (自动的),并且由于某种原因,我没有编辑权限(我是域网络的一部分,并且不在主节点中)。
Set-NetTCPSetting
我所做的是在运行第二部分时更改过滤器的名称:
Set-NetTCPSetting -SettingName DatacenterCustom -InitialCongestionWindow 10 -CongestionProvider CTCP
这就是全部,现在是工作