lhotari commented on issue #14826: URL: https://github.com/apache/pulsar/issues/14826#issuecomment-1077218236
After adjusting the open files limits for the services (and making sure that the settings are effective), I'd also recommend adjusting the TCP/IP keepalive settings. By default, a TCP/IP connection might linger in half closed state for up to 2 hours. Again, modifying the Linux kernel sysctl settings depend on the OS. For Ubuntu / systemd, settings can be placed in `/etc/sysctl.d` directory. systemd has a service called systemd-sysctl which applies the settings when the service is restarted (`systemctl restart systemd-sysctl`). One example of tuning TCP/IP keepalive settings, reducing timeout from 2 hrs to 20 minutes: ``` # Tune TCP/IP keepalive settings # http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html net.ipv4.tcp_keepalive_time = 1200 net.ipv4.tcp_keepalive_intvl = 60 net.ipv4.tcp_keepalive_probes = 20 ``` Script to configure ```shell echo -e "# Tune TCP/IP keepalive settings\n# http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html\nnet.ipv4.tcp_keepalive_time = 1200\nnet.ipv4.tcp_keepalive_intvl = 60\nnet.ipv4.tcp_keepalive_probes = 20" | sudo tee /etc/sysctl.d/99-keepalive.conf sudo systemctl restart systemd-sysctl ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
