mod_perl and mass virtual hosting

Joshua Johnson <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
Hello all,

I have a question on using mod_perl to configure apache for many virtual
hosts. My problem is the high load on the apache server. I decided to go
with mod_perl to configure apache and here are the reasons (if I should be
doing this a different way, please say so. I'm open to suggestions).:

The company I work at has ~13,000 customer domains. There is a database
where these domains are configured. Some of them are "standard" packages and
simply have a document root where customers upload pages. Some of the
domains make proxy requests to another site. And still others make a proxied
rewrite from "/" to "some random url that is stored in the db". Some
redirect to another url. There are about 20 other such configurations.

I used mod_perl to load all of this up at startup and it worked beautifully.
I originally thought that I would be able to dynamically setup VirtuaHost
sections as requests came in for domains (maybe they were freshly added to
the db or the record updated). But I found you can't really do that so I
have to restart for changes to take effect. Either way, I'm very happy with
how easy and clean mod_perl has made all of this.

But the load on apache runs anywhere from 0.50 to 3.00 on a dual cpu server.
Response doesn't seem slow (except for right after an apache restart) but
I'm worried that I'm doing something fundamentally wrong. There is a
significant amount of proxying going on so I set "ProxyReceiveBufferSize
16384" but that doesn't seem to have changed too much. Could mod_perl be the
cause of the load or would it be the end apache config? Are there any
initial thoughts anyone has? Has anyone run into something similar? Should I
be going about this a different way?

Related: and would it be possible to add config on-the-fly? $r->add_config()
Won't let you add VirtualHosts because it operates as though in a <Location>
directive.

I guess I'm just looking for thoughts in general. I've been tinkering with
this for about 2 weeks now.

Thanks,
Josh J
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.