Help CPU load averages Way over 15% because of alot of fastCGI and help would be great..

Hey all i have a question if anyone can help i have a client that has like 50 domains… and my CPU load averages is Way over 15% all the time because of FastCGI how can i get this down to like 2@ or lower? people can not get to my sites because it is taking SO long… and Timming out… any help would be GREAT…

What’s the specs of your machine? CPU, cores, memory, disk? What’s the memory, disk and network load (use atop to check)? How much exactly is “way over 15%”? How did you measure that? With (a)top or uptime? What exactly is the CPU load? 15% is all okay with that many domains. What’s the output of cat /proc/loadavg?

top - 13:39:43 up 16 days, 18:56, 1 user, load average: 14.19, 14.26, 14.61
Tasks: 257 total, 1 running, 256 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.9%us, 0.2%sy, 0.0%ni, 65.1%id, 33.7%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1785856k total, 1777716k used, 8140k free, 6708k buffers
Swap: 4095992k total, 1936128k used, 2159864k free, 132540k cached

14.76 14.45 14.65 1/312 29756

13:44:08 up 16 days, 19:00, 1 user, load average: 13.57, 16.60, 15.70

Specs 2X dual xeon 2.09 2 gig ram

Out of curiosity, what does the output of this command show:

mailq | tail -1

[jdamron@warrior ~]$ mailq | tail -1

Mail queue is empty

Fairly frequently, the cause of performance issues is related to large email queues. That doesn’t seem to be the case here :slight_smile:

So, what is causing those performance issues… well, part of the issue at hand is that you’re using 2GB of swap. So the RAM requirements of the processes you’re running are more than your server has available, and you may be seeing some thrashing.

As Locutus mentioned, you may want to spend some time reviewing the top/atop output, and see what’s taking up a lot of your CPU/RAM.

If it is indeed fcgid, that may suggest that a particular website on your server, and perhaps even a specific page on that site, is consuming a lot of resources.

Identifying what user the website belongs to would allow you to start monitoring the logs to determine more about what’s causing those problems.

Also, the MaxClients setting in most Apache configs is often set to high by default, allowing more Apache processes to launch than the server has resources to handle. If you’re seeing a lot of Apache processes running, you may want to limit how many Apache launches.

Using the ‘ps’ output, you can determine roughly how much RAM each Apache process takes up. You’d want to make sure that there’s enough RAM on your server for all the processes that can be launched. For example, if each Apache process is taking up 50MB, and MaxClients is set to 150 (a common default), that means your server would require roughly 7.5GB of RAM.

-Eric

yea i see what you mean… when i type ls -la i see like 2-5 FCgid’s running for like each client… i was wondering how can i make it to only like 2-3 run per client…
i have cut the php down to 8 mgs each client… but i still cant see my site or any other clients sites on my server and man it takes forever to load the webmin/virtualmin page…Now if i turn off the apache it goes really fast… and load is like a .75 or less
Hmmmmm

Hey Eric this all started when i migrated a Cpanel Client that had like 20 domains… it messed up my DNS and i fixed that… and now the load it REALLY high… Now when i shut apache off for like a min… then turn it back on for like the first 10 min i can get to it fine…

It certainly does sound like something in Apache is causing the issue you’re seeing though.

If you run “top”, is there a particular user who has processes that seem to keep showing up near the top of the list?

Also, the following string of commands can be used to determine if there’s a particular host who is opening up a large number of connections to your site. Try running this, you’ll receive a list of IP’s conneccted to your server, as well as how many open connections they have:

netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -nr | head

After doing that, do you see any IP addresses with more than, say, 50 connections?

-Eric

No i see one with 15 it is my main IP other then no

the thing is they are all running wordpress… How is that taken up alot of cpu? man i cant seam to figure it out…

Well, using the bandwidth graphs (in System Settings -> Bandwidth Monitoring), you might be able to determine if one site in particular is receiving a large amount of traffic.

Other than that – it’s possible that one of those sites is using a plugin that’s causing high resource consumption.

You could always try disabling the sites, one at a time, and see if after that the load on your server goes down.

You may also be able to determine the same thing by reviewing the Apache logs for each domain, but disabling the site may be quicker if you’re feeling impatient :slight_smile:

-Eric