- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Killing high CPU Appln. Processes.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 11:29 AM
10-02-2002 11:29 AM
We are running 11.0 on Nclass with 6 processors. We are frequently having runaway processes which occupy high CPU. We decided to put a script(using top) which would capture the top processes and monitor it for 15 minutes and if they constantly occupy more than 90% then we would kill it. Now when we test this script(using self created runaways) on a 3CPU N class box, if I start 6 runaway processes it only occupies 50% of each CPU. The problem is my development has Nclass, 6CPUs and testing has Nclass 3 CPUs and production has Nclass 6CPUs. Now the testing team is not able to identify the runaway 'coz it never gets to 90% (6 processes on 3 CPUs). What would be the solution to this. How do I convince them to run this? I know that it not a good idea to automate the killing but we are only killing specific user processes and we have taken care in ther script to do so. How does these 6 runaway processes behave on a 3CPU box vs 6CPU box? Please explain.
Thanks
Ben.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 11:52 AM
10-02-2002 11:52 AM
Re: Killing high CPU Appln. Processes.
You can calculate the elapsed time (clock time) by subtracting the starting time of the process (STIME from ps) from the timeofday(). Then compare this to the TIME (execution time). If they are close (TIME > 80% of elapsed time, for example) then kill it.
But, IMHO, I think you should find out why there are runaway processes in the first place.
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 12:08 PM
10-02-2002 12:08 PM
Re: Killing high CPU Appln. Processes.
Thanks
Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 12:10 PM
10-02-2002 12:10 PM
Re: Killing high CPU Appln. Processes.
For example, normal processes average < 10% CPU utilization, with an occassional spike to 60%, then a process that averages > 40%, with spikes to 90% would be a candidate for termination. What about a process that uses > 10% but < 20%?
HTH
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 12:29 PM
10-02-2002 12:29 PM
Re: Killing high CPU Appln. Processes.
Thanks
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 12:57 PM
10-02-2002 12:57 PM
Re: Killing high CPU Appln. Processes.
Try running "ps -ef" at a prompt.
Runaway processes will consume large quantities of CPU time, where most apps will consume very little, even if they run 24/7.
As an example, if you see a user process that was started an hour ago, and it's used 45 CPU minutes, then it's probably a runaway (it has used 75% of the CPU) You could probably do something as simple as checking if it has more than 5 minutes of CPU time total... xterms use little CPU resources normally.
I'm guessing that you're using XTERM and displaying it on a PC with X emulation... I've see XTERMs runaway when the display station (the PC) reboots. I never did find a way of stopping that. My solution was to use telnet instead xterm.
Anyone out there ever figure that out how to stop an xterm from running away when the Xserver goes away?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 01:03 PM
10-02-2002 01:03 PM
Re: Killing high CPU Appln. Processes.
symptom PROC_loop type=CPU
rule PROC_CPU_TOTAL_UTIL > 50 prob PROC_CPU_TOTAL_UTIL
alarm PROC_loop > 90 for 15 minutes
type = "CPU"
start
if PROC_loop > 95 then
red alert "Process looping probability=", PROC_loop, "%"
else
yellow alert "Process looping probability=", PROC_loop, "%"
repeat every 15 minutes
if PROC_loop > 98 then
red alert "Process looping probability=", PROC_loop, "%"
else
yellow alert "Process looping probability=", PROC_loop, "%"
end
reset alert "End of process looping alert"
I don't automatically kill the process, I have an SA verify first before killing.
HTH
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 05:34 PM
10-02-2002 05:34 PM
Re: Killing high CPU Appln. Processes.
ps -e -o pcpu,pid,ppid,ruser,args | sort -rn
Then pick the top processes or those that exceed some percentage of total CPU time.
The problem you are seeing is the most common reason for runaway processes in Unix today: exporting Xwindows applications to an unstable display device (ie, the PC). Typical Xwindow programs do not expect the display to disappear nor are they coded to check for a display device after connecting.
If you check, you'll find not only are these orphaned applications consuming useless CPU cycles, the are also dumping a bunch of junk on the LAN. If you can change the application, add a keep-alive test to see if display still exists. If the test times out, you can terminate gracefully. Of course, apps you can't change will always be a problem.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 06:07 AM
10-03-2002 06:07 AM
Re: Killing high CPU Appln. Processes.
Thanks
Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 06:22 AM
10-03-2002 06:22 AM
Re: Killing high CPU Appln. Processes.
Neither of these in and of itself will identify a runaway, but they help find suspect processes. Generally a process with a parent id of 1, that normally doesn't have a PPID of 1, with high cpu is a bad thing and most likely a runaway.
Good Luck
Todd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 10:02 AM
10-03-2002 10:02 AM
SolutionTo answer you 3CPU machine issue, that is exactly the way the process scheduling policy works. Please note that the process priorities are assigned in groups and you may nice/renice them to change priorities.
Giri.