I got suspicios about the load calculation when I saw Eksjö's figures. Something
Total memory: 3990.87
Free memory: 2365.39
Swap total: 2000.24
Swap free: 1955.93
Number of users: 29
Penalty points: 0
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.
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.
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.
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.
Work will be done as part of bug 1174.
This bug is a bit all over the place, so closing it in favour of other bugs on the topic.