Operating System - HP-UX
1820623 Members
1868 Online
109626 Solutions
New Discussion юеВ

Re: Set java process higher priority

 
Ray Bell
Regular Advisor

Set java process higher priority

I need to set a java thread process to a higher priority. How can I set this to run at boot time and keep the same priority?
6 REPLIES 6
whiteknight
Honored Contributor

Re: Set java process higher priority

Ray

You can use renice command to a high priority

man 1m renice
example: renice -n 14 -p

hope this help

WK
Problem never ends, you must know how to fix it
Ray Bell
Regular Advisor

Re: Set java process higher priority

But how would this help at boot time. can I add a group with certain priviledge? I like to have this user always having a high proirity than the normal users because his process need to alwasy run without having a delay.
Tim Nelson
Honored Contributor

Re: Set java process higher priority

In your boot script that starts the proces. ID the pid then execute renice, all in the same boot script.

Ray Bell
Regular Advisor

Re: Set java process higher priority

Howe would I set this one up so that it will run higher than the rest of the user process. I know that process from 1-127 are for realtime processes for the system and the users processes are from 178 and higher so what nice command would I give this one so it will be highee than the rest. Would I set it as the following:

renice -n -19 -p
Ray Bell
Regular Advisor

Re: Set java process higher priority

Howe would I set this one up so that it will run higher than the rest of the user process. I know that process from 1-127 are for realtime processes for the system and the users processes are from 178 and higher so what nice command would I give this one so it will be highest than the rest. Would I set it as the following:

renice -n -19 -p
Dennis Handly
Acclaimed Contributor

Re: Set java process higher priority

What's your question now? WK told you one way how to do it and you echoed it.

What do you need to know? How to identify the PID? You would need to start the process at boot time.

You also mentioned "group with certain privilege". You can use setprivgrp(1m) for RTPRIO & RTSCHED and then modify your java application to use the corresponding functions.