On Sat, May 17, 2003 at 02:45:14PM -0400, Greg Wooledge wrote: > 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.
Hehe, I don't need to. I'd just write the linux code and leave the adaptation to other unixes to other people. After all, we will probably need special case code for each format. > > > Basic observations: > > * Headers may be one or two lines, and may or may not be repeated > intermittently during the normal running. Headers should also uniquely identify the format, right? > > * The first line of numbers is a summary-since-reboot and should be > ignored. Indeed. > > * 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: 189 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20030517/39a53db2/attachment.pgp>