Mailing List Archive

Apache::ASP with Worker MPM
I'm new to this mailing list (but not new to Apache::ASP), and I'm
wondering whether anyone is running Apache::ASP in production with the
Worker MPM on Apache 2.x. I searched the list archives but to no avail.

We have been running Apache::ASP for over five years, and our site
(www.motorsport.com) currently handles some 10M page views per month
with Apache::ASP and MySQL -- not the heaviest traffic on the net, for
sure, but quite respectable, I think.

We are still running Apache 1.3, though, and that means one process per
connection. With 30 MB per process, we use up 4 GB of physical memory
pretty quickly with 100 or so active connections, not a really effective
use of memory in my opinion.

So as I build the next server, I'm interested in moving to Apache 2.x,
mod_perl 2.0 and Worker MPM. But will it work? I remember messing
around with mod_perl 1.9 last time around, and I recall that I could not
get things to work quite right. I may have done things wrong, or it may
just not have been ready for prime time.


Now Apache is up to 2.2 and mod_perl 2.0 is released, and these sound
good. But how well does Apache::ASP work in a multithreaded MPM
environment? I see that version 2.59 is still the current one -- is
that a good sign that it will do all I need, or does it mean that there
will be no more development?

Many thanks in advance for any insight anyone can offer ...

Tom
tomh@motorsport.com

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Apache::ASP with Worker MPM [ In reply to ]
Tom Haapanen wrote:

> I'm new to this mailing list (but not new to Apache::ASP), and I'm
> wondering whether anyone is running Apache::ASP in production with the
> Worker MPM on Apache 2.x. I searched the list archives but to no avail.
>
> We have been running Apache::ASP for over five years, and our site
> (www.motorsport.com) currently handles some 10M page views per month
> with Apache::ASP and MySQL -- not the heaviest traffic on the net, for
> sure, but quite respectable, I think.
>
> We are still running Apache 1.3, though, and that means one process
> per connection. With 30 MB per process, we use up 4 GB of physical
> memory pretty quickly with 100 or so active connections, not a really
> effective use of memory in my opinion.
>
> So as I build the next server, I'm interested in moving to Apache 2.x,
> mod_perl 2.0 and Worker MPM. But will it work? I remember messing
> around with mod_perl 1.9 last time around, and I recall that I could
> not get things to work quite right. I may have done things wrong, or
> it may just not have been ready for prime time.
>
>
> Now Apache is up to 2.2 and mod_perl 2.0 is released, and these sound
> good. But how well does Apache::ASP work in a multithreaded MPM
> environment? I see that version 2.59 is still the current one -- is
> that a good sign that it will do all I need, or does it mean that
> there will be no more development?
>
> Many thanks in advance for any insight anyone can offer ...

What I have been running lately is an Apache2.2 with the worker MPM as a proxy, and a good-old Apache1.3 with mod_perl+Apache::ASP as the "real" server. The mod_perl server serves the dynamic ASP pages, while the front servert the static content. This is a very typical configuration IMHO.

