How to know the workload of the server in percent?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
4 views
There are two (number in the future will grow) of the server on which to spin the same web project, code is the same, the axis is CentOS. Iron server differ, the first — 2-core with 4 gigs operatives, the second a 4-core with 8 gigs operatives.

At the entrance have a bunch of users each server load, and different — someone more, someone less than 10 minutes ago, so, now that; you can add a new user, which will create a very heavy load and so on. Statistics are available all this. The aim is to spread users across servers so that the workload of these servers was more or less the same. As the user loads the server, to reallocate the users for the necessary servers every 10-20 minutes.

To distribute the data necessary for the utilization of servers. To them it is necessary means php or the operating system in the form of percentages, they say the average workload of server 1 for the last 15 minutes = 85%. With php you can obtain using the function sys_getloadavg, however, the resulting value is "the number of processes in the system run queue", and, as I understand it, it has a maximum value, i.e. the percentage utilization of to Express does not, which is impossible to determine the conventional "capacity" of each server — the maximum number of users which can be sent to a particular server. There is an option to write to a log or Menkes data from the top, but it will have to do very often (every second?) in order to obtain the most reliable data, load it jumps. In General, hepatovirus, Your suggestions =)
by | 4 views

7 Answers

0 like 0 dislike
LA is a very good metric for evaluating system usage
it is better to use instead of any percent
but if you really want some interest to translate empirically
\r
\rx = 100 - 100 / (LA + 1)
\r
for example, something like that )
by
0 like 0 dislike
And how you want to calculate the load of the server itself? It's not only the processor but the disk subsystem, network, every virtual memory and not very... Unless some kind of composite "percentage" count, indicating the weights of each system.
But why, when there is a load average (LA)? Just look at his numbers and the bigger they are, the more worry.
by
0 like 0 dislike
May be 5 load parameters on the server: CPU, memory, disk io and free space on the disks and the network.
\r
With it, while downloading at least one of them to high values, the values of the remaining fly in the tar-Tarara. The tar-Tarara these are called battlegame or bottlenecks.
\r
So consider. The percent — top, df, io — iostat, network — nload. Loading operatives to determine is not as easy as with the others. Need to watch free,buffers,cached, and total. And brains. Signs of low memory first is increasing the load on the screw, as flies the cache. And then the growth of the swap.
\r
LA though, and gives an indication of load, but only relatively. Each character has its own permissible load strap LA. I have it varies from 1 to 50 depending on the server. Moreover, the number of virtual processors too.
\r
In General, it is necessary to take all this into account and apply specifically to your situation. There is no universal formula.
by
0 like 0 dislike
By the way, there is another bottleneck — context switches in vmstat. He manifests himself very rarely, when the number of processes from 2k. Like the main 5 have stock, and the server on the handbrake becomes.
by
0 like 0 dislike
Start loading and when the server fails to serve satisfactorily, record load average is 100%.
Other ways of course, but why?
by
0 like 0 dislike
If you are only interested in booting the cpu, then you want the data from /proc/stat.
Or, for example, you can run the dstat command now and pick the csv-formatted data once a second.
by
0 like 0 dislike
the top command in ssh console if that =)
by

Related questions

0 like 0 dislike
4 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
asked Jun 2, 2019 by OliverV
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
28,000 users