Operating System - HP-UX
1830239 Members
1711 Online
109999 Solutions
New Discussion

Re: restricting cpu / memory of a program

 
SOLVED
Go to solution
Ryan Kogelheide
Frequent Advisor

restricting cpu / memory of a program

I have some Oracle Forms programs that can contain infinite loops (if they are poorly programmed). Is there a way I can restrict the program or watch the system form programs with a certain name and memory/cpu consumption and kill them?
5 REPLIES 5
Stefan Farrelly
Honored Contributor

Re: restricting cpu / memory of a program


Theres a couple of standard HP products which can help;

1. Process Resource manager. This allows certain processes or groups of them to use only X amount of CPU.

2. Measureware or Glance/UX Pak. This product has an alarmdef file which you can configure to see if processes are running, if theyre using too much cpu or memory or whatever else, then run a script (to report it or you can automatically kill them or whatever).

Both these you have to pay for though.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Jeff Schussele
Honored Contributor

Re: restricting cpu / memory of a program

Hi Ryan,

You should consider HP's PRM (Process Resource Manager) program. It's designed to do just that.

See the following for more info:

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B8733-90007/B8733-90007_top.html&con=/hpux/onlinedocs/B8733-90007/00/00/12-con.html&toc=/hpux/onlinedocs/B8733-90007/00/00/12-toc.html&searchterms=PRM&queryid=20020516-091049

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: restricting cpu / memory of a program

While PRM is really the tool you need, I can suggest a Plan B that's free. In the .profiles of these 'rogue' developers use ulimit -d to limit process datasize, ulimit -t to limit process time, or make a wrapper to set ulimits before invoking these programs. After the code has been cleaned up, you can remove the restrictions. Man sh_posix and look for ulimit for details.


If it ain't broke, I can fix that.
Roger Baptiste
Honored Contributor

Re: restricting cpu / memory of a program


PRM is a good tool, but it costs bucks and is useful if you want to divide CPU and other resources between different user groups who have equal claim on the system.

But your case seems to be due to lazy/careless programmers or probably with folks in a testing env. in that case, option 2 is better.
Run it as a cron job.

HTH
raj
Take it easy.
Tom Danzig
Honored Contributor

Re: restricting cpu / memory of a program

You could also start the forms program using a higher nice value to limit it's priority for CPU usage. Also free.