I could once (something like two years ago?) make Apache::ASP run with Apache 2.0, but that was a long time ago... since then, I stick to the above config - which I recommend to you if you do not want to waste too much time on figuring out all the stuff about Apache2.x and mod_perl (even though it shouldn't be too hard).

For the record: we do somewhere around 6M-8M pageviews per month (see http://www.kepeslap.com at http://www.apache-asp.org/sites.html), which peeks to approx. 500-700k pageviews per day in busy periods. This is a 1.8Ghz Core2 with 3G RAM, in a shared environment (with two other rather busy sites running on the same server). CPU utilization reaches 50% of all available CPU time, tops (I guess half of that is coming from the ASP site).


Hope this helps.

- Fagzal



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Apache::ASP with Worker MPM [ In reply to ]
On 2006-12-05 06:47, Fagyal Csongor wrote:
> What I have been running lately is an Apache2.2 with the worker MPM as
> a proxy, and a good-old Apache1.3 with mod_perl+Apache::ASP as the
> "real" server. The mod_perl server serves the dynamic ASP pages, while
> the front servert the static content. This is a very typical
> configuration IMHO.
>
> I could once (something like two years ago?) make Apache::ASP run with
> Apache 2.0, but that was a long time ago... since then, I stick to the
> above config - which I recommend to you if you do not want to waste
> too much time on figuring out all the stuff about Apache2.x and
> mod_perl (even though it shouldn't be too hard).
> For the record: we do somewhere around 6M-8M pageviews per month (see
> http://www.kepeslap.com at http://www.apache-asp.org/sites.html),
> which peeks to approx. 500-700k pageviews per day in busy periods.
> This is a 1.8Ghz Core2 with 3G RAM, in a shared environment (with two
> other rather busy sites running on the same server). CPU utilization
> reaches 50% of all available CPU time, tops (I guess half of that is
> coming from the ASP site).

Thanks ... it sounds like your config works well for you. However,
since 95% of our page views are dynamic, I'm not sure it would gain
much. The only thing I can think of there is serving all the images off
Apache 1.3.

Our CPU load isn't too bad (dual Opteron 242 currently) since the
database is on a separate server, but there are still times that the
number of httpd processes are maxed out and the browser has to wait for
a connection. So the new hardware will be dual Opteron 270s (dual core)
so I have no worries about CPU load -- I'd just rather run 4-6GB rather
than 8-10GB of RAM.

But maybe the images on a separate server process are the answer ...
there are close to 10x as many requests for images as for pages. Mostly
small GIFs but also a lot of larger JPEGs. Need to give this idea some
thought as an alternative. Thanks!

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Apache::ASP with Worker MPM [ In reply to ]
Tom Haapanen wrote:

> On 2006-12-05 06:47, Fagyal Csongor wrote:
>
>> What I have been running lately is an Apache2.2 with the worker MPM
>> as a proxy, and a good-old Apache1.3 with mod_perl+Apache::ASP as
>> the "real" server. The mod_perl server serves the dynamic ASP pages,
>> while the front servert the static content. This is a very typical
>> configuration IMHO.
>>
>> I could once (something like two years ago?) make Apache::ASP run
>> with Apache 2.0, but that was a long time ago... since then, I stick
>> to the above config - which I recommend to you if you do not want to
>> waste too much time on figuring out all the stuff about Apache2.x and
>> mod_perl (even though it shouldn't be too hard).
>> For the record: we do somewhere around 6M-8M pageviews per month (see
>> http://www.kepeslap.com at http://www.apache-asp.org/sites.html),
>> which peeks to approx. 500-700k pageviews per day in busy periods.
>> This is a 1.8Ghz Core2 with 3G RAM, in a shared environment (with two
>> other rather busy sites running on the same server). CPU utilization
>> reaches 50% of all available CPU time, tops (I guess half of that is
>> coming from the ASP site).
>
>
> Thanks ... it sounds like your config works well for you. However,
> since 95% of our page views are dynamic, I'm not sure it would gain
> much. The only thing I can think of there is serving all the images
> off Apache 1.3.

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.

I also have another website running on a dual 2.4GHz Xeon, in a similar
config, with 4G RAM - that handles 2M pageviews per day (that is over
20M HTTP requests).
This results in 2000+ active connections at peek to the front server,
while we only have somewhere around 120 instances of the backen server
running.

> Our CPU load isn't too bad (dual Opteron 242 currently) since the
> database is on a separate server, but there are still times that the
> number of httpd processes are maxed out and the browser has to wait
> for a connection. So the new hardware will be dual Opteron 270s (dual
> core) so I have no worries about CPU load -- I'd just rather run 4-6GB
> rather than 8-10GB of RAM.

Well, see above :)
You can easily decrease the number of instances needed if you make your
incoming connections independent of the speed of the remote client.

Just take a look at your /server-status/. Especially if you have big
files to serve, you will see connections lingering there. That is what
eats up your resources.

> But maybe the images on a separate server process are the answer ...
> there are close to 10x as many requests for images as for pages.
> Mostly small GIFs but also a lot of larger JPEGs. Need to give this
> idea some thought as an alternative. Thanks!

Even though I do not know your application, I am pretty sure this would be a possible alternative for you.

See this:
http://en.wikipedia.org/wiki/Reverse_proxy

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.

- Fagzal


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Apache::ASP with Worker MPM [ In reply to ]
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. : )

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?

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?

> Even though I do not know your application, I am pretty sure this
> would be a possible alternative for you.
>
> See this:
> http://en.wikipedia.org/wiki/Reverse_proxy
>
> 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.

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Apache::ASP with Worker MPM [ In reply to ]
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
</IfModule>

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

</IfModule>

>
>> Even though I do not know your application, I am pretty sure this
>> would be a possible alternative for you.
>>
>> See this:
>> http://en.wikipedia.org/wiki/Reverse_proxy
>>
>> 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:


<VirtualHost www.example.com:80>
DocumentRoot ...
ServerName www.example.com
ServerAlias ...
CustomLog ...
ErrorLog ...

RewriteEngine On

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

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: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Apache::ASP with Worker MPM [ In reply to ]
On 2006-12-05 09:38, Fagyal Csongor wrote:
> 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.

I need to do database-driven authentication so .htaccess won't cut it,
but I think I can just pass those requests along (I can match by URL).

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

Any reason why I shouldn't have Apache 1.3 listen only on 127.0.0.1?
That way I could prevent a bypass of the reverse proxy.

Thanks for the samples ... have set up an extra IP address for the
reverse proxy (on the current server) for now and will do some experiments.

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org