[Thinlinc-technical] tl-best-winserver on client side?!?

Jens Langner j.langner at hzdr.de
Wed Jul 17 13:10:22 CEST 2013


Hi Peter,

thanks for this very useful information. By using it I was now able to create ourself a bash script which tries to mimic the behavior of the original tl-best-winserver command provided with ThinLinc. To give the ThinLinc community the opportunity to use it please find the shell script attached to this mail.

best regards,
jens

Am 12.07.2013 um 13:44 schrieb Peter Astrand <astrand at cendio.se>:

> I haven't forgotten about you, I'm enjoying the Swedish summer...
> 
> The rating is done using this algorithm:
> 
> RAM_PER_USER = 50 * 1024
> EST_BOGOMIPS = 4000
> BOGOMIPS_PER_USER = 80
> EXISTING_USERS_WEIGHT = 4
> 
>    num_users_mem = (loadinfo.mem_free - loadinfo.swap_used/2) / RAM_PER_USER
>    free_bogomips = EST_BOGOMIPS * (1 - loadinfo.loadavg)
>    num_users_load = free_bogomips / BOGOMIPS_PER_USER
>    num_free_users = min(num_users_mem, num_users_load)
>    rating = num_free_users - (loadinfo.num_users / EXISTING_USERS_WEIGHT)
> 
> Rgds,
> Peter
> 
> 
>> Hi,
>> 
>> coming back to my own posting, I wonder if you Peter can please provide the necessary information on how you actually calculate the "Rating" numbers in ThinLinc which your tl-best-winserver command uses to define which server to prefer in a group.
> 
>> 
>> best regards,
>> jens
>> 
>> Am 10.07.2013 um 22:29 schrieb Jens Langner <J.Langner at hzdr.de>:
>> 
>>> Hi Peter,
>>> thanks for this information. I was indeed able to understand how this all works now. In fact, and as you know, all I need to do is to use the check_nrpe command of the nrpe nagios plugin package and execute a command like
>>> check_nrpe -n -H <HOSTNAME> -p 5667 -c tl_load
>>> to get the load information of a server where the tl-wts-tools are installed. In addition, the "tl_usercheck" command returns if a certain user is currently logged in that server or not. So thank you again for pointing me at the right direction. This will definitely help us improving our ThinClient environment.
>>> One last question remains, however. While the tl_load command above returns all server information like number of users logged in I still don't understand how you calculate the final "Rating" number that is also shown on the thinlinc web administration user interface and which also the tl-best-winserver returns and which is probably used to decide which server is least loaded. So would you please share this information with me so that I can mimic this behavior here as well.
>>> best regards,
>>> jens
>>> Am 10.07.2013 um 13:20 schrieb Peter Åstrand <astrand at cendio.se>:
>>>> Hi again. tl-loadagent is based on the NRPE_NT project, which is a Windows implementation of the "Nagios Remote Plugin Executor". It executes a plugin called "wts_load.exe". All of this is open source; you will find all code here:
>>>> http://sourceforge.net/projects/nrpent/
>>>> Make sure to look at the latest Svn version rather than the download/release. You can also try to execute wts_load.exe by hand, and take a look at the output.
>>>> Hope this helps,
>>>> Peter
>>>> On Wed, 10 Jul 2013, Jens Langner wrote:
>>>>> Hello Peter,
>>>>> first of all, thanks for your reply and kind explanations. And I fully understand your arguments and reasons behind them. Nevertheless, in our current ThinClient environment we don't want to route each and every user through our ThinLinc server (even that we have sufficient licenses purchased for them) because our ThinClients are already quite powerful (intel NUC) and for us it makes more sense and is IMHO more logical to directly call rdesktop/xfreerdp on our thin clients if the user decided to connect to a windows server right from the beginning.
>>>>> I also fully understand that it would be hard to directly use tl-best-winserver on the client for several reasons. Therefore, it would be great if you could share some more detailed technical information with me instead on how exactly the tcp/ip protocol that tl-loadagent provides on port 5667 is designed. If you could provide this information it would greatly help us improving our environment so that we can query the load information via our own tools (our graphical connection client software is written in Qt anyway) and then connect to the least loaded server like ThinLinc is doing it as well.
>>>>> best regards,
>>>>> jens
>>>>> Am 10.07.2013 um 10:32 schrieb Peter Astrand <astrand at cendio.se>:
>>>>>> Hi. The tl-wts-tools package includes a tl-loadagent service, running on port 5667. When RDP connections are initiated (through tl-run-rdesktop or similar commands), the load of the servers in the selected Application Server Group are fetched, and a suitable server is selected. In modern versions of ThinLinc, tl-run-rdesktop et al can fetch this via an internal Python API. tl-best-winserver has remained as a debugging tool.
>>>>>> There are a few problems with using tl-best-winserver directly on a client:
>>>>>> It's difficult to move this tool out of the ThinLinc server software. It depends on Python modules from /opt/thinlinc/modules/. Thus, you would need to install chunks from the TL server software on every client. Strictly speaking, this is not allowed by the license agreement. This will also not work on clients which does not fulfill all of the server requirements. For example, few thin terminals have a Python installation. And it would not work at all from Windows clients.
>>>>>> ThinLinc is from the start designed to handle multiple session types, including RDP, and there are many advantages with this. For example, you only need one client software, open up one network port etc to handle all session / profile types. Our profile selector can be customized so that users either can select the type themselves, or it can be configured so that some users/groups automatically get a certain profile. Another advantage is that all network traffic is encrypted through SSH, which is typically considered more safe than RDP.
>>>>>> "Pass-through sessions", ie ThinLinc sessions which connects to other terminals, consumes fairly little resources on the ThinLinc servers.
>>>>>> Thus, our recommendation is that you always login through ThinLinc.
>>>>>> Best regards,
>>>>>> Peter Astrand
>>>>>>> Coming back to my own thread. Is there nobody who can provide more technical information on how the tl-best-winserver command actually works and how one can query this information via own socket calls to the tl-load-agent installed on a windows server? We really need that functionality to improve our clustered windows server environment.
>>>>>>> best regards,
>>>>>>> jens
>>>>>>> Am 08.07.2013 um 15:21 schrieb Jens Langner <J.Langner at hzdr.de>:
>>>>>>>> Hello,
>>>>>>>> as already stated in here a while ago, we have a NUC-driven ThinClient/ThinLinc environment where we not only connect to our ThinLinc server for UNIX-kinda connections. When our NUCs are started we present the users a GUI to choose the server and if the server is a windows server it directly connects to this windows server via rdesktop rather than routing the user through ThinLinc. The reason for this is that we don't want to load the ThinLinc servers with users that only connect to windows servers.
>>>>>>>> Now that ThinLinc itself provides functionality between windows servers via the tl-wts-tools.exe and its corresponding tl-best-winserver command we are wondering if there is a possibility that we can have a similar command on the client side where we also start tlclient so that we can query which windows server in a group we should connect to.
>>>>>>>> So is there a client side command which prints out equal information like tl-best-winserver does on the server side? And if not, is there a possibility to easily create such a command or query the information that the service (tl-wts-tools.exe) provides via network? In the end we would need a short documentation on how we can query the rating of each windows server over network.
>>>>>>>> Any help would be appreciated.
>>>>>>>> best regards,
>>>>>>>> jens



-- 
Dr. Jens Langner
Helmholtz-Zentrum Dresden-Rossendorf
Institute of Radiopharmaceutical Cancer Research
Department of Positron Emission Tomography
POB 51 01 19, 01314 Dresden, Germany
http://www.hzdr.de/ | +49 351 260 2757

Vorstand: Prof. Dr. Dr. h. c. Roland Sauerbrey
Prof. Dr. Dr. h. c. Peter Joehnk
VR 1693 beim Amtsgericht Dresden

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tl-best-winserver
Type: application/octet-stream
Size: 5455 bytes
Desc: not available
URL: <http://lists.cendio.se/pipermail/thinlinc-technical/attachments/20130717/c52c1860/attachment-0007.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2345 bytes
Desc: not available
URL: <http://lists.cendio.se/pipermail/thinlinc-technical/attachments/20130717/c52c1860/attachment-0005.p7s>


More information about the Thinlinc-technical mailing list