[comp.unix.xenix.sco] at batch problem

fff@mplex.UUCP (Fred Fierling) (09/02/90)

Our at and batch commands suddenly stopped working even though cron still
works.  The only clue is this console message:

 b queue max run limit reached Sat Sep 1 ......
 rescheduled at job Sat Sep ......

Environment:  386 Xenix 2.2.2, on an HP Vectra RS/20.

Any ideas anyone?
-- 
Fred Fierling  mplex!fff@van-bc.wimsey.bc.ca Tel: 604 875-1461 Fax: 604 875-9029
Microplex Systems Ltd   265 East 1st Avenue   Vancouver, BC   V5T 1A7,  Canada

rosso@sco.COM (Ross Oliver) (09/08/90)

In article <10@mplex.UUCP> fff@mplex.UUCP (Fred Fierling) writes:
>Our at and batch commands suddenly stopped working even though cron still
>works.  The only clue is this console message:
>
> b queue max run limit reached Sat Sep 1 ......
> rescheduled at job Sat Sep ......

Here is an item from our tech support database that
should be of some help.

Ross Oliver
Technical Support
The Santa Cruz Operation, Inc.
-------------------------------------
How can I manage the system resources using cron, at, and batch?

KEYWORDS: cron at batch schedule queue queues wait run nice future submit job xenix

RELEASE:  SCO XENIX Operating System Release 2.2 and 2.3

PROBLEM:  What are the queues for cron(c), at(c), and batch(c) and how do I 
          manage them?

SOLUTION: The cron(C), at(C) and batch(C) utilities can be used to
          schedule tasks for execution at a later time.  The command
	  cron(C) is used for tasks that are repeated at regular intervals,
          such as nightly backups, or monthly accounting functions.  The
          commands at(C) and batch(C) are both used to schedule one-time jobs
          at some time in the future.  The time may be later in the day, or 
	  many days or weeks in the future.  When using cron(C) and at(C),
          tasks may be scheduled to run automatically without intervention
          from the user.  This capability can be used to perform computing 
	  tasks at times when the system is less busy, such as late at night, 
	  or to distribute the computing load evenly across the entire day.  
	  These utilities can be used to manage other resources as well, such 
	  as printers, modems, and tape drives.

          All jobs scheduled by cron(C), at(C), and batch(C), are executed at
          the proper time by the cron daemon.  Normally, cron maintains two 
	  lists, or queues, of tasks waiting to be executed.  One queue 
	  contains all tasks run by the users' crontab entries as well as 
	  the at(C) utility.  The second queue contains all jobs submitted
          using batch(C).  Each queue has certain parameters assigned to it: 
	  the number of jobs in any one queue that may run simultaneously; 
	  the nice value of the jobs (a process's "nice value" determines 
	  its priority in relation to other running processes); and when to 
	  retry a job if there are already the maximum number of jobs running.

          However, cron is not limited to two queues.  The system 
	  administrator can define up to 26 queues to manage different 
	  types of tasks.  The -q flag to at(C) is used to select which 
	  queue a job is submitted to.  The characteristics of each queue 
	  are defined in the file /usr/lib/cron/queuedefs.

          By defining the nice value and number of concurrent jobs, the 
	  system administrator can manage how a queue of jobs affects 
	  system performance.  Large number-crunching mathematical programs, 
	  for example, could be limited to one or two at a time.  UUCP jobs 
	  could be limited to the number of available dial-out lines.

          The queuedefs file contains one line for each queue definition.
          The format of each line is:

                     x.<nn>j<nn>n<nn>w

          where "x" is the queue's letter (a through z, lower case only),
          and <nn> is an integer.  "<nn>j" specifies the maximum number of 
	  jobs in the queue that may run at the same time.  "<nn>n" specifies 
	  the nice value (see nice(C) for more information on nice values) 
	  given to jobs in the queue when they are executed.  "<nn>w" indi-
	  cates how many seconds in the future a job should be scheduled to 
	  try again if the allowed number of running jobs has been reached.
	  Any of these three fields may be omitted, and will then assume 
	  default values (100 maximum jobs, nice value of 2, and retry in 60
          seconds).  The /usr/lib/cron/queuedefs file as installed by SCO 
	  XENIX is:

                     a.4j1n
                     b.2j2n90w

          This default configuration defines two queues:  the first (a.4j1n,
	  shown above) is used for all jobs submitted to cron and by the at(C)
          command; the second queue (b.2j2n90w, shown above) is used for jobs 
	  submitted with the batch(C) command or using at(C) with the -qb 
	  option.

          The cron and at queue (defined by the first line, shown above) may 
	  have up to four processes running at once.  Each process's nice 
	  value is set to 1.  If another job attempts to run while four are 
	  already executing, it will be rescheduled for one minute later.

          The batch queue (defined by the second line, shown above) may have 
	  only two jobs running simultaneously.  Its jobs receive a nice 
	  value of 2, and will be rescheduled for 90 seconds later if the 
	  maximum number of jobs is reached.

          Other queues may be defined by the system administrator by
          adding lines to the /usr/lib/cron/queuedefs.  Before the
          new queues may be used, cron must be stopped and then 
	  restarted, either by rebooting the system, or killing and 
	  restarting the cron process itself.  Jobs may be submitted 
	  to other queues using the at(C) command with the -qx option, 
	  where "x" is the letter of the desired queue.

          Job queues can be used to manage system resources such as
          printers, modems, or archive devices.  For example, the
          following queuedefs entry might be used for communications
          programs on a system that has four modems:

          m.4j0n300w

          For this queue, there may be up to four communications tasks
          running, at normal priority (nice value of 0).  If a fifth
          job is entered in the queue, it is scheduled for 5 minutes 
	  later, when a free modem might be available.

          Cron queues can be used to manage the system load, and other
          resources, such as printers, modems, and tape drives.  By 
	  adjusting the nice value and number of concurrent jobs, the 
	  system administrator can manage how a queue of jobs affects 
	  system performance.  Large number-crunching mathematical programs, 
	  for example, could be limited to one or two at a time.  UUCP jobs 
	  could be limited to the number of available dial-out lines.

SEE ALSO:  For more information, refer to the at(C) section of the
	   SCO XENIX User's Reference manual.