[comp.unix.xenix] b queue max run limit reached

marks@mgse.UUCP (Mark Seiffert) (10/07/89)

I am batching some stuff up to be done and i keep getting the message

! b queue max run limit reached Fri Oct  6 15:11:14 CDT 1989
! rescheduling at job Fri Oct  6 15:11:14 CDT 1989

These messages keep appearing on tty01 and are annoying. Right now there
are two at jobs running and two more pending. Is there anyway to increase
the number of batched jobs? Is there any way to stop the message on the
console? I don't mind that the job is being rescheduled, it is just a little
hard to use tty01.
-- 
Mark Seiffert,  Metairie, LA.
uucp:           rex!mgse!marks
bitnet:         marks%mgse@REX.CS.TULANE.EDU
internet:       marks%mgse@rex.cs.tulane.edu

roe@sobmips.UUCP (r.peterson) (10/08/89)

From article <1006@mgse.UUCP>, by marks@mgse.UUCP (Mark Seiffert):
> 
> I am batching some stuff up to be done and i keep getting the message
> 
> ! b queue max run limit reached Fri Oct  6 15:11:14 CDT 1989
> ! rescheduling at job Fri Oct  6 15:11:14 CDT 1989
> 
>  Is there anyway to increase the number of batched jobs?

This kind of thing is controlled by /usr/lib/cron/queuedefs.  An example
(from our mips - but the same thing on our tower, and most SYSV boxes
 that I know of):

a.8j1n
b.2j2n90w

A wee bit cryptic, lad?  Yup.  There are three queues maintained (by
default) by the cron/at/batch/crontab system:

queue a - at jobs
      b - batch jobs
      c - crontab jobs

The syntax of the queuedefs file is:
queue identifier.<maxjobs>j.<nice>n.<time>w

b.2j2n90w means:  queue "b" (batch) can have 2 jobs running, will be run at
nice level 2, and (if jobs are rescheduled due to queue unavailability),
it will wait 90 seconds before trying to reschedule.

So, to increase the number of runnable batch jobs, change 2j to 8j (or
whatever).

Check "man queuedefs" (if you have it).

-- 
					Roe Peterson
					{attcan,mcgill-vision,telly}!sobeco!roe

guy@auspex.auspex.com (Guy Harris) (10/10/89)

>Check "man queuedefs" (if you have it).

