You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "James H. H. Lampert" <ja...@touchtonecorp.com> on 2016/03/31 02:01:19 UTC

Job priority (AS/400s)

Earlier this week, we noticed that the JVM job (QP0ZPWT) assocated with 
the CATALINA job of a Tomcat server runs at Priority 6. This priority 
level puts it ahead of everything but the operating system itself.

This morning, a response to a query on the Java forum at Midrange.com 
pointed me to this excerpt from catalina.sh:

> if $os400; then
>   # Set job priority to standard for interactive (interactive - 6) by using
>   # the interactive priority - 6, the helper threads that respond to requests
>   # will be running at the same priority as interactive jobs.
>   COMMAND='chgjob job('$JOBNAME') runpty(6)'
>   system $COMMAND
>
>   # Enable multi threading
>   export QIBM_MULTI_THREADED=Y
> fi

This seems to be based on a misconception: run priority is a value from 
0 to 99, with lower numbers denoting greater importantce. 0 is reserved 
for the operating system itself, 1-15 typically also used for the 
operating system itself, 20 used for most interactive jobs, 50 and up 
used for most batch jobs (including server jobs).

Note: interactive jobs -- people signed on to physical terminals, or to 
terminal emulators -- typically run at priority 20. NOT priority 6.

By setting Tomcat's JVM job at priority 6, we are not only putting it 
ahead of interactive jobs, but also ahead of all but the most important 
system jobs.

Is there a reason for this? Or was it a simple misunderstanding of how 
priority works on AS/400s?

--
JHHL

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Job priority (AS/400s)

Posted by "James H. H. Lampert" <ja...@touchtonecorp.com>.
On 3/31/16, 10:52 AM, Christopher Schultz wrote:
. . .
> I don't see any particular reason not to change this from priority 6
> to priority 20. If you've got a (publicly-available) reference for
> AS/400 that lists the appropriate priorities of different kinds of
> jobs, I can change the priority there and reference that page for
> interested parties.

I'll see what I can find. What I said in the original message was the 
digested result of my poring over a PDF of the Work Management book, the 
helptext for the CHGJOB command, and the "elapsed data" view in a 
WRKACTJOB on our production box.

I've got a query out to the Midrange list for something more succinct. I 
wasn't even aware of the situation myself, despite working with Tomcat 
under OS/400 (i5OS, and whatever IBM is calling it this week) on our own 
production box and several customer boxes for a few years now, until 
somebody who had some AS/400 work management experience pointed it out 
to me.

--
JHHL

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Job priority (AS/400s)

Posted by Daniel Baktiar <db...@gmail.com>.
Hi James,

Just out of curiosity, does JVM for Tomcat runs on PASE or as native in
OS/400?

Regards,
Daniel

On Fri, Apr 1, 2016 at 6:49 AM James H. H. Lampert <ja...@touchtonecorp.com>
wrote:

> On 3/31/16, 2:30 PM, Christopher Schultz wrote:
>
> > Wild Googling has produced this page:
> > http://www.texas400.com/b400tip16.html
> >
> > ...which claims that priority *30* is the same as "interactive".
> >
> > Something tells me that it's going to come down to a matter of opinion
> > what exact priority should be used. But OS processes should probably
> > get higher priority than daemons, Tomcat included.
>
> I've been dealing with IBM Midrange Systems for close to 22 years, and
> up until today, I'd never heard of "texas400.com" or David Mount.
>
> I'm still waiting for a response from the Midrange.com gurus on a
> succinct, to-the-point, straight-from-the-equine-masticatory-orifice
> document on normal job priorities, but I can tell you, we've never
> futzed with them on our production box, and here's an annotated sample
> from a WRKACTJOB screen:
> > Subsystem/Job  Type  Pool  Pty
> > QBASE          SBS     2    0  This is a subsystem.
> >   AUTHSERVER   BCH     2   50  This is part of a simple web service.
> >   CATALINA     BCH     2   50  This is the CATALINA job for Tomcat.
> >   JAMESL00     INT     3   20  This is my terminal session.
> >   POWERMON2    BCH     2   50  This job checks for power outages.
> >   QJVACMDSRV   BCI     2   50  This is the JVM for AUTHSERVER.
> >   QP0ZSPWT     BCI     2    6  This is the JVM for CATALINA (Tomcat).
> >   QSYSSCD      BCH     3   20
> >   THINSERVER   BCH     2   50  These are a couple of non-Java servers,
> >   WTCPCHILD    BCH     2   50  both of them running as batch jobs.
> > QHTTPSVR       SBS     2    0  Another subsystem.
> >   ADMIN        BCI     2   25  This is the system's admin web server.
> > QSYSWRK        SBS     2    0  Another subsystem.
> >   CRTPFRDTA    BCH     2   50  Some misc. system batch jobs.
> >   QGLDPUBA     ASJ     2   50
> >   QGLDPUBE     ASJ     2   50
> >   QHTTP        BCH     2   10
> >   QJOBLOGSVR   BCH     2   40
> >   QJVACMDSRV   BCI     2   50  More JVMs
> >   QJVAEXEC     BCI     2   50
> >   QMSF         BCH     2   35
> >   QSQSRVR      PJ      2   20  These are system jobs for SQL access.
> >   QSQSRVR      PJ      2    1  Note that the priorities vary.
> >   QSQSRVR      PJ      2   10
> >   QSQSRVR      PJ      2   10
> >   QSQSRVR      PJ      2   10
>
> The general rule-of-thumb based on what I've seen is that subsystems
> always run at 0, batch jobs tend to run at 50, interactive jobs tend to
> run at 20, and jobs that are initiated by the operating system can vary
> over a wide range.
>
> FWIW, IBM handles timesharing rather differently from the way most other
> manufacturers handle it: terminals, terminal controllers, and terminal
> emulators are expected to handle individual keystrokes without any CPU
> attention whatsoever, and jobs only get CPU timeslices when there is
> processing to be done. And so timeslices tend to be measured in full
> seconds (but end immediately as soon as it's necessary to wait for user
> interaction).
>
> --
> JHHL
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Job priority (AS/400s)

