perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fagyal Csongor <>
Subject Re: Apache::ASP with Worker MPM
Date Tue, 05 Dec 2006 14:38:03 GMT
Tom Haapanen wrote:

> On 2006-12-05 08:15, Fagyal Csongor wrote:
>> Usually a webpage (at least in our case) consists of the main .asp 
>> (.pet, etc.) file plus the additional stuff, like .js, .css and image 
>> files. The ration is usually around 1:10 (of course that can vary a 
>> lot). It is a huge benefit that these hits do not hit the heavyweight 
>> mod_perl server. Also, the front proxy server can have keepalive 
>> switched on, runs threaded, very lightweight, only using small memory 
>> footprint as compared to the huge mod_perl server.
>> Also keep in mind that you will end up having a lot of mod_perl-ed 
>> Apache instances running unnecessarily because of (realtively) slow 
>> clients, which keep your Apache waiting. Again, this is a typicla 
>> reverse proxy configuration.
>> Before we started to use this config, we always had memory problems, 
>> having 200+ Apache instances running, which is an overkill. Now we 
>> can serve dynamic hits with only 30 Apache1.3 instances, while having 
>> somewhere around 400 Apache2.0 available connections.
> You are starting to convince me.  : )

I hardly know anyone who did *not* have this problem :)

> Now there is some static content that I want to control access to -- 
> but I presume that I can do that in the Apache2 front end, passing 
> those requests to Apache1.3?

If you use .htaccess, Apache2 could server as an authenticator. If you 
server the content via Apache1, just proxy the request, there is an 
indirect performance gain there, too.

> The 15:1 connection:Apache1.3 process ratio is certainly very 
> attractive.  How many threads per process are you running on the 
> Apache2 front end?

Right now this is what I have (for Apache2):

<IfModule worker.c>
StartServers         2
MaxClients         200
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  5000

And here is another one, more tweaked, higher load, lots of requests:
<IfModule worker.c>
ServerLimit     25
StartServers         2
ThreadsPerChild    64
MaxClients         1600
ThreadLimit        100
MinSpareThreads     25
MaxSpareThreads    100
MaxRequestsPerChild  5000

SendBufferSize 32768


>> Even though I do not know your application, I am pretty sure this 
>> would be a possible alternative for you.
>> See this:
>> There are many white pages and how-to-s on this subject around. I can 
>> also give you an example httpd.conf snippet if you are interested.
> I'll do some reading, but sample reverse proxy httpd.conf would be 
> much appreciated -- thanks.

The good thing is you can try this easily before you switch to the new config.

Just set up Apache2 on a random port, like 12345, set the proxy to the regular site, and try
the site through the new proxy-ed. If it works, you can move the backend to, say, 8080, and
Apache2 to the regular 80 http port. That's something like a 30 seconds of downtime, and all
works afterwards.

For me, httpd-13.conf is just the usual Apache::ASP config - the server is on port 8080.
The front httpd-20.conf is something like this:

DocumentRoot ...
ServerAlias ...
CustomLog ...
ErrorLog ...

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} ^.*\.asp$ [OR]
RewriteCond %{REQUEST_URI} ^.*\/$
RewriteRule ^/(.*)$ http://%{HTTP_HOST}:8080/$1 [proxy]

This is far from perfect, but it works for me.

If you use KeepAlive, set a low value, even as low as 2.

- Fagzal

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message