Toad (toad at amphibian.dyndns.org) wrote:

> What conclusions can be drawn? Mainly, that system load and both local mean
> traffic and the load percentage have absolutely nothing to do with each 
> other.

I've been saying that for a while now. ;-)

> One thing I have suggested in the past has been to measure
> the actual CPU usage, or the system load, on an architecture specific
> basis (on linux, parse /proc/stat, on other unix, parse the output of
> vmstat, on Windoze, use JNI, etc). I would like to point out here that
> transparent portability to arbitrary future or obscure platforms IS NOT
> AND NEVER HAS BEEN A CORE PROJECT GOAL. I have functional java code to 
> parse /proc/stat and determine CPU every few seconds (on linux). I
> believe fish has JNI code to find the CPU usage from the JVM on 
> Windoze. Since load balancing is fairly critical to a functioning
> Freenet, I would like to add this code to Fred at least as an option.
> Does anyone agree with me?

I think it's a good idea, and deserves to be tried, at least in the
unstable branch.  I currently have shell access to 3 different kinds
of Unix: Linux (several different versions), HP-UX 10.20, and OpenBSD
3.2.  Here are the vmstat outputs from these systems, to help write
the parsing code.

Linux (Debian unstable x86):

griffon:~$ vmstat 10
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 1  0  46932   4424  16900 343268    0    0    13    12    2    12 99  0  0  0
 4  0  46932   4416  16900 343268    0    0     0     0  636  1222 98  2  0  0
 2  0  46932   4420  16900 343012    0    0     0     0  174   629 100  0  0  0
 4  0  46932   4380  16900 343016    0    0     0     7  161   603 100  0  0  0
 5  1  46932   4672  16900 342636    0    0     0     0  290  1047 99  1  0  0
 3  0  46932   4400  16900 342892    0    0     0     0  202   781 100  0  0  0
 2  0  46932   4396  16900 342892    0    0     0     4  177   627 100  0  0  0
 4  0  46932   4384  16900 342892    0    0     0     0  178   642 100  0  0  0
 3  0  46932   4388  16900 342892    0    0     0     0  180   612 100  0  0  0
 4  0  46932   4388  16900 342892    0    0     0     0  171   609 100  0  0  0
 3  0  46932   4380  16900 342892    0    0     0     4  191   660 100  0  0  0
 4  0  46932   4412  16900 342892    0    0     0     0  205   745 100  0  0  0
 4  0  46932   4420  16900 342892    0    0     0     0  174   620 100  0  0  0
 3  0  46932   4420  16900 342892    0    0     0     4  199   719 100  0  0  0
 2  0  46932   4424  16900 342892    0    0     0     0  172   621 100  0  0  0
 4  0  46932   4424  16900 342896    0    0     0     0  187   629 100  0  0  0
 4  0  46932   4420  16900 342896    0    0     0     0  198   715 100  0  0  0
 4  0  46932   4432  16900 342896    0    0     0     9  179   637 100  0  0  0
 3  0  46932   4432  16900 342896    0    0     0     0  195   702 100  0  0  0
 4  0  46932   4432  16900 342896    0    0     0     0  180   607 100  0  0  0
 2  0  46932   4432  16900 342896    0    0     0    12  171   602 100  0  0  0
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 8  0  46932   4428  16900 342896    0    0     0     0  170   595 100  0  0  0
 2  0  46932   4444  16900 342896    0    0     0     0  201   718 100  0  0  0
 4  0  46932   4444  16900 342896    0    0     0     0  216   752 99  1  0  0
 4  0  46932   4444  16900 342896    0    0     0     4  193   698 100  0  0  0
 4  0  46932   4424  16900 342916    0    0     0     0  185   694 100  0  0  0
 3  0  46932   4464  16900 342876    0    0     0     0  185   654 100  0  0  0


HP-UX 10.20:

imadev:~$ vmstat 10
         procs           memory                   page                          
    faults       cpu
    r     b     w      avm    free   re   at    pi   po    fr   de    sr     in 
    sy    cs  us sy id
    2     1     0     7061    9827    1    0     0    0     0    0     0    153 
    10   461   3  0 97
    1     0     0     7027    9797    0    0     3    0     0    0     0    147 
   323   124   0  0 100
    1     0     0     7571    9797    0    0     0    0     0    0     0    121 
   263   116   0  0 100
    1     0     0     7418    9797    0    0     0    0     0    0     0    118 
   291   122   0  0 100
    1     0     0     6680    9813    0    0     1    0     0    0     0    130 
   402   127   0  0 100
    1     0     0     7178    9781    0    0     0    0     0    0     0    116 
   304   121   0  0 100
    1     0     0     6973    9781    0    0     0    0     0    0     0    119 
   266   116   0  0 100
    1     0     0     7191    9765    0    0     0    0     0    0     0    142 
   255   119   0  0 100
    1     0     0     7107    9781    0    0     0    0     0    0     0    121 
   267   116   0  0 100
    1     0     0     6271    9781    0    0     0    0     0    0     0    113 
   279   120   0  0 100
    1     0     0     6480    9781    0    0     0    0     0    0     0    116 
   291   114   0  0 100
    1     0     0     7341    9797    0    0     0    0     0    0     0    113 
   266   121   0  0 100
    1     0     0     6809    9797    0    0     0    0     0    0     0    118 
   256   116   0  0 100
    1     0     0     6342    9797    0    0     0    0     0    0     0    142 
   268   119   0  0 100
    1     0     0     6665    9797    0    0     0    0     0    0     0    119 
   282   116   0  0 100
    1     0     0     6889    9797    0    0     0    0     0    0     0    113 
   295   120   0  0 100
    1     0     0     7629    9797    0    0     0    0     0    0     0    124 
   430   123   0  0 100
    1     0     0     7453    9781    0    0     0    0     0    0     0    113 
   276   121   0  0 100
    1     0     0     6797    9781    0    0     0    0     0    0     0    119 
   269   116   0  0 100
    1     0     0     6749    9781    0    0     0    0     0    0     0    143 
   287   120   0  0 100


