Perl using too much CPU, need advise to reduce it!

Hi,

I believe PERL is using too much CPU on my server, and are looking for a way reduce this. Within WHM, I can see this (highlighted in red):

User      Domain      %CPU      %MEM      Mysql Processes
nobody                                36.38      0.77      0.0
Top Process      %CPU 74.6      /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
Top Process      %CPU 74.4      /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
Top Process      %CPU 74.2      /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf

Any Suggestions?

Many Thanks,

Jay
LVL 4
Jay-ShahjAsked:
Who is Participating?
 
mjcoyneCommented:
What does the 'ps' command show the process ID (PID) of these to be? Run:

 ps aux | grep miniserv

On my machine, this produces:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND

root      1548  0.0  1.1  10620  5824 ?        Ss   Jul25   0:01 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
root      5781  0.0  0.1   4008   716 pts/1    S+   07:26   0:00 grep miniserv

The number in the second column is the PID (the third column is %cpu, BTW). The second entry in the list produced is just ps detecting the process of grep looking for miniserv -- the command I just issued.  If nothing else, with this info you can kill the one you don't want:

kill -9 1548

You can also see the user that started the process (root, in my case) in the ouptu of the ps command.
0
 
FishMongerCommented:
It's more likely that it's a problem with the miniserv.pl script.  Have you looked at that script to see what it's doing and what you can do to make it more efficient?
0
 
ozoCommented:
do you want to do a nice/setpriority on it?
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
mkatmonkeyCommented:
You can use "nice". You can give your script the lowest priority by using:

nice -n 19 myPerl.pl -a myPerlScriptArg
0
 
Jay-ShahjAuthor Commented:
That's the best bit, neither files exist:

root@server [/usr/local/apache/logs]# /usr/libexec/webmin/miniserv.pl
-bash: /usr/libexec/webmin/miniserv.pl: No such file or directory
root@server [/usr/local/apache/logs]# /etc/webmin/miniserv.conf
-bash: /etc/webmin/miniserv.conf: No such file or directory

Any theories? Am I missing something?

Jay
0
 
mkatmonkeyCommented:
Maybe the permissions are to restrictive in any of the parent directories?
0
 
Jay-ShahjAuthor Commented:
"Maybe the permissions are to restrictive in any of the parent directories?"
 > Sorry?

I've listed /etc/ directory, the folder 'webmin' doesn't exit:

root@server [/usr/libexec]# cd /etc/webmin/
-bash: cd: /etc/webmin/: No such file or directory

Nor

root@server [/usr/libexec]# /usr/libexec/webmin/
-bash: /usr/libexec/webmin/: No such file or directory

I am root, any way to hide files from, well, myself?

Jay
0
 
Adam314Commented:
Any changes to filesystem mounting?
0
 
Jay-ShahjAuthor Commented:
Never:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda3             77038880  20982668  52142780  29% /
/dev/hda1               101086     14057     81810  15% /boot
none                    513768         0    513768   0% /dev/shm
/usr/tmpDSK             495844     21985    448259   5% /tmp
/tmp                    495844     21985    448259   5% /var/tmp
0
 
ozoCommented:
what's running on the ppid of those processes?
0
 
Jay-ShahjAuthor Commented:
nobody   22690 61.1  0.3  6536 3496 ?        R    14:12 152:06 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf

Jargon to me!

Jay
0
 
mjcoyneCommented:
If you're not using Webmin, shut it off.  Run the following command to see what runlevels Webmin is started in:

chkconfig --list | grep webmin

on my Fedora machine, this results in:

webmin  0:off  1:off  2:on  3:on  4:off  5:on  6:off

So, to stop Webmin from starting on boot in runlevels 2, 3 and 5, I would issue:

chkconfig --level 235 webmin off

and reboot.
0
 
Jay-ShahjAuthor Commented:
Hi,

This command:

root@server [/home]# chkconfig --list | grep webmin
root@server [/home]#

Gives me a blank line, as you can see. I did not install webmin personally, unless cPanel did. I did chkconfig --list alone, and webmin wasn't there.

Jay
0
 
mjcoyneCommented:
Hmmm...  We need to find those miniserv files.  Try

find / -name miniserv\*

and go have a cup of coffee...
0
 
Jay-ShahjAuthor Commented:
That'll do, thanks. Just have to kill it every time it loads up.

Jay
0
 
mjcoyneCommented:
You should find out what file is starting it, and remove that file.  Try:

grep -r miniserv /etc/rc*/* /etc/cron*/*
0
 
Jay-ShahjAuthor Commented:
Returned Nothing.

Jay
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.