Two dedicated separate servers running with identical configuration of hardware (Dual E5-2620 32GB) in similar environment (CentOS 6.3, Apache+PHP+MySQL) serving similar tasks, but behaving in different way of processing Apache web server - CPU usage 17x times bigger in server which has lower requests.

CPU Usage: u2.03 s1.05 cu316.97 cs0 - 4.35% CPU load 11.9 requests/sec - 5.3 kB/second - 458 B/request

CPU Usage: u16.98 s5.11 cu705.75 cs0 - .243% CPU load 25.4 requests/sec - 13.4 kB/second - 540 B/request

My question: which parameter/s might be responsible for this condition?

  • Are they running the same software under PHP? What differences are there in their Apache configs? – Shane Madden Jan 17 '13 at 1:50
  • Software under PHP is similar. But for configs I would like to be advised, where exactly do I need to look on httpd.conf file? Because parameters is similar in Apache config from WHM/cPanel. – Arturas Jan 17 '13 at 1:59
  • How did you go about ensuring that the machines were configured identically? – Matt Simmons Jan 17 '13 at 2:00
  • Tricky question, but I try. – Arturas Jan 17 '13 at 2:03
  • @Matt Simmons Right question and tricky for my, but I try: I am not sure, but common sense tells me that on top of many XYZ must be some parameter/s which is closest to high CPU usage by Apache. And my guessing is that this parameter should be in Apache configuration file. – Arturas Jan 17 '13 at 2:10

I must admit that my question is without proper answer. Maybe a dumb one? :) But even in situations like this, there always will be a solutions (but one must seek for it by himself).

My solution was simple, but too complex to answer this question, because there is not any parameter which is ONE and DIRECTLY responsible for high CPU usage. Apache server have many of them, but most important is TIME (In my case I was to fast to decide from one hour of apache activity that server is consuming too much). Time, while server is running and collecting enough data to give you proper statistics, is in first place.

First: TIME. Before deciding that CPU usage is high because of wrong configuration, you must wait. Let server run at least for 24 hours (or more?) and then look up at CPU usage.

If CPU usage is still very high, lower down these parameters: Limiting of StartServers, MaxClients, MaxRequestsPerChild parameters will give lower CPU usage, but server might be unable to manage all comming traffic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.