Web Hosting Talk







View Full Version : CPU load/more problems


gertiebeth
04-25-2001, 09:30 PM
Oh, I am having one hell of a time! My RaQ is barely 10% full and I'm experiencing problems with applications timing out and a heavily loaded CPU. Here is what I have:

RaQ4i through Rackshack.net
20gig harddrive, 150gig transfer/month, 512k RAM

Yes, the RaQ has several CGI scripts running on it. What would I need to do to upgrade my RaQ to handle the CPU load? Is there something wrong? Could I maybe have setting wrong in my admin. panel? I am really learning as I go, so any help would be greatly appreciated. :)

huck
04-26-2001, 09:02 AM
Needless Processes
A default Raq install runs a number of processes that you may not need. The biggests one of all is Chilisoft ASP. If you are not using Chilisoft, then turn it off.

Check your process list for any applications that may be left open. Also, make sure none of your clients have installed some program that is sucking up the cpu.


You can use:

ps -aux | wc

at the command line to count the number of processes. The first number is the number of processes running on the machine. My machine has about 45 processes with MySQL running and about 15 httpd servers. If you have a lot of procs running this can suck up your CPU. Go through the list and check what processes you can get rid of.



Runaway Scripts
Make sure you do not have any scripts that are stuck in loops. This is especially true if you run mod_perl. Also, make sure your scripts do not have memory leaks. Unless you are running very complicated scripts, CGI-bin should be efficient, especially as each script dies off when it is finished.

Application Timeouts?
What applications are timing out? Send some more info and maybe people in the forums can send you some specifics.

jnestor
04-26-2001, 11:29 AM
I noticed really high CPU loads when I moved onto my RaQ. It was normally hovering around 2 and would spike much, much higher - 20+.

Poking around in MySQL I noticed a very common query was taking a huge amount of time. Added an index and that went away. Dumbness on my part to not have it in the first place. Avoid a table scan of a 60K record table.

After that my average load dropped to about .5 but would still spike unexpectedly. I thought it was just being abused by se spiders but top showed me that I had httpd processes spinning. I never did figure out why. I have httpd connected to tomcat for servlets and I do some small cgi's but they're not mod-perl or php or anything that runs in the httpd process. I basically punted an wrote a little script which I run every 15 minutes looking for httpd processes with too much CPU time. I can let you have it if you'd like but it'll only help if you're having httpd spins.

gertiebeth
04-28-2001, 04:15 PM
Huck, thanks again for your help. I'm a newbie to this whole RaQ thing and didn't even know what Telnet was when I purchased it! But, I'm learning...

OK, I typed in the command (as SU):

ps -aux | wc

and it came back with this:

95 1115 7513

But this is it. How do I see exaclty what applications are running and how do I turn them off? I do have 3 different banner exchanges running on the RaQ but other than that, the CGI scripts are minimal. I thought a dedicated RaQ whould help solved my banner exchange problem... :(

huck
04-28-2001, 04:36 PM
You may want to check out:
http://www.linuxnewbie.com
Designed for the new linux admin....


ps is the process list command -- for any command you should be able to type
man ps
to get the manual page
or for some commands you can follow them by
--help
that's two dashes, i.e.
ps --help

You can use
ps -axf
to list all of the processes by name -- then indentation shows you which parent process gave rise to the child process.

gertiebeth
04-28-2001, 05:07 PM
Thank for the link huck.

I went in and typed ps -axf and got this:

5065 ? S 0:10 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
16124 ? S 0:04 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
20254 ? S 0:03 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
30665 ? S 0:02 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
31453 ? S 0:02 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
31456 ? S 0:01 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
31458 ? S 0:01 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
4419 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
9951 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
9961 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
9964 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
9966 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
10274 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
10278 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
10279 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
10349 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
10351 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
10352 ? S 0:00 \_ /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf
471 ? S 0:00 sendmail: accepting connections
503 ? SN 0:01 /usr/bin/postmaster
630 ? S 0:00 /home/chiliasp/asp-apache-3000/caspd
631 ? S 0:00 \_ /home/chiliasp/asp-apache-3000/caspd
632 ? S 0:00 | \_ /home/chiliasp/asp-apache-3000/caspd
643 ? S 0:00 \_ /home/chiliasp/asp-apache-3000/caspeng -p:3001 -mt:5
651 ? S 0:00 \_ /home/chiliasp/asp-apache-3000/caspeng -p:3001 -mt:5
652 ? S 0:00 \_ /home/chiliasp/asp-apache-3000/caspeng -p:3001 -mt:5
657 ? S 0:00 \_ /home/chiliasp/asp-apache-3000/caspeng -p:3001 -mt:5
661 ? S 0:00 \_ /home/chiliasp/asp-apache-3000/caspeng -p:3001 -mt:5
665 ? S 0:00 \_ /home/chiliasp/asp-apache-3000/caspeng -p:3001 -mt:5

I still don't know what all of that means, but I am a bit confused. None of the sites on my RaQ are using ASP... (?)