httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] environment variables and CPU usage
Date Wed, 07 Dec 2005 19:04:16 GMT
On 12/7/05, Ryan Hansen <> wrote:
> To minimize impact and improve performance on dynamic, db-driven apps,
> the original developers designed the system to use Apache environment
> variables to store information that would otherwise have been stored in
> the database (file paths, file names, etc.).  To accomplish this, each
> Virtual Host has a separate associated include file that contains
> anywhere from 10 to X Apache environment variable declarations.  At
> first glance, this seems like a clever way to handle some of the dynamic
> data, but I've had my reservations about this method, not knowing what
> the long-term side-effects would be.

It is unclear exactly what you are talking about.  Some actual
configuration examples would be very helpful.

> I found one serious side-effect today: it seems that when you get to a
> certain number of vhosts (each with it's own set of env vars),
> restarting Apache takes up to 15 minutes to complete (on FC3, Dell
> PowerEdge Dual Pentium III 1Ghz with 1GB memory).  During restart, one
> of the two procs was spiked up to 99%, but the memory was relatively
> untouched.  Once Apache was finally running, the CPU spike dropped
> backed to normal.  This problem did not exist prior to adding a few very
> large web sites to the server recently.  Needless to say,  a 15+ minute
> restart time is unacceptable.
> So, my questions are the following:
> 1- Does someone with a much lower level understanding of Apache know if
> the envrionment variables could actually be the cause of this problem,
> or should I look elsewhere?  I'm not asking for a complete diagnostic
> evaluation, just a note to say whether or not I'm barking up the wrong tree.

Evaluating SetEnv directives should be quite fast.  If you have many
thousands of them it might start to slow things down, but I doubt it
explains a 15 minute start time.

> 2- If the environment variable situation is likely the core of the
> problem (as I believe), can someone give a more specific explanation as
> to why, so I can convince the designers of this system that it's a
> "less-effective" design?

You need to give a more specific example as I mentioned above.

I suggest starting "httpd -X" under strace or a debugger to see what
it is actually doing for all that time.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message