Hi, i need some help with load avg, we registers the loadavg each 5 seconds, and inmediatly next the states off all processes with 'ps aux', al this it's done inside one script. In theroy the load avg of 1 minutne is L(t) = L(t-1)*(e^(-5/60) + A(1- e^(-5/60)), with L(t) is the actual load avg, L(t-1) is previous load avg, e^(-5/60) is a constant aprox 0.92004441462 ~ 0.92, so (1-e^(-5/60)) is ~ 0.08, and A is the numbers of all processes in state R or D.
Well, if we calculates the load avg based in the PS it is completly diferente of the load avg informed by top or some other command.
Here is a list with the data informed by the script.
Columns:
1) Load Avg informed by de system (1 minute):
2) Total processes in state R or D informed by de PS inmediatly next of get the load avg.
3) Processes in state D
4) Total Processes
5) Load Avg calculated based in the states informed by column 2, (The first line is filled with the load avg informed by the system at thats time, 9.08). This column should be very similar to the column 1, but is not the case. The diference is too much.
Plase can someone can explain me what happend? if i do something wrong o the formula of load avg is no thats?
This comparission was done many times in a lapse or 20 minutos each, and always show similar results, the load avg informed is very different of load avg calculated based in the processes informed by the 'ps' with state R or D.
Thanks.
Well, if we calculates the load avg based in the PS it is completly diferente of the load avg informed by top or some other command.
Here is a list with the data informed by the script.
Columns:
1) Load Avg informed by de system (1 minute):
2) Total processes in state R or D informed by de PS inmediatly next of get the load avg.
3) Processes in state D
4) Total Processes
5) Load Avg calculated based in the states informed by column 2, (The first line is filled with the load avg informed by the system at thats time, 9.08). This column should be very similar to the column 1, but is not the case. The diference is too much.
Plase can someone can explain me what happend? if i do something wrong o the formula of load avg is no thats?
This comparission was done many times in a lapse or 20 minutos each, and always show similar results, the load avg informed is very different of load avg calculated based in the processes informed by the 'ps' with state R or D.
Thanks.
1min | Procesos Activos (R, D) | Procesos D | Total Procesos | Load Avg (Recalculado) |
9,08 | 6 | 0 | 1537 | 9,08 |
8,43 | 2 | 0 | 1534 | 8,51 |
8,96 | 5 | 0 | 1537 | 8,23 |
12,49 | 1 | 0 | 1534 | 7,65 |
20,94 | 1 | 0 | 1540 | 7,12 |
27,75 | 3 | 0 | 1536 | 6,79 |
31,21 | 1 | 0 | 1536 | 6,33 |
37,2 | 2 | 0 | 1535 | 5,98 |
39,27 | 5 | 0 | 1533 | 5,90 |
43,97 | 5 | 1 | 1536 | 5,83 |
57,42 | 4 | 0 | 1536 | 5,69 |
56,27 | 4 | 0 | 1536 | 5,55 |
55,93 | 3 | 0 | 1533 | 5,35 |
57,29 | 5 | 0 | 1533 | 5,32 |
62,08 | 4 | 0 | 1533 | 5,21 |
59,03 | 2 | 0 | 1532 | 4,96 |
62,23 | 3 | 0 | 1533 | 4,80 |
59,09 | 3 | 0 | 1534 | 4,66 |
58,44 | 4 | 0 | 1534 | 4,60 |
61,45 | 3 | 0 | 1535 | 4,48 |
58,93 | 3 | 0 | 1535 | 4,36 |
55,57 | 5 | 1 | 1534 | 4,41 |
54,72 | 4 | 0 | 1536 | 4,38 |
54,43 | 3 | 0 | 1539 | 4,27 |
50,63 | 9 | 0 | 1535 | 4,64 |
47,12 | 2 | 0 | 1536 | 4,43 |
43,51 | 1 | 0 | 1536 | 4,16 |
43,55 | 4 | 0 | 1536 | 4,15 |
40,62 | 5 | 0 | 1534 | 4,21 |
37,69 | 2 | 0 | 1534 | 4,04 |
35,63 | 4 | 0 | 1533 | 4,03 |
34,62 | 4 | 0 | 1537 | 4,03 |
32,09 | 6 | 0 | 1534 | 4,19 |
30,08 | 3 | 0 | 1527 | 4,09 |
29,83 | 5 | 0 | 1526 | 4,17 |
30,81 | 6 | 0 | 1525 | 4,31 |