Posted by "James H. H. Lampert" <ja...@touchtonecorp.com>.
On 3/31/16, 2:30 PM, Christopher Schultz wrote:

> Wild Googling has produced this page:
> http://www.texas400.com/b400tip16.html
>
> ...which claims that priority *30* is the same as "interactive".
>
> Something tells me that it's going to come down to a matter of opinion
> what exact priority should be used. But OS processes should probably
> get higher priority than daemons, Tomcat included.

I've been dealing with IBM Midrange Systems for close to 22 years, and 
up until today, I'd never heard of "texas400.com" or David Mount.

I'm still waiting for a response from the Midrange.com gurus on a 
succinct, to-the-point, straight-from-the-equine-masticatory-orifice 
document on normal job priorities, but I can tell you, we've never 
futzed with them on our production box, and here's an annotated sample 
from a WRKACTJOB screen:
> Subsystem/Job  Type  Pool  Pty
> QBASE          SBS     2    0  This is a subsystem.
>   AUTHSERVER   BCH     2   50  This is part of a simple web service.
>   CATALINA     BCH     2   50  This is the CATALINA job for Tomcat.
>   JAMESL00     INT     3   20  This is my terminal session.
>   POWERMON2    BCH     2   50  This job checks for power outages.
>   QJVACMDSRV   BCI     2   50  This is the JVM for AUTHSERVER.
>   QP0ZSPWT     BCI     2    6  This is the JVM for CATALINA (Tomcat).
>   QSYSSCD      BCH     3   20
>   THINSERVER   BCH     2   50  These are a couple of non-Java servers,
>   WTCPCHILD    BCH     2   50  both of them running as batch jobs.
> QHTTPSVR       SBS     2    0  Another subsystem.
>   ADMIN        BCI     2   25  This is the system's admin web server.
> QSYSWRK        SBS     2    0  Another subsystem.
>   CRTPFRDTA    BCH     2   50  Some misc. system batch jobs.
>   QGLDPUBA     ASJ     2   50
>   QGLDPUBE     ASJ     2   50
>   QHTTP        BCH     2   10
>   QJOBLOGSVR   BCH     2   40
>   QJVACMDSRV   BCI     2   50  More JVMs
>   QJVAEXEC     BCI     2   50
>   QMSF         BCH     2   35
>   QSQSRVR      PJ      2   20  These are system jobs for SQL access.
>   QSQSRVR      PJ      2    1  Note that the priorities vary.
>   QSQSRVR      PJ      2   10
>   QSQSRVR      PJ      2   10
>   QSQSRVR      PJ      2   10

The general rule-of-thumb based on what I've seen is that subsystems 
always run at 0, batch jobs tend to run at 50, interactive jobs tend to 
run at 20, and jobs that are initiated by the operating system can vary 
over a wide range.

FWIW, IBM handles timesharing rather differently from the way most other 
manufacturers handle it: terminals, terminal controllers, and terminal 
emulators are expected to handle individual keystrokes without any CPU 
attention whatsoever, and jobs only get CPU timeslices when there is 
processing to be done. And so timeslices tend to be measured in full 
seconds (but end immediately as soon as it's necessary to wait for user 
interaction).

--
JHHL

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Job priority (AS/400s)

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark,

On 3/31/16 3:08 PM, Mark Thomas wrote:
> On 31/03/2016 18:52, Christopher Schultz wrote:
>> On 3/30/16 8:01 PM, James H. H. Lampert wrote:
> 
> <snip/>
> 
>>> Is there a reason for this? Or was it a simple misunderstanding
>>> of how priority works on AS/400s?
>> 
>> Unfortunately, the commit log shows Rémy committing that back in
>> 2006 in r421604 where a bunch of files were added to the Tomcat 6
>> branch: 
>> http://svn.apache.org/viewvc?view=revision&revision=421604
>> 
>> It looks like the actual contents of those files pre-dates
>> Rémy's commit, and I'm not sure how to track them back further...
>> I can't seem to find the original startup scripts from the 5.5.x
>> branch just by looking through viewvc. I'd have to checkout the
>> whole project to have a look.
> 
> That goes back to before the point we had a single repo. You were 
> probably looking for this:
> 
> http://svn.apache.org/viewvc/tomcat/archive/tc5.5.x/trunk/container/ca
talina/src/bin/
>
>  which would have led you to this:
> 
> http://svn.apache.org/viewvc?view=revision&revision=288819

