[FreeNX-kNX] Load Balancing leaving unconnectable sessions

Mario Becroft mb at gem.win.co.nz
Tue Aug 11 16:15:01 UTC 2009


Matthew Richardson <M.Richardson at ed.ac.uk> writes:

> We're running an nx pool with around 75 computers in it, with a single
> master which all users connect to.
>
> We seem be be regularly hitting the problem that when a user disconnects
> from a session, it somehow becomes disconnected from the master, and
> when then user tries to connect again they can't reconnect to that
> session.  This is a fairly regular occurrence, with possibly around 1 in
> 20 sessions sticking this way.

When a session becomes stuck in this way, please check whether the
user's nxagent is still running. If so, then the session is still there,
just inaccessible.

Moreover, check whether there is a second nxagent process owned by the
user which was started at the time when the user last logged out. If so,
and if killing this second nxagent (but not the original nxagent)
unsticks the session, then it may be similar to a problem I
encountered. Try the following patch (which will help only with future
sessions, not ones already stuck):

--8<---------------cut here---------------start------------->8---
--- nxnode.1	2009-07-27 04:29:53.872607895 +1200
+++ nxnode	2009-07-27 04:29:56.932601326 +1200
@@ -1259,7 +1259,7 @@
 	umask 0077
 
 cat << EOF > "$USER_FAKE_HOME/.nx/C-$sess_id/options"
-nx/nx,${keyboard:+keyboard=$keyboard,}${kbtype:+kbtype=$kbtype,}${kbload:+kbload=$kbload,}${keymap:+keymap=$keymap,}${geometry:+geometry=$geometry,}${client:+client=$client,}${resize:+resize=$resize,}${CACHE}${IMAGES}${PACK}link=$link,nodelay=$nodelay,type=$realtype${clipboard:+,clipboard=$clipboard}${composite:+composite=$composite},cleanup=0,product=LFE/None/LFEN/None,shmem=1,${backingstore:+backingstore=$backingstore,}shpix=1,${ACCEPT}cookie=$proxy_cookie,id=$sess_id,samba=$samba,media=$media${sync:+,sync=$sync}${cups:+,cups=$cups}${keybd:+,keybd=$keybd}${aux:+,aux=$aux}${http:+,http=$http}${rdpcolors:+,rdpcolors=$rdpcolors}${rdpcache:+,rdpcache=$rdpcache}${fullscreen:+,fullscreen=1}${menu:+,menu=$menu}:$display
+nx/nx,${keyboard:+keyboard=$keyboard,}${kbtype:+kbtype=$kbtype,}${kbload:+kbload=$kbload,}${keymap:+keymap=$keymap,}${geometry:+geometry=$geometry,}${client:+client=$client,}${resize:+resize=$resize,}${CACHE}${IMAGES}${PACK}link=$link,nodelay=$nodelay,type=$realtype${clipboard:+,clipboard=$clipboard}${composite:+composite=$composite},cleanup=10,product=LFE/None/LFEN/None,shmem=1,${backingstore:+backingstore=$backingstore,}shpix=1,${ACCEPT}cookie=$proxy_cookie,id=$sess_id,samba=$samba,media=$media${sync:+,sync=$sync}${cups:+,cups=$cups}${keybd:+,keybd=$keybd}${aux:+,aux=$aux}${http:+,http=$http}${rdpcolors:+,rdpcolors=$rdpcolors}${rdpcache:+,rdpcache=$rdpcache}${fullscreen:+,fullscreen=1}${menu:+,menu=$menu}:$display
 EOF
 	umask $OLD_UMASK
 #samba=$samba,
--8<---------------cut here---------------end--------------->8---

All this does is change the cleanup option from 0 to 10, providing a
timeout so that if cleanup fails, the nxagent does not hang forever.

If you do not already have it, also apply the following patch which
fixes a different problem causing similar symptoms:

--8<---------------cut here---------------start------------->8---
--- nxserver.foo	2009-01-25 16:07:46.590977440 +1300
+++ nxserver	2009-01-25 21:34:29.259718601 +1300
@@ -967,8 +967,8 @@
 server_nxnode_echo()
 {
 	log 6 "server_nxnode_echo: $@"
-	[ "$SERVER_CHANNEL" = "1" ] && echo "$@"
-	[ "$SERVER_CHANNEL" = "2" ] && echo "$@" >&2
+	[ "$SERVER_CHANNEL" = "1" ] && /bin/echo "$@"
+	[ "$SERVER_CHANNEL" = "2" ] && /bin/echo "$@" >&2
 }
 
 server_nxnode_exit_func()
--8<---------------cut here---------------end--------------->8---

Needless to say, ensure you are using the latest nxagent and nx
libraries from nomachine, as many bugs have been fixed during the last
year or so, some of which could also cause similar symptoms.

Please report back after applying the above patches and testing
thoroughly. If you still have problems, there are further avenues for
analysis.

Given the moderately large number of users on your site, you may also
benefit from the nxserver_performance.patch that I posted to the list
recently (but note that it may need some tweaking to work properly
depending on your system). This patch helps make some operations like
logging in a bit faster and fixes the session shadowing login process so
that it is actually usable.

-- 
Mario Becroft <mb at gem.win.co.nz>



More information about the FreeNX-kNX mailing list