Skip to content

Exhaustion of ephemeral ports when running as a remote #449

@fra967

Description

@fra967

We are running out of sockets on CDN 3.1.0, used as remote under a not particularly high load

CDN doesn't respond anymore and systemd[10153]: Reached target Sockets. is logged in /var/log/syslog

The current range of ephemeral ports is

# cat /proc/sys/net/ipv4/ip_local_port_range
32768   60999

And TCP connection should be reused
net.ipv4.tcp_tw_reuse = 1 set in /etc/sysctl.conf
(See https://vincent.bernat.ch/en/blog/2014-tcp-time-wait-state-linux)

Nevertheless we end up with a huge amount of sockets stuck in TIME_WAIT

# netstat -an | grep TIME_WAIT | wc -l
32773

Possibly the library used for remote connections is not dropping / reusing the TCP connections?

As a temporary patch we have increased the number of ephemeral ports

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions