Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2007-07-25
17
Medium Priority
?
632 Views
Last Modified: 2013-12-16
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
0
Comment
Question by:Jay-Shahj
  • 7
  • 4
  • 2
  • +3
17 Comments
 
LVL 28

Expert Comment

by:FishMonger
ID: 19567370
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
 
LVL 85

Expert Comment

by:ozo
ID: 19567391
do you want to do a nice/setpriority on it?
0
 
LVL 5

Expert Comment

by:mkatmonkey
ID: 19567396
You can use "nice". You can give your script the lowest priority by using:

nice -n 19 myPerl.pl -a myPerlScriptArg
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 4

Author Comment

by:Jay-Shahj
ID: 19567405
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
 
LVL 5

Expert Comment

by:mkatmonkey
ID: 19567464
Maybe the permissions are to restrictive in any of the parent directories?
0
 
LVL 4

Author Comment

by:Jay-Shahj
ID: 19567559
"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
 
LVL 39

Expert Comment

by:Adam314
ID: 19567668
Any changes to filesystem mounting?
0
 
LVL 4

Author Comment

by:Jay-Shahj
ID: 19567699
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
 
LVL 85

Expert Comment

by:ozo
ID: 19567778
what's running on the ppid of those processes?
0
 
LVL 4

Author Comment

by:Jay-Shahj
ID: 19567810
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
 
LVL 17

Expert Comment

by:mjcoyne
ID: 19571178
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
 
LVL 4

Author Comment

by:Jay-Shahj
ID: 19572786
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
 
LVL 17

Expert Comment

by:mjcoyne
ID: 19573341
Hmmm...  We need to find those miniserv files.  Try

find / -name miniserv\*

and go have a cup of coffee...
0
 
LVL 17

Accepted Solution

by:
mjcoyne earned 2000 total points
ID: 19573435
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
 
LVL 4

Author Comment

by:Jay-Shahj
ID: 19573446
That'll do, thanks. Just have to kill it every time it loads up.

Jay
0
 
LVL 17

Expert Comment

by:mjcoyne
ID: 19574989
You should find out what file is starting it, and remove that file.  Try:

grep -r miniserv /etc/rc*/* /etc/cron*/*
0
 
LVL 4

Author Comment

by:Jay-Shahj
ID: 19575011
Returned Nothing.

Jay
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question