[FreeNX-kNX] nxserver loadbalance.

Chris Fanning christopher.fanning at gmail.com
Sat Apr 14 20:57:09 UTC 2007


Hi Dimitar,

On 4/13/07, Dimitar Paskov <pascoff at nola7.com> wrote:
> > Dimitar Paskov wrote:
> > > If you are interested I can give you more detail of the whole setup.
> >
> > Yes please
>
> Ok, here it goes ...
>
> A little pre history. We use nx technology for half a year (or more) and we
> use it in thin client environment. For now we have about 26 thin clients = 26
> users working on 3 servers split in one server (Athlon 64 X2 Dual Core 4600+,
> 4GB) for 14 and 2 servers (Athlon 64 Processor 3000+, 2GB) for 6 users each.
> We had 6 servers (Sempron 2600+, 1,5GB) with 4/5 users per server but after
> some tests we found that the best compromise between price and performance is
> a dual core AMD processor with 4GB of memory that can hold up to 14-15 users
> but is more likely to limit it to 10-12 users. we are in process of changing
> the other servers. We are using this software in Kubuntu 6.06:
> - freenx 0.5 (modified a little bit)
> - nxagent 1.4.92+1.5.0-11ubuntu1
> - nxclient 1.5.0-141 (modified a little bit)
> - nxdesktop 1.4.92+1.5.0-11ubuntu1
> - nxproxy 1.4.92+1.5.0-4ubuntu0
>
> So the thin client boots from network and runs X with nxclient as only
> application with ion2 window manager (the only one I found that can be
> configured to display application in full screen).

ok. I'm using ltsp thinclients running nxclient as a local-app.
You have all the nxclients and nxproxies of your users running on one
box ¿right? I'll have a look at ion2. thanks. Do you think installing
an sftp client on the ion2 desktop as a way to upload and download
between nx desktop and local devices?

> We changed nxclient and
> put a little function to execute an external program/script which returns the
> hostname/ipaddress of the server to which nxclient should connect to based on
> the username passed to it.

that sounds like a good trick.

> This script connects to a mysql database which
> holds the information of nxsessions and server load balancing information. If
> the user has already running session the script returns the server on which
> it is started. If not it check the database for the least loaded server and
> returns it. We moved the information in /var/lib/nxserver/db/running/ that
> holds session info into database so it can be accessed from anywhere. This is
> done by modifying the source of nxserver to execute mysql queries instead of
> writing/reading session files.

I'll have to learn more about that.

> Load balancing is done by 2 scripts. One is running on every server through
> cron every minute and checks how many users are logged in by "watching" how
> many nxagents are running.

I've seen an auto_start option in node.conf. Could you make the
nxserver notify your monitoring server instead of running a cron?

> It calculates how many users are allowed for
> logging in this server by predefined parameters like CPU and memory
> information. For example we tested and decided to give 333MHz/340MB resource
> for a single user thus for 2GB memory we have about 6 users (memory is takes
> precedence over cpu in our case). When the script calculates its resources it
> writes in the database how many free and logged users it has.
cool.

> The other
> script is the one that nxclient executes which checks in this databases which
> server has less resources.
> Next nxclient connects to the less loaded server. Every server has nxserver,
> nxnode and nxagent installed. Nxserver writes the session information to the
> mysql database and connects to nxnode/nxagent on localhost.

you have achieved session persistence in an office (or work)
environment, is that right? The staff in our company have never had
persistent sessions. They don't even know if that sort of thing is
possible or not. So, they aren't going to miss it if we don't deploy
it.
What do you think about persistant sessions for your user profile?

> We can connect as
> many servers as we need to the cluster and they will be instantly available.
> One interesting moment is that our servers are "thin" servers (like the
> clients), they do NOT have hard drives but mount read only their root /
> (/home is rw on another nfs file server) from a master nfs server which
> serves the images of the clients and servers.
I've been doing that sort of thing too. I recently managed to boot Xen
on nfs and then the virtual machines ontop. no hard drive. So I was
thinking about running the nxserver and desktop as a virtual machine
but maybe that's not very sensible.

> This master server has its
> replicator/backup server made with heartbeat and drbd (which holds the
> images) and if a disaster happens with the master, the backap becomes master
> and takes all the resources from it. mysql and tftp (which is used for
> network booting) are running on the master as well as nfs.

How is your network? Is it divided up into subnets and that sort of thing?

> If some server
> crashes (hardware failure) some of the users will lose their sessions but the
> machine can be replaced in a couple of minutes and they can continue working.
> Not the ultimate but working high availability solution.
> So when we need a workstation or additional server power we just take a
> machine and plug it in the power and the network and it works :)
That's the beauty of thin clients and servers. ;)

> Users run regular kde environment, openoffice, firefox, etc. and a windows
> application through wine. Thin servers are just regular but more powerful
> workstations with kubuntu.
I'm running kde too. and using kiosktool. and deleting things like amor. :)

> Of course there are some problems left unresolved but as a whole it is a very
> good solution to our company. For now it works only in local area network but
> we plan to make it work over internet.
tip my hat.

>
> I hope that you understand my writings :) If any questions arise, don't
> hesitate to ask!
good writings.

Thanks.
Chris.

> ________________________________________________________________
>      Were you helped on this list with your FreeNX problem?
>     Then please write up the solution in the FreeNX Wiki/FAQ:
>   http://openfacts.berlios.de/index-en.phtml?title=FreeNX_FAQ
>          Don't forget to check the NX Knowledge Base:
>                  http://www.nomachine.com/kb/
>
> ________________________________________________________________
>        FreeNX-kNX mailing list --- FreeNX-kNX at kde.org
>       https://mail.kde.org/mailman/listinfo/freenx-knx
> ________________________________________________________________
>



More information about the FreeNX-kNX mailing list