Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 10-11-2007, 01:07 PM   #1
Registered: Jan 2007
Posts: 55

Rep: Reputation: 15
Exclamation CentOS -- Perl Using 95% Of Both My CPUs

Hello, just recently PERL has been eating all my cpu power. I am running a dual xeon server, and the perl process is going crazy. I tried restarting no luck, still eating cpu. Here is what top is displaying:

Cpu0 : 92.0% us, 8.0% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si
Cpu1 : 92.0% us, 8.0% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si

7266 root 25 0 7172 4212 2744 R 95 0.2 475:51.23 perl
7220 root 25 0 7160 4212 2744 R 51 0.2 487:20.17 perl
7168 root 25 0 7228 4212 2744 R 50 0.2 492:44.44 perl

Any ideas what is going on? Can I see which process is using the perl process? Thanks for the help.
Old 10-11-2007, 09:43 PM   #2
Registered: Oct 2006
Distribution: debian
Posts: 124

Rep: Reputation: 15
pstree | less
shows all your processes as a tree. You might have to install pstree. There are also gui versions but if you're aready tight on CPU you won't enjoy agonisingly slow render times.
Old 10-11-2007, 10:06 PM   #3
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
They are probably something broken, but in case you suspect they are maliciouos, you might want to snoop them a little:
You can find out what files they have open like this (example for one of the process IDs):
lsof -p 7266
You can also connect to them with strace to see what system calls they are making, e.g.:
strace -p 7266
If you want to grep the output of strace, you need to re-direct stderr to stdout first, e.g.
strace -p 7266 2>&1 |grep ^open
You might also want to see if these processes are connected to any remote hosts:
netstat -p |grep perl
You can also get a load of information out of the /proc/7266 area. Looking in the environ can be interesting. cmdline might tell you what the script's file is, but it also might not, depending on how the script was invoked.
Old 10-14-2007, 08:43 AM   #4
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Find out what perl script or program is running and take it from there? Perl is usually invoked and doesn't run as a service. Seems to be it might be a cron job or some type kicking off and hanging, then the ones behind it are doing the same thing. I've seen perl scripts used to backup databases that go horribly wrong or cause high cpu usage, memory usage, etc.
Old 10-24-2007, 12:59 PM   #5
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15

Ok, seems to be a perl script which updates my dynamic ip address with It seems to be hanging and then others just stack right on top of it. It is wierd though because the script works, but just after a while of running cron tasks every 5 minutes they seem to start failing.

Can I limit the amount of time a cron script runs for? For example, is the process runs for more then 15 minutes then kill the PID?

Thanks for the help.


parent, process, tree

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: CentOS announces CentOS 5 i386 Live CD LXer Syndicated Linux News 0 07-11-2007 08:01 AM
Centos 4 runs out of memory where Centos 3 didn't! czamora Red Hat 5 12-21-2006 03:21 PM
Whats the differnce between Centos and CentOS? duffmckagan cAos 1 06-12-2005 01:23 PM
update centos 4 rc1 to centos 4 trou yum? maxut cAos 2 03-04-2005 03:36 AM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 09:09 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:43 AM.

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