-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exhaustion of ephemeral ports when running as a remote #449
Comments
Unfortunately I had to reboot before investigating further, but the error below was reported on two CDN instances suffering of a similar issue, although not exactly the same: in this case file descriptors had been exhausted. The limit had already been increased from the default 1024 to 8192 - which is already quite high and should not be reached unless we have a socket leak I believe sockets opened by Node are unlimited these days
|
@fra967 it seems like the jpegtran dependency isn't properly installed. Can you try the following in the project root?
|
ok thank you @jimlambie , jpegtran is fixed, we are still monitoring the ports usage |
it seems fixed by adding i.e. should be fixed in node-tunnel 0.0.6 (we are pulling 0.0.2) See also discussion in request/request#2440 |
the tunnel patch gave good results, but tunnel is not used any more by CDN (it was part of wget-improved) After removing tunnel, the problem persists with tunnel-agent The upgrade of jpegtran to 6.0.0 comes with tunnel-agent 0.6.0 instead of 0.4.3. Sockets leak seems to be correlated with 404s errors in the remote, but it is not strictly correlated (i.e. numbers do not match). |
thank you @jimlambie i can confirm it works very well, not a single socket leaked in 500 requests |
Closed by release https://github.com/dadi/cdn/releases/tag/v3.4.3 |
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
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
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
The text was updated successfully, but these errors were encountered: