0

On Ubuntu 14.04, an app communicates with clients at intervals of about 1 per sec to 1 per min. However the service have to be restarted regularly and this causes all the connections to drop/timeout. It takes only about 10-15sec for the service to restart.

Is it possible to tune the system such that these connections do not timeout/drop when the service is restarted?

$ ulimit -n
1048576
$ cat /proc/sys/net/ipv4/tcp_fin_timeout
60
$ cat /proc/sys/net/ipv4/tcp_tw_recycle
0
$ cat /proc/sys/net/ipv4/tcp_tw_reuse
0
Nyxynyx
  • 1,459
  • 11
  • 39
  • 49

1 Answers1

1

In a word, no.

When you restart the service, you must kill the process which holds the socket file descriptors open. Assuming these are TCP sessions, that means the TCP session must finish (FIN) and a new session be established (SYN) after the service has restarted and a new process is listening on a socket again.

Why do you need to restart the service? You shouldn't. Solve that and your issue goes away.

suprjami
  • 3,536
  • 21
  • 29