You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by allan juul <al...@muly.dk> on 2005/08/26 01:28:19 UTC

[users@httpd] RewriteMap prg vs cgi performance

hello,

i'm in doubt whether to use a perl cgi script or a perl program via 
mod_rewrite because of performance.

the actual processing is handling a client certificate and some xml and 
returning a base64-encoded string. processing takes less than a second 
but let's say it takes exactly one second

if the site gets 10 simultaneously requests for a cgi it will start 10 
perl interpreters (i guess) and all requests should be handled within a 
second.

but what happens if the site gets 10 simultaneously requests for a URI 
that is handled by a perl program via mod_rewrite? like:

   RewriteMap prg:perl_program.pl

i know theres only one perl interpreter started at server startup and it 
listens on STDIN - but does that mean it will handle the 10 request one 
by one? i mean, in this example it would appear to take 10 seconds for 
the last request?

./allan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] RewriteMap prg vs cgi performance

Posted by Joshua Slive <js...@gmail.com>.
On 8/25/05, allan juul <al...@muly.dk> wrote:
> hello,
> 
> i'm in doubt whether to use a perl cgi script or a perl program via
> mod_rewrite because of performance.
> 
> the actual processing is handling a client certificate and some xml and
> returning a base64-encoded string. processing takes less than a second
> but let's say it takes exactly one second
> 
> if the site gets 10 simultaneously requests for a cgi it will start 10
> perl interpreters (i guess) and all requests should be handled within a
> second.
> 
> but what happens if the site gets 10 simultaneously requests for a URI
> that is handled by a perl program via mod_rewrite? like:
> 
>   RewriteMap prg:perl_program.pl
> 
> i know theres only one perl interpreter started at server startup and it
> listens on STDIN - but does that mean it will handle the 10 request one
> by one? i mean, in this example it would appear to take 10 seconds for
> the last request?

Yes.  The requests are serialized (see the RewriteLock directive).

CGI is the safer alternative because it runs as the less-priveleged
user and a problem in one request won't hurt another request.  It may
or may not be faster than the RewriteMap depending on exactly what
resources are acting as constraints.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org