Search code examples
linuxsocketstcp

Socket max fds reached


On server side Sockets fds are reaching to max limit, is there any configuration in linux system level that can be set for TCP ipv4 where system(kernel) takes care of closing the idle/ unused socket fds, so that socket fds doesn't reach fd max.


Solution

  • There is no way for the system to know that an idle socket won't be reused or closed by the application. You need to fix whatever bug is causing your application to leak sockets.