when we perform the following cli on our rhel machine we get more then 600 CLOSE_WAIT lines

lsof -i tcp:8088 | grep CLOSE_WAIT
java    31100 yarn  385u  IPv4 208022048      0t0  TCP master02.hgti.com:radan-http->master02.hgti.com:56504 (CLOSE_WAIT)
java    31100 yarn  407u  IPv4 208210692      0t0  TCP master02.hgti.com:radan-http->master02.hgti.com:58918 (CLOSE_WAIT)
java    31100 yarn  408u  IPv4 206182798      0t0  TCP master02.hgti.com:radan-http->master02.hgti.com:36538 (CLOSE_WAIT)
java    31100 yarn  410u  IPv4 208447279      0t0  TCP master02.hgti.com:radan-http->master02.hgti.com:60972 (CLOSE_WAIT)
java    31100 yarn  412u  IPv4 208287324      0t0  TCP master02.hgti.com:radan-http->master02.hgti.com:59820 (CLOSE_WAIT)
java    31100 yarn  413u  IPv4 206107964      0t0  TCP master02.hgti.com:radan-http->master02.hgti.com:35704 (CLOSE_WAIT)

as I know During the communication between the server and the client, the closed_wait caused by the socket failure of the server occurs

so any chance to do some settings from Linux side? in order to minimize the close wait sessions?

or its should be only solution from application side?

reference - https://www.programmersought.com/article/74221875444/


1 Answer 1


I think it might a bug in your application, maybe you can keep it under control if you restart the application before running out of the maximum number of open files / sockets, or increase any artificial limits set by ulimit.

Try looking for a bug report, for example:

Or report one yourself (if this is your application). For a discussion of this type of issue, see: https://stackoverflow.com/questions/15912370/how-do-i-remove-a-close-wait-socket-connection

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .