Bug 2196 - Strange load calculation numbers.
Summary: Strange load calculation numbers.
Status: CLOSED WONTFIX
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Server (show other bugs)
Version: trunk
Hardware: PC Linux
: P2 Normal
Target Milestone: 4.10.0
Assignee: Pierre Ossman
URL:
Keywords: interesting_210
Depends on:
Blocks:
 
Reported: 2006-10-06 13:07 CEST by Erik Forsberg
Modified: 2019-02-26 12:51 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Erik Forsberg cendio 2006-10-06 13:07:02 CEST
I got suspicios about the load calculation when I saw Eksjö's figures. Something
like this:

Server: tlaedu2.eksjo.se	
Bogomips: 27210.09	
Load: 2.375	
Total memory: 3990.87	
Free memory: 2365.39	
Swap total: 2000.24	
Swap free: 1955.93	
Number of users: 29	
Penalty points: 0	
Rating: -474.67

QUE? MINUS FOURHUNDREDSEVENTYFOURPOINTSIXTYSEVEN? And this figure is supposed to
   tell how many users could be added to the server? 

Turns out that the rate_termserver function has some code that calculates the
number of users that can be added based on the current load. It looks like this:

    # Number of more users this server can support wrt load
    free_bogomips = loadinfo.bogomips * (1 - loadinfo.loadavg)
    bogomips_per_user = hive.get_integer("/vsmserver/bogomips_per_user", 80)
    num_users_load = free_bogomips / bogomips_per_user

I think it would be better if the (1 - loadinfo.loadavg) was replaced by
(loadinfo.num_cpus - loadinfo.loadavg)... Especially on HT-processors - Eksjö's
machines report four processors. 

If I remember correctly, Les has been asking about the loadbalance and why his
machine with 6GiB of memory didn't get more sessions than his 4GiB machines.
This might be the answer.
Comment 1 Erik Forsberg cendio 2006-10-06 13:13:58 CEST
Gah! I'm wrong. The number of CPUs is taken into the calculation, since the load
is divided by the number of CPUs before being reported to VSM Server. 

Hmm.. minus 400 still seems like a large number. 
Comment 2 Erik Forsberg cendio 2006-10-06 15:43:31 CEST
See komintern text 27116 with thread for a discussion on this. 

We might want to take swap usage into account in the calculation - if there's
litte swap left, another machine with more free memory but perhaps higher load
should probably be selected for the next session. 
Comment 3 Erik Forsberg cendio 2008-04-16 10:52:59 CEST
Mats Bosson called today with some feedback on the load balancing.

His impression is that the load balancing takes the memory figure to seriously. He has some servers that has 8GB of memory instead of 4GB, and they get lot's of users which leads to sluggish response as the CPU power per user becomes limited. 

His servers are HP DL380 G3 (tle-thn01-09), G4 with 8GB memory (tle-thn10-13), G4 with 4GB of memory (tle-thn14), G5 with 4GB (tle-thn15). 

He also had the impression that his G5, which is the fastest machine, got very few sessions/a low bogomips. 
Comment 4 Pierre Ossman cendio 2008-04-24 13:19:25 CEST
Work will be done as part of bug 1174.
Comment 5 Pierre Ossman cendio 2019-02-26 12:50:48 CET
This bug is a bit all over the place, so closing it in favour of other bugs on the topic.

Note You need to log in before you can comment on or make changes to this bug.