LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 06-13-2007, 12:22 PM   #1
registering
Member
 
Registered: Jun 2003
Location: Florida, USA
Distribution: Drake 10.1 Download
Posts: 182

Rep: Reputation: 30
Can kernel kill long-running process?


I've heard the kernel can kill a process that eats-up too much CPU time, and that it's configurable, however I don't see anything in sysctl that sounds similar. Anyone know if this feature exists? That is, I can tell the kernel "anything using more than 5 minutes CPU time, kill it"?
 
Old 06-13-2007, 01:23 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,009
Blog Entries: 5

Rep: Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787
Yikes!!!

You could write a script to do that but it would be rather dangerous. Some things accumulate time throughout their lifecycle (monitoring tools are notorious for this) and killing them just because they had a lot of CPU time would hardly be reasonable.

You need to understand what is running on your system and determine impact of stopping it (and restarting if necessary). If you have commands that have a lot of CPU time it would be better to understand WHY they do (or accept that they do) than to kill them willy-nilly.
 
Old 06-13-2007, 01:29 PM   #3
registering
Member
 
Registered: Jun 2003
Location: Florida, USA
Distribution: Drake 10.1 Download
Posts: 182

Original Poster
Rep: Reputation: 30
I understand the repercussions of killing processes using various criteria. I was wondering if the kernel was capable of doing this via either a compile-time parameter or at runtime (e.g., via sysctl), similar to various 3rd party tools like NetIQ. Thanks.
 
Old 06-14-2007, 11:06 PM   #4
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,401

Rep: Reputation: 1119Reputation: 1119Reputation: 1119Reputation: 1119Reputation: 1119Reputation: 1119Reputation: 1119Reputation: 1119Reputation: 1119
The kernel would not do this on its own. A process with sufficient authority could be programmed to [tell the kernel to] do it.
 
Old 06-14-2007, 11:14 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,353

Rep: Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042
Maybe you're thinking of the OOM_killer - but that's based on memory consumption, not CPU.
 
Old 07-20-2007, 08:45 AM   #6
registering
Member
 
Registered: Jun 2003
Location: Florida, USA
Distribution: Drake 10.1 Download
Posts: 182

Original Poster
Rep: Reputation: 30
For others searching for the same thing, I found the solution: ulimit -t can limit processes' CPU time.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Process won't kill mrsolo Linux - Software 5 08-03-2007 12:45 PM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 02:32 PM
Cannot kill process Zeno McDohl Linux - General 13 04-14-2005 02:31 PM
can't kill the process ust Linux - Software 1 09-15-2004 06:05 AM
How can I see what process are running and how to I kill them? (command line). brynjarh Linux - Newbie 4 07-07-2004 03:01 PM


All times are GMT -5. The time now is 02:29 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration