Quote:>Does anybody know how many non-ip based virtual hosts I can support with
>Apache 1.3.3 using Solaris 2.6. I've got a whole bunch of RAM (1gig). Is
>there are rule of thumb I can use to come up with a sane maximum number?
You can support 59840 vhosts. In reality, the number varies a lot
and there is no way to give a hard number. With Solaris with many
vhosts, you will need lots of swap because Solaris won't overcommit
swap so you end up reserving but never allocating or using a lot
of swap. Apache doesn't have any limits, although there is some
O(n) code there in the number of vhosts. Using IP based vhosts, Apache
can keep the vhosts in a hash table and make it more efficient, but
it can't do that with name based vhosts.
As always, when having a large number of vhosts avoid having a large
number of config directives that are inherited from the main server
by each vhost when you don't really want them to apply there; eg.
if you have 10000 Alias directives for various directories in the
main server, then they would by default be inherited by each vhost
config and eat a lot of memory. To avoid that, put the main server in
a vhost itself.
However, if you are just using simple vhosts then a better solution would
be to use mod_rewrite and not use real vhosts at all, then you can scale
forever. See http://www.apache.org/docs/vhosts/mass.html for details.
(haven't read the above document yet, so I can't say if it is
good or not, but concept discussed works fine in many situations)