You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tony Sanders <sa...@bsdi.com> on 1996/06/15 19:39:05 UTC

mod_fastcgi.c gives poor performance (worse than plain CGI)

A person here at BSDI doing some web benchmarks noted that mod_fastcgi.c
performance was poor.  Here is the information he sent to me to forward
to the group.

------

Here is the short scoop on the poor FastCGI performance I've observed.

     OS - BSD/OS 2.1 with all patches + unreleased mods to TCP/IP code
 Server - Apache 1.1 beta 3
FastCGI - mod_fastcgi.c (dated 10 May 1996 + patches for 1.1 from
          Ralf Engelschall dated 12 May 1996).  FastCGI development
          kit version 1.4.

Performance was tested using WebStone 1.1 and a trivially modified
version of cgi-send.c (just added your basic FastCGI loop).

With the above configuration FastCGI performance is worse than CGI
performance (less than 5 connections per second on a 133 MHz Pentium)
and the machine is observed to be handling in the order of 45,000
system calls per second.  A ktrace shows repeated calls to select()
returning 0 while processing the FastCGI request (over 3000 calls
while handling 5 requests for 10 K of data).  It looks like this is
happening when writing to the client.

For comparison I tested with Open Market's server and got quite
reasonable performance (90+ connections per second, 3 to 4,000 system
calls per second).  I used the same FastCGI program when testing both
servers.

A quick look at mod_fastcgi.c finds a single select called with a
timeout of 0.  I bumped this up to 10 usec and things are *much*
better, down to around 10,000 system calls per second and doing 65
requests per second.