You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tony Finch <fa...@demon.net> on 1999/06/10 18:00:46 UTC

[PATCH] updated mass virtual hosting stuff

The changes from my original patch set are as follows:

(1) Updated mass.html. Bigger! More shiny!
(2) Updated UCN docco in core.html
(3) Added a link to mod_vhost_alias.html to mod/index.html
	(this assumes the next release is 1.3.7)
(4) Added mod_vhost_alias to Configuration.tmpl

I hope that covers everything. Apologies for the two different diff formats.

Tony.
-- 
f.a.n.finch   dot@dotat.at   fanf@demon.net
Winner, International Obfuscated C Code Competition 1998



RE: standard virtual hosting.. how good?

Posted by David Harris <dh...@drh.net>.
Ahh.. thank you. This makes sense: that if you can assure yourself with your
auto-configuration-whatever that all the DocumentRoots really will exist,
there's little reason to have Apache check again for you.

Can we get this in the next release, please? (I see Jim just started that
process...)

 - David Harris
   Principal Engineer, DRH Internet Services


-----Original Message-----
From:	new-httpd-owner@apache.org [mailto:new-httpd-owner@apache.org] On
Behalf Of Mathijs Maassen
Sent:	Friday, June 11, 1999 8:51 AM
To:	new-httpd@apache.org
Subject:	Re: standard virtual hosting.. how good?

 << File: apache_1.3.6-documentrootcheck.diff >> On Fri, Jun 11, 1999 at
01:06:10PM +0100, Tony Finch wrote:
> We have some machines with about 1000 <VirtualHost> configuration
> sections and one of the problems it the time it takes to parse the
> configuration file (but that's an old version of Apache & newer ones

We had the same problem. Apache does a stat() on the DocumentRoot of all
vhosts. And that slows things down a bit if you have lots of vhosts. The
attached patch adds a DocumentrootCheck config option, which enables you to
turn this behaviour off. The startuptime on one of our webservers, with 4000
vhosts, dropped from 3 minutes minutes to 2 seconds.

Mathijs

--
/* Mathijs Maassen <ma...@xs4all.nl> */ main()??<long x,y??(??)
=??<0xEE4A4AA,0x8A4A4AA,0xE84E4EE,0x284A4AE,0xE84AEEA??>,z=5;for(
;z--;)for(x=1;x<<=1;)putchar(x*2?y??(z??)&x?'??=':' ':'??/n');??>


Re: standard virtual hosting.. how good?

Posted by Mathijs Maassen <ma...@xs4all.nl>.
On Fri, Jun 11, 1999 at 01:06:10PM +0100, Tony Finch wrote:
> We have some machines with about 1000 <VirtualHost> configuration
> sections and one of the problems it the time it takes to parse the
> configuration file (but that's an old version of Apache & newer ones

We had the same problem. Apache does a stat() on the DocumentRoot of all
vhosts. And that slows things down a bit if you have lots of vhosts. The
attached patch adds a DocumentrootCheck config option, which enables you to
turn this behaviour off. The startuptime on one of our webservers, with 4000
vhosts, dropped from 3 minutes minutes to 2 seconds.

Mathijs

-- 
/* Mathijs Maassen <ma...@xs4all.nl> */ main()??<long x,y??(??)
=??<0xEE4A4AA,0x8A4A4AA,0xE84E4EE,0x284A4AE,0xE84AEEA??>,z=5;for(
;z--;)for(x=1;x<<=1;)putchar(x*2?y??(z??)&x?'??=':' ':'??/n');??>

RE: standard virtual hosting.. how good?

Posted by David Harris <dh...@drh.net>.
Tony Finch wrote:
> IP-based vhosts are looked up with a hash; Host:-header vhosts are
> looked up linearly.
>
> We have some machines with about 1000 <VirtualHost> configuration
> sections and one of the problems it the time it takes to parse the
> configuration file (but that's an old version of Apache & newer ones
> may be better). The other problem with using <VirtualHost> in our
> environment is the number of changes we get: with the mass vhosting
> stuff we can provision sites almost immediately without disrupting
> Apache.

I see your point about Apache parsing the configuration - I would really
hate to have a server that took, say, twenty seconds to start. But if you
gracefully restart a server that takes this long to parse configuration, is
there be any downtime while the parent parses the configuration, or does it
continue to hand requests out to the (soon to be) previous generation of
children while parsing?

I have my own "magic" vhosting setup that I'm just about to take live on
some new larger server where I just automatically write out all my
configuration, including a whole bunch of <VirtualHost> sections... one for
each domain. I don't want to change the right now setup, so if I run into
any problems I guess I can just run multiple Apache severs per box. But
that's annoying.

But I'm still very interested in this setup. I really like not having to HUP
apache for each new account.

 - David Harris
   Principal Engineer, DRH Internet Services



Re: standard virtual hosting.. how good?

Posted by Tony Finch <do...@dotat.at>.
"David Harris" <dh...@drh.net> wrote:
>
>Okey dokey. I read the mass virtual hosting documentation and I understand
>what's going on. My question now is, how good is the standard virtual
>hosting?
>
>Is the lookup from ipaddr (or name) to virtual host configuration handled
>internally in some way that does not bog down if I throw, say, five hundred
>virtual hosts or a thousand at it? I guess that's basically asking if the
>lookup is hashed. Another consideration might be the size of the internal
>configuration structures in apache.

IP-based vhosts are looked up with a hash; Host:-header vhosts are
looked up linearly.

We have some machines with about 1000 <VirtualHost> configuration
sections and one of the problems it the time it takes to parse the
configuration file (but that's an old version of Apache & newer ones
may be better). The other problem with using <VirtualHost> in our
environment is the number of changes we get: with the mass vhosting
stuff we can provision sites almost immediately without disrupting
Apache.

Tony.
-- 
f.a.n.finch   dot@dotat.at   fanf@demon.net
Winner, International Obfuscated C Code Competition 1998

standard virtual hosting.. how good?

Posted by David Harris <dh...@drh.net>.
Okey dokey. I read the mass virtual hosting documentation and I understand
what's going on. My question now is, how good is the standard virtual
hosting?

Is the lookup from ipaddr (or name) to virtual host configuration handled
internally in some way that does not bog down if I throw, say, five hundred
virtual hosts or a thousand at it? I guess that's basically asking if the
lookup is hashed. Another consideration might be the size of the internal
configuration structures in apache.

I guess another concern is file descriptors for the logging, but I can
handle that by having everyone log to the same file and splitting from
there... that's a standard trick.

Anyone have experience with running mass standard virtual hosting?

 - David Harris
   Principal Engineer, DRH Internet Services