大网数据广告活动
服务器运维问答

Server 2012 R2 ephemeral ports all slowly being bound

· 52CE 我爱测

One of our remote desktop session host servers has started to refuse connection every few days, and upon investigation, it seems it is exhausting available ephemeral ports. This was identified by event ID 4231, which has error te…

问题原文

原帖链接 · James Edmonds · CC BY-SA 3.0

One of our remote desktop session host servers has started to refuse connection every few days, and upon investigation, it seems it is exhausting available ephemeral ports.

This was identified by event ID 4231, which has error text of:

A request to allocate an ephemeral port number from the global TCP port space has failed due to all such ports being in use

When running netstat -anob, I don't see anything unusual. I then tried running "Log-EphemeralPortsStats.ps1" that I cam across on both a user blog post and I think a MS blog post.

After letting this run for some time, the number of ephemeral ports in use is, on average, around 10.

When I run netstat -aq, I see a list of all ephemeral ports in the range of 49186 - 55645 showing as state - BOUND. If I wait a little while and run it again, then then end port has increased by a few ports.

I don't know if this indicates a kernel-mode port leak, but I suspect this end port number will eventually increase all the way to 65535 and that is the point at which networking will fail.

How can I determine what has these ports bound, as they show:

TCP    0.0.0.0:55643    FLX-RDSH-V001:0    BOUND

Netstat doesn't seem to help me identify the culprit in this case.

已采纳解答

原帖链接 · James Edmonds · CC BY-SA 3.0

TCPView is a very useful tool. After downloading and running, I could see a process using a high ephemeral port number. After a few seconds, the line for that process turned red, then green (I am guessing this indicates the opening of a new port), and then the port number had increased slightly.

Ending this process, unbound all of the ports it had in use, and stopped the exhaustion from happening.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-10-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。