Don't enable net.ipv4.tcp_tw_recycle

Hi all,

this is just meant as a tip in case you originally followed the ownCloud documentation <= 7.0 and upgraded and migrated to Nextcloud later.

Until then ownCloud recommended within their documentation some “performance enhancements” set via sysctl. Among them was also net.ipv4.tcp_tw_recycle=1.

TL;DR: do not enable net.ipv4.tcp_tw_recycle.

If you want to know more about and why, see here: Coping with the TCP TIME-WAIT state on busy Linux servers

man tcp(7) explains why it is a bad idea:

Enabling this option is not recommended since this causes problems when working with NAT (Network Address Translation).

As a consequence, if you have one client behind a NAT that connects to Nextcloud, no other client behind that same NAT can connect to the Nextcloud server anymore. :upside_down:

It took us some time to find the culprit. ownCloud removed the recommendation some time ago: remove linux tuning tips · owncloud-archive/documentation@5ba5a6d · GitHub but we didn’t follow this change in the documentation…

2 Likes

thanks, good to know, I had that sometimes on one instance.

1 Like