Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

Default process priority & clearing queues

Go to solution
Occasional Advisor

Default process priority & clearing queues

Two questions:

1) I have a process that had been hogging the CPU and I lowered its priority to resolve the issue. However, anytime the server is rebooted it returns to its old priority and clogs up the CPU again. How do I make it so that the priority will be the lower value even after the server is rebooted?

2) If a queue has thousands of jobs in it that you want to get rid of, is there any way to delete all entries without deleting the queue, and without manually punching in every single entry number in a delete/entry= command?
Steven Schweda
Honored Contributor

Re: Default process priority & clearing queues

> 1) [...]

Who starts this process, how?

> 2) [...]

Write a command procedure to do it
non-manually? One popular method is to use
DELETE /QUEUE to destroy the whole thing, and
then use INITIALIZE /QUEUE to create a new
(empty) queue.
Occasional Advisor

Re: Default process priority & clearing queues

1) The process is automatically running once the system is started up.
Regular Advisor

Re: Default process priority & clearing queues

Example to delete all entries in a queue
$! NAME : SYS_COM:delete_entries.com
$! AUTHOR : Toine
$! DATE : 04-sep-2004
$! VERSION : 1.0
$! DESCRIPTION : Delete all entries in a queue
$ if p1 .eqs. "" then inquire p1 "Give name of queue"
$ if p1 .eqs. "" then exit
$ temp = f$getqui("cancel_operation")
$ queue_name := 'f$getqui("display_queue","queue_name",p1,"wildcard")
$ if queue_name .eqs. "" then exit
$ set noon
$! Delete aborting jobs
$ stop/queu/reset 'queue_name
$! Delete all entries
$ job_name := 'f$getqui("display_job","job_name",,"all_jobs")
$ if job_name .eqs. "" then goto end_loop
$ job_entry := 'f$getqui("display_job","entry_number",,"all_jobs,freeze_context")
$ write sys$output queue_name," ",job_name," ",job_entry
$ delete/entry='job_entry'
$ goto job_loop
$ end_loop:
$! Start queue
$ start/queu 'queue_name
$! Show queue and jobs
$ sho queue 'queue_name
$ set on
Joseph Huber_1
Honored Contributor

Re: Default process priority & clearing queues

Usually a process does not "run automatically" at system boot, it has to be started by some command out of systartup_vms.com (or a command-file executed from there).
It is started either as a batch job (SUBMIT):
check the queue priority, eventually lower it (INIT QUEUE/BASE_PRIORITY=x),
or started as a /DETACHed process: specify the priority in RUN/DETACH/PRIORITY=x .

Clearuing a queue:
there have been procedures posted here and on c.o.v.
One I have kept can be downloaded here:

See e.g. here at ITRC forum:
Honored Contributor

Re: Default process priority & clearing queues

"shoot first and ask questions later" is seldom a fix for these cases. Figure out what the process is and what's triggering the loop, or, well, GOTO 1

$! pick one:
$ ASSIGN/MERGE SCRATCH queue-to-empty

Steven Schweda
Honored Contributor

Re: Default process priority & clearing queues

> 1) The process is automatically running
> once the system is started up.

If it's started by magic, then you're
probably out of luck. If some command
procedure in the system start-up sequence
starts it, then there may be a way to choose
its priority. Given a description with the
level of detail of "a process", my psychic
powers are too weak to let me do more than
guess what you're talking about.
Robert Gezelter
Honored Contributor

Re: Default process priority & clearing queues


Welcome to the ITRC OpenVMS Forum.

As has been noted previously, processes do not just "start on their own". That said, I will presume that you meant "I did nothing to manually initiate the process".

The default in most cases is the default priority contained in the account under which the process was started. This is maintained in the UAF file Generally, the primary UAF is SYS$SYSTEM:SYSUAF.DAT; but your actual location may vary due to a system logical name (SYSUAF) or the value of SYSGEN parameter UAFALT. Alternatively, the process priority can be established when the process is created using the RUN command (see HELP RUN PROCESS). Finally, some processes that hold ALTPRI privilege bit may elevate their privileges.

In most cases, the first two choices are the relevant ones. They will require some legwork on the actual system. First check what username is associated with the process (SHOW PROCESS/ACCOUNTING is adequate for this purpose). Change the default priority for this process. A note of caution, if the account is used by more than one process, all will be affected, so this should be done with a fairly high degree of understanding, lest the overall application become unstable.

If the process is being started using the RUN/DETACH, the actual RUN/DETACH command will need to be located, it may include a specified base priority (/PRIORITY), and that will need to be changed.

Lastly, the reason for the "looping behavior" is best determined precisely. Reducing priority is taking an aspirin/acetaminophen tablet, it is only a palliative that masks symptoms, not by any means a cure.

- Bob Gezelter, http://www.rlgsc.com
Frequent Advisor

Re: Default process priority & clearing queues

All discussions of how to set the priority seem to be premature without knowing what the process is, what program or command procedure it is running, and what it is doing. If it is a standard VMS process, setting the priority is not the best plan of attack, although it may help initially.

Can you inform us about this process?

Dave Williams
Respected Contributor

Re: Default process priority & clearing queues

It seems to me that there are 2 issues here:

1) How/why does this process end up at the same priority as interactive users?

2) Why is this process consuming most of the CPU?

Prior entries have addressed how to determine #1 and how to potentially deal with it (lowering priority). What is just as important is why does the process require so much CPU? Is this normal? Has this always been the case? What changed? Lowering the priority can be helpful not only to allow other work to proceed, but to give you time to determine whether or not the process is in some type of CPU loop. Use SDA to capture some PCs and see if the process is actually looping or if it just has a lot of work to do.

As stated before, lowering the priority only hides the problem. A little investigation should reveal why the CPU time is so high. Address that and the priority issue goes away.