<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> 
<div>
<div>Hi!</div>

<div> </div>

<div>Finally, I found the cause ...</div>

<div>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.</div>

<div> </div>

<div>Cheers</div>

<div>Swizzly</div>

<div name="quote" style="margin: 10px 5px 5px 10px; padding: 10px 0px 10px 10px; border-left-color: rgb(195, 217, 229); border-left-width: 2px; border-left-style: solid; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin: 0px 0px 10px;"><b>Gesendet:</b> Donnerstag, 30. April 2015 um 11:00 Uhr<br/>
<b>Von:</b> "swizz ly" <swizz.ly@gmx.ch><br/>
<b>An:</b> "x2go-user@lists.x2go.org" <x2go-user@lists.x2go.org><br/>
<b>Betreff:</b> [X2Go-User] sshd CLOSE_WAIT problem</div>

<div name="quoted-content">
<div style="font-family: Verdana; font-size: 12px;">
<div>Hi!</div>

<div> </div>

<div>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:</div>

<div><span style="font-family: courier new , courier , monospace;">root     32768 25441  7 Apr28 ?        03:14:44 sshd: myuser<a href="orm@notty" target="_parent">@notty</a></span></div>

<div> </div>

<div>An strace of the process shows that the number of open files reached the predefined limit:</div>

<div><span style="font-family: courier new , courier , monospace;">...<br/>
accept(7, 0x7fff6d2bccb0, [128])        = -1 EMFILE (Too many open files)<br/>
socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = -1 EMFILE (Too many open files)<br/>
select(4096, [3 5 7 8 9], [], NULL, NULL) = 1 (in [7])<br/>
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0<br/>
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0<br/>
...</span><br/>
 </div>

<div>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).</div>

<div>Checking the files opened by the given process shows, the following</div>

<div><span style="font-family: courier new , courier , monospace;">...</span></div>

<div><span style="font-family: courier new , courier , monospace;">sshd    32768 root 8499u  IPv4 1542181459      0t0        TCP loopback:30028->loopback:51585 (CLOSE_WAIT)<br/>
...</span></div>

<div>The number of such CLOSE_WAIT entries is several thousands.</div>

<div>Netstat shows a similar view:</div>

<div><span style="font-family: courier new , courier , monospace;">...</span></div>

<div><span style="font-family: courier new , courier , monospace;">tcp        0      0 127.0.0.1:30028             127.0.0.1:38163             CLOSE_WAIT  32768/sshd</span></div>

<div><span style="font-family: courier new , courier , monospace;">...</span></div>

<div> </div>

<div>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).</div>

<div>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.</div>

<div>Has anyone experienced the same problem or has any explanation for this behaviour?</div>

<div> </div>

<div>Regards</div>

<div>Swizzly</div>

<div><br/>
 </div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>
</div>
_______________________________________________ x2go-user mailing list x2go-user@lists.x2go.org <a href="http://lists.x2go.org/listinfo/x2go-user" target="_blank">http://lists.x2go.org/listinfo/x2go-user</a></div>
</div>
</div>
</div></div></body></html>