Hi!
 
Finally, I found the cause ...
It seems, that the option "Use SSH port forwarding to tunnel sound systems connections through firewalls" under Session precerences/Media/Sound is responsible for the many sockets in CLOSE_WAIT state. I checked it several times, and if the option is not activated, then there are no sockets in CLOSE_WAIT state. I don't know why, and since I don't need this options I am not going to dig deeper.
 
Cheers
Swizzly
Gesendet: Donnerstag, 30. April 2015 um 11:00 Uhr
Von: "swizz ly" <swizz.ly@gmx.ch>
An: "x2go-user@lists.x2go.org" <x2go-user@lists.x2go.org>
Betreff: [X2Go-User] sshd CLOSE_WAIT problem
Hi!
 
It happens time to time on our x2go server, that the CPU usage goes almost 100% on a single CPU. The high usage is caused by the sshd process which runs the <username>@notty, in PS it looks like this:
root     32768 25441  7 Apr28 ?        03:14:44 sshd: myuser@notty
 
An strace of the process shows that the number of open files reached the predefined limit:
...
accept(7, 0x7fff6d2bccb0, [128])        = -1 EMFILE (Too many open files)
socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = -1 EMFILE (Too many open files)
select(4096, [3 5 7 8 9], [], NULL, NULL) = 1 (in [7])
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
...

 
Increasing the limit "nofile" solves the high CPU problem only temporarily, as the number of open files increases with the time monotonously (at a rate of ~1/20 sec).
Checking the files opened by the given process shows, the following
...
sshd    32768 root 8499u  IPv4 1542181459      0t0        TCP loopback:30028->loopback:51585 (CLOSE_WAIT)
...
The number of such CLOSE_WAIT entries is several thousands.
Netstat shows a similar view:
...
tcp        0      0 127.0.0.1:30028             127.0.0.1:38163             CLOSE_WAIT  32768/sshd
...
 
After increasing the limit of open files I logged the strace of the process during a period when the number of CLOSE_WAIT connections increases (see attached file).
The user is doing nothing, he is just logged in with x2go, but doesn't run any active processes, he doesn't even use the server.
Has anyone experienced the same problem or has any explanation for this behaviour?
 
Regards
Swizzly

 
 
 
 
 
_______________________________________________ x2go-user mailing list x2go-user@lists.x2go.org http://lists.x2go.org/listinfo/x2go-user