And, if you don't - which might well be the case, since I think I
*wrote* the QUEUEDEFS(5) for SunOS 4.x because AT&T didn't see fit to
supply one - try the following PROTO(4) and QUEUEDEFS(4) man pages:

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  proto.4 queuedefs.4
# Wrapped by guy@bootme on Sat Feb  4 15:06:52 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'proto.4' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'proto.4'\"
else
echo shar: Extracting \"'proto.4'\" \(2033 characters\)
sed "s/^X//" >'proto.4' <<'END_OF_FILE'
X.TH PROTO 4
X.SH NAME
Xproto \- prototype job file for at
X.SH SYNOPSIS
X.LP
X.B /usr/lib/cron/.proto
X.LP
X.BI /usr/lib/cron/.proto. queue
X.SH DESCRIPTION
X.LP
XWhen a job is submitted to
X.IR at (1)
Xor
X.IR batch (1),
Xthe job is constructed as a shell script.  First, a prologue is
Xconstructed, consisting of:
X.IP \(bu 3
XA header specifying whether the job is an
X.I at
Xjob or a
X.I batch
Xjob;
X.IP \(bu
XA set of Bourne shell commands to make the environment (see
X.IR environ (4))
Xfor the
X.I at
Xjob the same as the current environment.
X.LP
X.I at
Xthen reads a \*(lqprototype file,\*(rq and constructs the rest of the
Xjob file from it.
X.LP
XText from the prototype file is copied to the job file, except for
Xspecial \*(lqvariables\*(rq that are replaced by other text:
X.RS
X.TP
X.B $d
Xis replaced by the current working directory
X.PD 0
X.TP
X.B $l
Xis replaced by the current file size limit (see
X.IR ulimit (2))
X.TP
X.B $m
Xis replaced by the current umask (see
X.IR umask (2))
X.TP
X.B $t
Xis replaced by the time at which the job should be run, expressed as seconds
Xsince January 1, 1970, 00:00 Greenwich Mean Time, preceded by a colon
X.TP
X.B $<
Xis replaced by text read by
X.I at
Xfrom the standard input (that is, the commands provided to
X.I at
Xto be run in the job)
X.PD
X.RE
X.LP
XIf the job is submitted in queue
X.IR queue ,
X.I at
Xuses the file
X.BI /usr/lib/cron/.proto. queue
Xas the prototype file if it exists, otherwise it will use the file
X.BR /usr/lib/cron/.proto .
X.SH EXAMPLES
XThe standard
X.B .proto
Xfile supplied with System V is:
X.LP
X.RS
X.nf
X.ft B
X#ident	"@(#)adm:.proto	1.2"
Xcd $d
Xulimit $l
Xumask $m
X$<
X.ft R
X.fi
X.RE
X.LP
Xwhich causes commands to change the current directory in the job to the
Xcurrent directory at the time
X.I at
Xwas run, to change the ulimit in the job to the ulimit at the time
X.I at
Xwas run, and to change the umask in the job to the umask at the time
X.I at
Xwas run, to be inserted before the commands in the job.
X.SH FILES
X.PD 0
X.TP 20
X.B /usr/lib/cron/.proto
X.LP
X.BI /usr/lib/cron/.proto. queue
X.PD 
X.SH "SEE ALSO"
X.IR at (1)
END_OF_FILE
if test 2033 -ne `wc -c <'proto.4'`; then
    echo shar: \"'proto.4'\" unpacked with wrong size!
fi
# end of 'proto.4'
fi
if test -f 'queuedefs.4' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'queuedefs.4'\"
else
echo shar: Extracting \"'queuedefs.4'\" \(2386 characters\)
sed "s/^X//" >'queuedefs.4' <<'END_OF_FILE'
X.TH QUEUEDEFS 4
X.SH NAME
Xqueuedefs \- queue description file for at, batch, and cron
X.SH SYNOPSIS
X.LP
X.B /usr/lib/cron/queuedefs
X.SH DESCRIPTION
X.LP
XThe
X.B queuedefs
Xfile describes the characteristics of the queues managed by
X.IR cron (1M).
XEach non-comment line in this file describes one queue.
XThe format of the lines are as follows:
X.RS
X.LP
X\fIq\fB.\fR[\fInjob\fBj\fR][\fInice\fBn\fR][\fInwait\fBw\fR]
X.RE
X.LP
XThe fields in this line are:
X.RS
X.TP
X.I q
XThe name of the queue.
X.B a
Xis the default queue for jobs started by
X.IR at (1);
X.B b
Xis the default queue for jobs started by
X.I batch
X(see
X.IR at (1));
X.B c
Xis the default queue for jobs run from a
X.IR crontab (4)
Xfile.
X.TP
X.I njob
XThe maximum number of jobs that can be run simultaneously in that queue; if
Xmore than
X.I njob
Xjobs are ready to run, only the first
X.I njob
Xjobs will be run, and the others will be run as jobs that are currently running
Xterminate.  The default value is 100.
X.TP
X.I nice
XThe
X.IR nice (1)
Xvalue to give to all jobs in that queue that are not run with a user
X.SM ID
Xof super-user.  The default value is 2.
X.TP
X.I nwait
XThe number of seconds to wait before rescheduling a job that was deferred
Xbecause more than
X.I njob
Xjobs were running in that job's queue, or because more than 25 jobs were
Xrunning in all the queues.  The default value is 60.
X.RE
X.LP
XLines beginning with
X.B #
Xare comments, and are ignored.
X.SH EXAMPLE
X.RS
X.nf
X.ft B
Xa.4j1n
Xb.2j2n90w
X.RE
X.fi
X.ft R
X.LP
XThis file specifies that the
X.B a
Xqueue, for
X.I at
Xjobs, can have up to 4 jobs running simultaneously; those jobs will be run with
Xa
X.B nice
Xvalue of 1.  As no
X.I nwait
Xvalue was given, if a job cannot be run because too many other jobs are running
X.I cron
Xwill wait 60 seconds before trying again to run it.
XThe
X.B b
Xqueue, for
X.I batch
Xjobs, can have up to 2 jobs running simultaneously; those jobs will be run with
Xa
X.I nice
Xvalue of 2.  If a job cannot be run because too many other jobs are running,
X.I cron
Xwill wait 90 seconds before trying again to run it.
XAll other queues can have up to 100 jobs running simultaneously; they will be
Xrun with a
X.I nice
Xvalue of 2, and if a job cannot be run because too many other jobs are running
X.I cron
Xwill wait 60 seconds before trying again to run it.
X.SH FILES
X.PD 0
X.TP 20
X.B /usr/lib/cron/queuedefs
X.PD 
X.SH "SEE ALSO"
X.IR at (1),
X.IR nice (1),
X.IR crontab (4),
X.IR cron (1M)
END_OF_FILE
if test 2386 -ne `wc -c <'queuedefs.4'`; then
    echo shar: \"'queuedefs.4'\" unpacked with wrong size!
fi
chmod +x 'queuedefs.4'
# end of 'queuedefs.4'
fi
echo shar: End of shell archive.
exit 0

allbery@NCoast.ORG (Brandon S. Allbery) (10/13/89)

As quoted from <1006@mgse.UUCP> by marks@mgse.UUCP (Mark Seiffert):
+---------------
| I am batching some stuff up to be done and i keep getting the message
| 
| ! b queue max run limit reached Fri Oct  6 15:11:14 CDT 1989
| ! rescheduling at job Fri Oct  6 15:11:14 CDT 1989
| 
| These messages keep appearing on tty01 and are annoying. Right now there
| are two at jobs running and two more pending. Is there anyway to increase
| the number of batched jobs? Is there any way to stop the message on the
| console? I don't mind that the job is being rescheduled, it is just a little
| hard to use tty01.
+---------------

It looks like cron opens /dev/console to write its messages; in other words,
you're stuck with them.  (Change /dev/console and you get an unusable system,
except that the next reboot will put it back the way it was.)  You might use a
binary patcher or Gnumacs to edit /etc/cron and change /dev/console to
something else, though.

Queue limits:  Check out /usr/lib/cron/queuedefs.  Here's ours (standard):

	a.4j1n
	b.2j2n90w

This is in the format "<queue>.<parms>", where <parms> is one or more of:

	<nn>j	number of concurrent jobs
	<nn>n	amount to "nice" jobs (see nice(C))
	<nn>w	timw to wait between jobs (? -- I think)

There may be other options, but queuedefs isn't documented and we don't have a
source license.

Anyway, just up the number before the "j" on the "b" line.

In case you're interested, there are three standard queues:

	a	standard "at" queue
	b	"batch" queue ("batch" is just "at -qb")
	c	"cron" queue -- don't touch it!!!

Other queues can be created and used; "at -qX" places an "at" job on queue X.
As far as I can tell, you can specify a time to execute unless the "w" option
is on the queue, in which case "at" sets the time itself as <nn> seconds from
submission time.  This facility makes it easy to create multiple "at-like" and
"batch-like" queues, with different priorities, etc.  Pity it's not documented.
(BTW, this seems to be the standard SVR2 cron, so anyone with SVR2 or later
can make use of this feature.)

++Brandon
-- 
Brandon S. Allbery, moderator of comp.sources.misc	     allbery@NCoast.ORG
uunet!hal.cwru.edu!ncoast!allbery		    ncoast!allbery@hal.cwru.edu
bsa@telotech.uucp, 161-7070 BALLBERY (MCI), ALLBERY (Delphi), B.ALLBERY (GEnie)
Is that enough addresses for you?   no?   then: allbery@uunet.UU.NET (c.s.misc)