httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Folini <>
Subject Re: [users@httpd] 301 Redirects
Date Mon, 26 Nov 2007 13:52:18 GMT
On Mon, Nov 26, 2007 at 08:25:40AM -0500, Grant Peel wrote:
> I have a client for whom I have added about 500 301 redirects in thier 
> VirtualHost container. The server has about 200 VirtualHosts total.
> What kind of performance issues would one think all those redirects have on 
> the whole (Apache) server?

apache bench (ab) would tell you.

Otherwise: Think about what is happening on the network level and
within your server.

For every request, the processing process/thread iterates over up
to 500 rules. Sometimes it issues a redirect status code back to
the client who in turn issues a new request.

It is fairly easy to show, that the redirect itself is expensive
when compared to the 500 rules. At least for the individual client.
It's a bit different for the server.

It is also fairly simple to understand, that you can optimise
the order of the rules. Ideally, you decide on the first
line, that either _no_ rule will apply or _one of those 500 rules_
will apply. That way you can branch and do not affect the server
very much and do not have requests, that run over 500 rules
and not a single one applies. 

In the end it boils down to testing in the real world with your
real application.

As a sidenote: If you run ssl, then rewrite rules hardly matter
at all, as the ssl-handshake takes ages compared to a rewrite

just my 2 cents,


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message