You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Kory Wheatley <wh...@gmail.com> on 2007/09/05 20:26:38 UTC

[users@httpd] CPU usage

Our apache server is utilizing the CPU to almost a 100% with 45 httpd
process opened.  What sort of tuning could be done to help this situation.


The Apache server is using Moodle, PHP, and Mysql.  The Apache server is on
a dedicated V440 with 4 processors and 16 gb of memory.  The Mysql database
is on a different system identical to the one explained, so it's not like
its on a system that can handle Apache

I think it's an Apache tuning issue, but I'm not sure where to start.  I
thought about raising the number of startup server process.

RE: [users@httpd] CPU usage

Posted by Jeff Beard <je...@cyberxape.com>.
Still doesn't tell me that Apache is the problem. My experience tells me
that when there is a custom application involved, it's usually the problem.
Anyway, I'll throw some things out there for you to consider. 

 

Look at your database connections and how Moodle is configured to use them
(are they being closed appropriately, are the being pooled, pool size,
timeouts, etc.)

 

If you are using a prefork and your MaxClients is at the default of 150 and
you only have 45 processes then it could be that the OS can't allocate any
more connections. 

 

More on the MaxClients directive here including how to adjust settings for
threaded and hybrid servers:

 

  http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients

 

I don't think having a lot of sockets in a TIME_WAIT state for Apache is
necessarily bad.  

 

But if the site is becoming unusable because of the load, in the past I have
completely disabled KeepAlives to make a site more responsive while I
figured out the real problem. But that was for a site that was 90% static
content so I don't know if it would have the desired effect on your system.

 

Lastly, here's the performance doc on the Apache site: 

  

  http://httpd.apache.org/docs/2.2/misc/perf-tuning.html 

 

Let us know how things go. If you still have problems, I'm interested in
answers to these questions: what's the status of the web site? Is it still
responsive or is it slow? Can you identify requests that are slower than
others? Can you test responsiveness of a requests for static content versus
dynamic? 

 

 

Cheers,

 

Jeff

 

From: Kory Wheatley [mailto:wheakory@gmail.com] 
Sent: Wednesday, September 05, 2007 2:32 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] CPU usage

 

Apache was fine, until school started when more students started using the
web server.  There's just an over abundance of Apache processes in a
TIME_WAIT state when you do a "netstat -na".  What parameters in apache do
you recommend I look into, the keepalive settings, maxclient settings.  The
memory on the system not an issue, its just the CPU usage. 

On 9/5/07, Jeff Beard <je...@cyberxape.com> wrote:

Hi there,

 

I disagree with your assessment of the problem. You haven't provided any
information that would clearly indicate to me that there's an issue with
Apache performance. I recommend looking at the application and database
first. Especially if, for example, things were fine last week but this week
there's a resource problem. That would indicate to me that you should
examine changes made to the application and database in the interim.

 

Sorry I can't help more but I think there's more analysis to do before we
can make a call on what the problem is much less offer advice on fixing it. 

 

 

Cheers,

 

Jeff

 

From: Kory Wheatley [mailto:wheakory@gmail.com] 
Sent: Wednesday, September 05, 2007 12:27 PM
To: users@httpd.apache.org
Subject: [users@httpd] CPU usage

 

Our apache server is utilizing the CPU to almost a 100% with 45 httpd
process opened.  What sort of tuning could be done to help this situation.


The Apache server is using Moodle, PHP, and Mysql.  The Apache server is on
a dedicated V440 with 4 processors and 16 gb of memory.  The Mysql database
is on a different system identical to the one explained, so it's not like
its on a system that can handle Apache 

I think it's an Apache tuning issue, but I'm not sure where to start.  I
thought about raising the number of startup server process.

 


Re: [users@httpd] CPU usage

Posted by Kory Wheatley <wh...@gmail.com>.
Apache was fine, until school started when more students started using the
web server.  There's just an over abundance of Apache processes in a
TIME_WAIT state when you do a "netstat -na".  What parameters in apache do
you recommend I look into, the keepalive settings, maxclient settings.  The
memory on the system not an issue, its just the CPU usage.

On 9/5/07, Jeff Beard <je...@cyberxape.com> wrote:
>
>  Hi there,
>
>
>
> I disagree with your assessment of the problem. You haven't provided any
> information that would clearly indicate to me that there's an issue with
> Apache performance. I recommend looking at the application and database
> first. Especially if, for example, things were fine last week but this week
> there's a resource problem. That would indicate to me that you should
> examine changes made to the application and database in the interim.
>
>
>
> Sorry I can't help more but I think there's more analysis to do before we
> can make a call on what the problem is much less offer advice on fixing it.
>
>
>
>
>
> Cheers,
>
>
>
> Jeff
>
>
>
> *From:* Kory Wheatley [mailto:wheakory@gmail.com]
> *Sent:* Wednesday, September 05, 2007 12:27 PM
> *To:* users@httpd.apache.org
> *Subject:* [users@httpd] CPU usage
>
>
>
> Our apache server is utilizing the CPU to almost a 100% with 45 httpd
> process opened.  What sort of tuning could be done to help this situation.
>
>
> The Apache server is using Moodle, PHP, and Mysql.  The Apache server is
> on a dedicated V440 with 4 processors and 16 gb of memory.  The Mysql
> database is on a different system identical to the one explained, so it's
> not like its on a system that can handle Apache
>
> I think it's an Apache tuning issue, but I'm not sure where to start.  I
> thought about raising the number of startup server process.
>

RE: [users@httpd] CPU usage

Posted by Jeff Beard <je...@cyberxape.com>.
Hi there,

 

I disagree with your assessment of the problem. You haven't provided any
information that would clearly indicate to me that there's an issue with
Apache performance. I recommend looking at the application and database
first. Especially if, for example, things were fine last week but this week
there's a resource problem. That would indicate to me that you should
examine changes made to the application and database in the interim.

 

Sorry I can't help more but I think there's more analysis to do before we
can make a call on what the problem is much less offer advice on fixing it. 

 

 

Cheers,

 

Jeff

 

From: Kory Wheatley [mailto:wheakory@gmail.com] 
Sent: Wednesday, September 05, 2007 12:27 PM
To: users@httpd.apache.org
Subject: [users@httpd] CPU usage

 

Our apache server is utilizing the CPU to almost a 100% with 45 httpd
process opened.  What sort of tuning could be done to help this situation.


The Apache server is using Moodle, PHP, and Mysql.  The Apache server is on
a dedicated V440 with 4 processors and 16 gb of memory.  The Mysql database
is on a different system identical to the one explained, so it's not like
its on a system that can handle Apache 

I think it's an Apache tuning issue, but I'm not sure where to start.  I
thought about raising the number of startup server process.


Re: [users@httpd] CPU usage

Posted by Bazy <ba...@darkdawn.net>.
Kory Wheatley wrote:
> Our apache server is utilizing the CPU to almost a 100% with 45 httpd
> process opened.  What sort of tuning could be done to help this
> situation.  
> 
> The Apache server is using Moodle, PHP, and Mysql.  The Apache server is
> on a dedicated V440 with 4 processors and 16 gb of memory.  The Mysql
> database is on a different system identical to the one explained, so
> it's not like its on a system that can handle Apache
> 
> I think it's an Apache tuning issue, but I'm not sure where to start.  I
> thought about raising the number of startup server process.

PHP Tip: take a good look at http://eaccelerator.net  :)

Check if your kernel is compiled with "highmem" support... Personally, I
think that php eats a lot of your CPUs, since you use "moodle", and it
runs on php...


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org