You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Sam Carleton <sc...@miltonstreet.com> on 2008/03/28 20:14:27 UTC

apache running slow in production

Folks,

Part of my web application contains an Apache C Module, mostly it is a
handler to control access and to serve up images, but another part of
it does access a SQLite database, which isn't called a whole lot.  On
my development machine which is a 2.8GHz P IV, the module serves up 12
images very quickly.  One of my customers is reporting that it is
taking 45 seconds on a Duo Core 1.8GHz machine!  If is wasn't for the
fact that my customer is 15 hours away, I would go check it out in
person.  Such as life.

Does anyone have any thoughts on how I can trouble shoot this
remotely?  I can compile and send new code to the customer, I just
don't know exactly what I might do to collect data.

Sam

Re: [MODULES]apache running slow in production

Posted by Sam Carleton <sc...@miltonstreet.com>.
I would like to thank one and all for your help.  I took Ray's advise
and created a basic timing class (my code is C++) that captured elapse
time and put that around all the main calls in my code and found the
bug.  It was something REALLY stupid on my part, isn't always;)

Again, thanks you all for your help!

Sam

Re: [MODULES]apache running slow in production

Posted by Ray Morris <su...@bettercgi.com>.
   I'm sure there's a better way to do it, but I'd add
a "Debug" directive for the module, then throw in some 
error log calls recording time() if debug is set.  Then 
you know which part of the code is taking a long time.
Something very roughly like:

if (cfg->debug) {
   ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, 
                 "time is %i", (int) time());
}
--
Ray B. Morris
support@bettercgi.com

Strongbox - The next generation in site security:


On 03/28/2008 02:50:48 PM, Michael Thomas wrote:
> Sam Carleton wrote:
> > Folks,
> >
> > Part of my web application contains an Apache C Module, mostly it 
> is
> a
> > handler to control access and to serve up images, but another part
> of
> > it does access a SQLite database, which isn't called a whole lot. 
> On
> > my development machine which is a 2.8GHz P IV, the module serves up
> 12
> > images very quickly.  One of my customers is reporting that it is
> > taking 45 seconds on a Duo Core 1.8GHz machine!  If is wasn't for
> the
> > fact that my customer is 15 hours away, I would go check it out in
> > person.  Such as life.
> >
> > Does anyone have any thoughts on how I can trouble shoot this
> > remotely?  I can compile and send new code to the customer, I just
> > don't know exactly what I might do to collect data.
> >   
> 
> Get them to look at what memory/cpu allocation running at on their
> box? 
> Can they run a test from the box itself (ie. eliminate the network as
> a 
> possibility)
> > Sam
> >   
> 
> 



Re: [MODULES]apache running slow in production

Posted by Sam Carleton <sc...@miltonstreet.com>.
On Fri, Mar 28, 2008 at 5:38 PM, Joel Westerberg <tu...@well.com> wrote:
> I would suggest running strace or ptrace on it during that request.

Opps, I forgot to mention that it is running on Windows.

Re: [MODULES]apache running slow in production

Posted by Joel Westerberg <tu...@well.com>.
I would suggest running strace or ptrace on it during that request.


On Mar 28, 2008, at 21:32 , Sam Carleton wrote:

> On Fri, Mar 28, 2008 at 3:50 PM, Michael Thomas  
> <ml...@bigrideau.com> wrote:
>>
>> Get them to look at what memory/cpu allocation running at on their  
>> box?
>> Can they run a test from the box itself (ie. eliminate the network  
>> as a
>> possibility)
>
> Good questions.  Already checked both: while Apache is serving up the
> 12 images, the CPU is at 100%, when it is done, the cpu goes right
> back down, even when hitting it from the server.
>
> Sam
>


Re: [MODULES]apache running slow in production

Posted by Sam Carleton <sc...@miltonstreet.com>.
On Fri, Mar 28, 2008 at 3:50 PM, Michael Thomas <ml...@bigrideau.com> wrote:
>
>  Get them to look at what memory/cpu allocation running at on their box?
>  Can they run a test from the box itself (ie. eliminate the network as a
>  possibility)

Good questions.  Already checked both: while Apache is serving up the
12 images, the CPU is at 100%, when it is done, the cpu goes right
back down, even when hitting it from the server.

Sam

Re: [MODULES]apache running slow in production

Posted by Michael Thomas <ml...@bigrideau.com>.
Sam Carleton wrote:
> Folks,
>
> Part of my web application contains an Apache C Module, mostly it is a
> handler to control access and to serve up images, but another part of
> it does access a SQLite database, which isn't called a whole lot.  On
> my development machine which is a 2.8GHz P IV, the module serves up 12
> images very quickly.  One of my customers is reporting that it is
> taking 45 seconds on a Duo Core 1.8GHz machine!  If is wasn't for the
> fact that my customer is 15 hours away, I would go check it out in
> person.  Such as life.
>
> Does anyone have any thoughts on how I can trouble shoot this
> remotely?  I can compile and send new code to the customer, I just
> don't know exactly what I might do to collect data.
>   

Get them to look at what memory/cpu allocation running at on their box? 
Can they run a test from the box itself (ie. eliminate the network as a 
possibility)
> Sam
>