Thanks for chasing that down. Probably an overzealous admin who wanted
to git 'er done and so set the priority unusually high. Hardly anyone
runs Tomcat on AS/400 so nobody noticed for 12 whole years.

>> I don't see any particular reason not to change this from
>> priority 6 to priority 20. If you've got a (publicly-available)
>> reference for AS/400 that lists the appropriate priorities of
>> different kinds of jobs, I can change the priority there and
>> reference that page for interested parties.
> 
> +1

Wild Googling has produced this page:
http://www.texas400.com/b400tip16.html

...which claims that priority *30* is the same as "interactive".

Something tells me that it's going to come down to a matter of opinion
what exact priority should be used. But OS processes should probably
get higher priority than daemons, Tomcat included.

Let me know if/when you get a fix on what priority is most
appropriate. It's obviously a 2-second fix.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlb9lvMACgkQ9CaO5/Lv0PA1UQCdG1NT71gUcXxr3G5w6NCcvKmI
wSQAn147us2HzCINEg0rCAw09mbBVEgn
=4LJG
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Job priority (AS/400s)

Posted by Mark Thomas <ma...@apache.org>.
On 31/03/2016 18:52, Christopher Schultz wrote:
> On 3/30/16 8:01 PM, James H. H. Lampert wrote:

<snip/>

>> Is there a reason for this? Or was it a simple misunderstanding of
>> how priority works on AS/400s?
> 
> Unfortunately, the commit log shows Rémy committing that back in 2006
> in r421604 where a bunch of files were added to the Tomcat 6 branch:
> http://svn.apache.org/viewvc?view=revision&revision=421604
> 
> It looks like the actual contents of those files pre-dates Rémy's
> commit, and I'm not sure how to track them back further... I can't
> seem to find the original startup scripts from the 5.5.x branch just
> by looking through viewvc. I'd have to checkout the whole project to
> have a look.

That goes back to before the point we had a single repo. You were
probably looking for this:

http://svn.apache.org/viewvc/tomcat/archive/tc5.5.x/trunk/container/catalina/src/bin/

which would have led you to this:

http://svn.apache.org/viewvc?view=revision&revision=288819

> I don't see any particular reason not to change this from priority 6
> to priority 20. If you've got a (publicly-available) reference for
> AS/400 that lists the appropriate priorities of different kinds of
> jobs, I can change the priority there and reference that page for
> interested parties.

+1

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Job priority (AS/400s)

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James,

On 3/30/16 8:01 PM, James H. H. Lampert wrote:
> Earlier this week, we noticed that the JVM job (QP0ZPWT) assocated
> with the CATALINA job of a Tomcat server runs at Priority 6. This
> priority level puts it ahead of everything but the operating system
> itself.
> 
> This morning, a response to a query on the Java forum at
> Midrange.com pointed me to this excerpt from catalina.sh:
> 
>> if $os400; then # Set job priority to standard for interactive
>> (interactive - 6) by using # the interactive priority - 6, the
>> helper threads that respond to requests # will be running at the
>> same priority as interactive jobs. COMMAND='chgjob
>> job('$JOBNAME') runpty(6)' system $COMMAND
>> 
>> # Enable multi threading export QIBM_MULTI_THREADED=Y fi
> 
> This seems to be based on a misconception: run priority is a value
> from 0 to 99, with lower numbers denoting greater importantce. 0 is
> reserved for the operating system itself, 1-15 typically also used
> for the operating system itself, 20 used for most interactive jobs,
> 50 and up used for most batch jobs (including server jobs).
> 
> Note: interactive jobs -- people signed on to physical terminals,
> or to terminal emulators -- typically run at priority 20. NOT
> priority 6.
> 
> By setting Tomcat's JVM job at priority 6, we are not only putting
> it ahead of interactive jobs, but also ahead of all but the most
> important system jobs.
> 
> Is there a reason for this? Or was it a simple misunderstanding of
> how priority works on AS/400s?

Unfortunately, the commit log shows Rémy committing that back in 2006
in r421604 where a bunch of files were added to the Tomcat 6 branch:
http://svn.apache.org/viewvc?view=revision&revision=421604

It looks like the actual contents of those files pre-dates Rémy's
commit, and I'm not sure how to track them back further... I can't
seem to find the original startup scripts from the 5.5.x branch just
by looking through viewvc. I'd have to checkout the whole project to
have a look.

I don't see any particular reason not to change this from priority 6
to priority 20. If you've got a (publicly-available) reference for
AS/400 that lists the appropriate priorities of different kinds of
jobs, I can change the priority there and reference that page for
interested parties.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlb9Y+sACgkQ9CaO5/Lv0PBDJgCfTaGrOQGYFM4gqlryUydoXfjk
zl8An2f9YZWIcquq2+9PmsId35otT/xp
=zQw3
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org