OpenBSD 3.2 x86:

$ vmstat 10
 procs   memory        page                    disks     faults     cpu
 r b w    avm    fre   flt  re  pi  po  fr  sr wd0 cd0   in    sy   cs us sy id
 2 3 0 263480 176908    88   0   0   0   0   0  14   0   36 4294966839  211 85 
15  0
 2 3 0 263480 177008   204   0   0   0   0   0   8   0 1742 195954  636 67 33  0
 2 3 0 263484 177004     7   0   0   0   0   0   8   0 1246 303843  253 59 41  0
 2 3 0 263484 177004     7   0   0   0   0   0   4   0 1212 322105  206 62 38  0
 1 3 0 263488 176996     9   0   0   0   0   0   6   0 1216 236838  220 68 32  0
 4 3 0 263488 177080   257   0   0   0   0   0  16   0 1284 263460  268 61 39  0
 1 3 0 263488 177080   193   0   0   0   0   0   5   0 1233 284126  217 61 39  0
 2 3 0 263488 177080   206   0   0   0   0   0   6   0 1231 278494  216 60 40  0
 1 3 0 263492 177076     8   0   0   0   0   0   4   0 1243 220574  260 66 34  0
 1 3 0 263492 177076     9   0   0   0   0   0   4   0 1240 121437  263 80 20  0
 1 3 0 263492 177076    10   0   0   0   0   0   6   0 1248 106448  317 85 15  0
 1 3 0 264988 175584   172   0   0   0   0   0  25   0 1245 149976  278 74 26  0
 1 3 0 265024 175548   196   0   0   0   0   0   6   0 1221 169134  235 75 25  0
 2 3 0 265056 175516   209   0   0   0   0   0   6   0 1236 147846  251 79 21  0
 1 3 0 265056 175516    10   0   0   0   0   0   6   0 1216 76274  226 88 12  0
 1 3 0 265068 175504     9   0   0   0   0   0   3   0 1208 192535  205 76 24  0
 1 3 0 265072 175500    11   0   0   0   0   0   6   0 1219 91122  216 85 15  0
 2 3 0 265072 175500    10   0   0   0   0   0   5   0 1233 134029  240 82 18  0
 3 3 0 265100 175456   246   0   0   0   0   0   4   0 1219 316822  201 61 39  0
 2 3 0 265244 175284   218   0   0   0   0   0   8   0 1211 156184  191 75 25  0
 2 3 0 265100 175372    47   0   0   0   0   0   9   0 1215 183871  175 69 31  0
 2 3 0 265100 175372     3   0   0   0   0   0   4   0 1219 128646  201 83 17  0
 procs   memory        page                    disks     faults     cpu
 r b w    avm    fre   flt  re  pi  po  fr  sr wd0 cd0   in    sy   cs us sy id
 2 3 0 265100 175372     4   0   0   0   0   0   3   0 1216 285359  187 70 30  0
 1 3 0 265104 175368     6   0   0   0   0   0   5   0 1238 136674  228 82 18  0
 2 3 0 265108 175364   195   0   0   0   0   0   4   0 1240 224078  289 77 23  0
 1 3 0 265116 175356   260   0   0   0   0   0   7   0 1232 234673  240 73 27  0
 1 3 0 265116 175356    10   0   0   0   0   0   6   0 1194 110720  178 86 14  0


Basic observations:

 * Headers may be one or two lines, and may or may not be repeated
   intermittently during the normal running.

 * The first line of numbers is a summary-since-reboot and should be
   ignored.

 * The fields do not begin in predetermined columns; instead they are
   whitespace separated.  HOWEVER, sometimes fields may run together
   which makes parsing difficult.  (Suggestion: if the line being parsed
   doesn't have the correct number of fields, discard it.)

-- 
Greg Wooledge                  |   "Truth belongs to everybody."
greg at wooledge.org              |    - The Red Hot Chili Peppers
http://wooledge.org/~greg/     |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20030517/38959da3/attachment.pgp>

Reply via email to