gillam%aerospace@sri-unix.UUCP (03/06/84)
From: April Gillam <gillam@aerospace> We're running 4.1bsd here and I've run into some accounting problems. I run the sa command every 12 hours, at 6AM & 6 PM and move the summary usracct file to another file. I've added an option to sa to be able to read the usracct file exclusively, since we are reporting on the system usage per user. (No, we're not playing Big Brother, just trying to see how & who uses the system to enhance support thereof.) Now here's the problem. I find that the total cpu time(system + user) is often greater than 720 minutes. Shouldn't the total time be less than or equal to the time period considered? If anyone sees where the problem is please let me know. Thanks for the help. April (gillam@aerospace)
ALMQUIST@SU-SCORE.ARPA (03/08/84)
From: Philip Almquist <ALMQUIST@SU-SCORE.ARPA> I've never tried to do such analysis on a UNIX system, but such problems (user time + system time /= real time) seems to be quite common. Under Tops-20, for example, the sum of user time and system time seems to vary between about 70% and 115% of real time. The reasons seem to be both due to numerical (rounding) problems and to data collection problems (some time is counted as both kinds or not at all). Solving the latter problem is actually a rather subtle task, since you need an atomic way of switching which clock you are charging the time to and since there are a great many places where the average OS can switch between "user tasks" and "system tasks". Philip -------
matt%ucla-locus@sri-unix.UUCP (03/08/84)
From: Matthew J. Weinstein <matt@ucla-locus> As a side note, some other systems (such as Univac 1100's) let you actually count instruction cycles used by an activity, and use this as the basis for accounting... I wonder whether this would be implementable on the Vax (microcode?)
crl@pur-phy.UUCP (Charles LaBrec) (03/10/84)
I speak from experience with 2.8 BSD for PDP-11's, so I do not guarantee that my answer applies for 4.1. The accounting record for a process is written after the process terminates. Thus, if a process runs for more than 12 hrs elapsed time, it is entirely possible to get a total CPU time greater than 12 hrs. Charles LaBrec UUCP: pur-ee!Physics:crl, purdue!Physics:crl INTERNET: crl @ pur-phy.UUCP
kolstad@parsec.UUCP (03/10/84)
#R:sri-arpa:-1721900:parsec:49600001:000:420 parsec!kolstad Mar 9 22:22:00 1984 The process accounting for, say, a twelve hour period will show the time for all processes which completed in that twelve hour period. This number could be much larger than twelve hours for some of the twelve hour periods since some processes will finish just after the beginning of the period, having accrued lots of time already. On the other hand, if it happens often, I'd like to have a CPU like yours! Rk