httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] Thousands of VirtualHosts slowing down start/stop/graceful
Date Wed, 21 Jun 2006 13:22:10 GMT
On 6/21/06, jome <jome@emoj.net> wrote:
> Joshua Slive wrote:
> > On 6/20/06, jome <jome@emoj.net> wrote:
> >
> >> I have tried to locate the error but all I can come up with is that it
> >> is related to the large configuration (roughly 700k) file or the
> >> contents of it. An idea might be that the DocumentRoot checks are taking
> >> a lot of time, but I'm not familiar enough with neither Apache nor Mac
> >> OS X to determine if that's the case. Another idea is that the delay is
> >> caused by the fact that a lot more memory[3] has to be freed/allocated
> >> when Apache is stopped and started with a large configuration file.
> >>
> >> I am aware that this might be possible to avoid using the "mass"
> >> instructions for VirtualHosts but if there's a way to stick with what I
> >> have today I'd prefer that.
> >
> > I'm not sure exactly what you want to know.  Yes, this problem is
> > almost certainly due to needing to read and process a huge config file
> > and check all the document roots.  Yes, your config looks like it is a
> > perfect use case for mod_vhost_alias.
>
> I forgot to say that in a previous install on the same machine with
> Apache 1.3.x, the webserver restarted in a matter of seconds and
> rendered no downtime (and that was with roughly 2800 VirtualHosts). I'm
> still puzzled that there's downtime with graceful as it is my
> understanding that new processes are supposedly spawned as the existing
> ones are dying.
>
> I guess basically my question is, can I optimize this somehow (remove
> unnecessary checks etc)? I personally can't see how processing a 800k
> file - even with checking 2000 paths - can be taking so long on this
> machine.

My understanding (which may not be prefectly accurate) is that in a
graceful restart, the old processes immediately stop accepting new
connections and the new processes begin to start up.  Normally, they
would start up fast enough that new connections would be held in the
listen queue and then answered.  But if the restart takes long enough,
I suppose connections could time out in the listen queue.

If restarts are taking this long, I assume that initial startup also
takes a long time?

If so, run an "apachectl -X" under strace (errr... I guess "ktrace" on
osx) and see what syscalls apache is doing that are causing the delay.

Joshua.

---------------------------------------------------------------------
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


Mime
View raw message