Apache under Windows Page 2

By Rich Bowen (Send Email)
Posted Jan 17, 2001


Back in December, 1999, I did some of my own testing. I was running Apache and IIS on the same server, for a number of reasons that I won't go into here. So, the hardware is identical, and the server load is identical. I did some benchmarking on a day immediately after Christmas, when hardly anyone was in the office -- this is an internal server -- so server load was not a factor. And I did the tests over a 100MB switched network, so network latency was not really an issue either. But, regardless of that, conditions were identical for each HTTP server.

Using a simple Perl program, I tested performance on the two servers. First, I just fetched a 1K HTML document. Next, I got a simple ''hello world'' Perl CGI program, to test CGI performance. The results were pleasing:


        D:\Apachecon>perl benchmark.pl
        GET
        Benchmark: timing 2000 iterations of Apache, IIS...
            Apache: 34 wallclock secs ( 6.71 usr +  4.42 sys = 11.13 CPU)
               IIS: 31 wallclock secs ( 6.75 usr +  4.41 sys = 11.16 CPU)
        CGI
        Benchmark: timing 2000 iterations of Apache, IIS...
            Apache: 62 wallclock secs ( 6.16 usr +  4.13 sys = 10.28 CPU)
               IIS: 65 wallclock secs ( 6.31 usr +  4.02 sys = 10.33 CPU)
        D:\Apachecon>perl benchmark.pl
        GET
        Benchmark: timing 2000 iterations of Apache, IIS...
            Apache: 34 wallclock secs ( 6.50 usr +  4.55 sys = 11.05 CPU)
               IIS: 31 wallclock secs ( 6.65 usr +  4.43 sys = 11.08 CPU)
        CGI
        Benchmark: timing 2000 iterations of Apache, IIS...
            Apache: 63 wallclock secs ( 5.73 usr +  3.82 sys =  9.54 CPU)
               IIS: 64 wallclock secs ( 6.15 usr +  3.97 sys = 10.12 CPU)

If you're not familiar with the way that the Perl Benchmark module does things, what those results mean is that Apache consistently outperformed IIS on the two simplest things that a web server does - serving HTML pages, and executing CGI programs. Yes, I ran more than just the two tests. These are just sample results. And clearly, a .03 second difference over 2000 iterations is not a huge difference, but it was gratifying to see that Apache consistently came out ahead.

In case you'd like to repeat the tests for yourself, here's the code that I used:

        use Benchmark;
        use LWP::Simple;
        print "GET\n\n";
        timethese(2000, {
                'Apache' => 'get ("http://9.95.144.25/test.txt";)',
                'IIS' => 'get ("http://9.95.144.25:90/test.txt";)',
        });
        print "CGI\n\n";
        timethese(2000, {

                'Apache' => 'get ("http://9.95.144.25/cgi-bin/test.pl";)',
                'IIS' => 'get ("http://9.95.144.25:90/scripts/test.pl";)',
        });

Now, IIS advocates will say that CGI is not the way that you are supposed to do things on IIS. As of this writing, I don't yet know how to do stuff in ASP, so I can't say how it compares to mod_perl. However, the Microsoft claim has always been that IIS is substantially faster than Apache, and yet it can't even serve a HTML document faster, on its own native platform.

So, while it is certainly true that Apache performs better on Unix than on NT, it is no slouch on NT, and compares very well to its competition.

Yet Another Disclaimer



Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.