SUMMARY: Accounting of CPU time

From: <monica_at_alpha.qui.uam.es>
Date: Fri, 21 Feb 1997 19:18:17 +0100

Dear managers,

Sorry for the late summary, but I still have some unsolved questions.

Many thanks to all who have answered:

Dan Peters <petersd_at_novachem.com>
Nick Hill - RAL CISD Systems Group <NMH1_at_axprl1.rl.ac.uk>
rioux_at_ip6480nl.ce.utexas.edu (Tom Rioux)

As I had posted four different questions I will write the anwsers
(in summary first) just after the questions of my original posting.
I will include at the end the messages sent to me.

Thanks for your help
Monica

Original question:
>
>Dear managers,
>
>We have an AlphaServer 8400 running DU4.0A. We are planing a resource policy
>in which each user gets a limited amount of CPU time allocated. We also have a
>job-scheduler installed and want our users to avoid running jobs interactively
>and use our different batch queues. With all this in mind I have these
>questions:
>
> 1) There is a way to limit the CPU time used per command (using
> shell built-in commands), but to avoid users running jobs
> interactively, is there any command that limits the maximum CPU
> time used per login session?

In short: NO. DU does not implement job resource quotas only process quotas.
But one can try to encourage people to use the queueing system limiting the
command-cpu time, and using renice-all
(ftp://ftp.ce.utexas.edu/ftp/unix/reince/reince_all). I will have a look at
it and implement it.

>
> 2) We have activated process accounting on the system, and have
> uncommented the following lines in adm's crontab:
>
> 0 2 * * 0-6 /usr/sbin/acct/runacct > /usr/adm/acct/nite/fd2log &
> 5 * * * * /usr/sbin/acct/ckpacct &
> 0 4 1 * * /usr/sbin/acct/monacct &
>
> Now it seems that ckpacct is running (from time to time a new
> pacctN is created), but runacct has not changed none of the
> /usr/adm/acct/nite/* files. Any idea why this command does not
> work?

I had a permision problem with some of the files runacct has to change.
It seems that the cron jobs are running fine now (except for monacct which is only run
once a month). But, does anyone know if it is right that all the pacctn
created during the day disappear after running runacct??

>
> 3) Is there any accounting command that allowes us to learn about
> the total CPU time used by any user?
>

I have had no answers about this. So I am still at the search and I would
be very glad to hear of such command or script or freeware program!


> 4) The process accounting gives only information about the CPU
> time used, is there a way to stop a user from accesing the system,
> running jobs, etc... once his allocated CPU time is all used?

It doesn't seem to exist, but Nick Hill has a good idea:
He shuts people out by changing their login shell in /etc/passwd to be a small
executable which prints out a message saying their cpu time is exhausted. I
will implement this.

>
>Any help about any of this points is welcomed!
>Thank you in advance
>Monica

*********************************************************************

From: Nick Hill - RAL CISD Systems Group <NMH1_at_axprl1.rl.ac.uk>:
>
> I also have an Alphaserver 8400 and we try to do resource policing and try to
> avoid users running large or long jobs interactively by using batch queues!
>
> >
> > 1) There is a way to limit the CPU time used per command (using
> > shell built-in commands), but to avoid users running jobs
> > interactively, is there any command that limits the maximum CPU
> > time used per login session?
> >
> No. DU does not implement job resource quotas only process quotas. We set
> process limits for cpu time and memory usage in the system wide shell login
> files for interactive sessions to limit use. We set these so that
> compilations and testing can be done interactively but production runs which
> can take anythiong up to 48 hours CPU time will only work in batch jobs. I
> also run a modified version of the public domain Autonice daemon to renice
> interactive jobs as they clock up CPU time.
>
>
> > 2) We have activated process accounting on the system, and have
> > uncommented the following lines in adm's crontab:
> >
> > 0 2 * * 0-6 /usr/sbin/acct/runacct > /usr/adm/acct/nite/fd2log &
> > 5 * * * * /usr/sbin/acct/ckpacct &
> > 0 4 1 * * /usr/sbin/acct/monacct &
> >
> > Now it seems that ckpacct is running (from time to time a new
> > pacctN is created), but runacct has not changed none of the
> > /usr/adm/acct/nite/* files. Any idea why this command does not
> > work?
> >
> I do not know. Somebody else processes all the accounting files.
>
> > 3) Is there any accounting command that allowes us to learn about
> > the total CPU time used by any user?
> >
> I do not think so. Again somebody else handles all this and we load the
> accounting data from DIGITAL UNIX on a daily basis into a central database
> which then holds all the info to do with users and allocations on all our
> machines and allows us to query such things as total cpu used on different
> machines and grant allocations.
>
> > 4) The process accounting gives only information about the CPU
> > time used, is there a way to stop a user from accesing the system,
> > running jobs, etc... once his allocated CPU time is all used?
> >
> We shut people out by changing their login shell in /etc/passwd to be a small
> executable which prints out a message saying their cpu time is exhausted,
> waits 10 seconds and then exits. It is easy to let them back in if required
> by setting this back to a proper shell at a later date. If you run under the
> C2 security then there may be other more fancy things you can do.
>

*********************************************************************
From: rioux_at_ip6480nl.ce.utexas.edu (Tom Rioux):
>
> Look at ftp.ce.utexas.edu/unix/reince/reince_all or
> ftp://ftp.ce.utexas.edu/ftp/unix/reince/reince_all
>
> renice_all never bothers root processes.
>
> You will have to modify this script to put in your usernames to exclude;
> look for the line containing "root" and "rioux".
>
> You will have to modify this script to put in your hostnames and what
> actions to take for the hostname (stop_all, stop_batch, and stop_none
> control pausing/resuming of processes).
>
> Some hostnames have all other processes paused when someone logges onto the
> console (XDM or CDE) and resumed when no one is logged onto the console
> (else branch after "alpha1", "global", and "local").
>
> Some hostnames have all batch processes paused when someone logges
> onto the console (XDM or CDE) and resumed when no one is logged onto the
> console ("alpha1", "global", and "local").
>
> Some hostnames have no processes paused ("alpha61" and "alpha62").
>
> The reince value calculation is based upon whether the process is "batch"
> (renice values start at 10) or "interactive" (renice values start at 0)
> and how much CPU time is used. After 1 hour of CPU time, there is no
> difference made between "batch" and "interactive".
>
> I use the following root crontab for renice_all:
> 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /etc/renice_all >/usr/tmp/renice_all.log 2>&1
>
> renice_all write messages to /var/adm/syslog.dated/<date>/renice_all.log
>
Received on Fri Feb 21 1997 - 19:48:30 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:47 NZDT