by July 4, 2009 0 comments

AIn the last issue we discussed how PHP performed on various platforms. And
based on our findings we plotted a graph which showed that Linux with Apache was
the best choice. But we also noticed that if the number of the executions is
increased than the difference between the time taken by both Linux and Windows
servers decreases. So this time, we increased the number of executions from 4000
to 5000 and even 6000 to check the effect. The setup used is exactly the same as
that used for previous trials.

Direct Hit!

Applies To: PHP developers
USP: Understand how well PHP works on
different platforms
Primary Link:

PHP, IIS, Apache

We used a dual boot machine of Windows and Linux. This made sure that the
machine wasn’t just identical but actually the same in both cases so that there
was no chance of getting any performance difference due to hardware issues. Just
to reiterate, we used a Core2 Duo machine with 2 GB RAM.

We installed Fedora 10 64-bit and Windows Server 2008 Datacenter Edition. The
Linux machine had Apache 2.2 and PHP 5.2 installed on it. And on the Windows
machine we installed IIS 7 with FastCGI enabled and then installed PHP 5.2.9
(the latest release today) on the same machine. The OSes and the web servers
were kept in their default state and no optimization was done so we could
compare the raw performance of all servers with default settings. We also used
32-bit version of Fedora 10 to compare the performance difference.

The above graph shows the
average executions per second for Linux and Windows 64-bit, after we have
increased the load on both the operating systems.
The time taken by both Windows
and Linux 64-bit to execute the PHP-based program. The time taken increases
as the number of executions are increased.

Results were clearly visible in the previous issue that PHP on Linux with Apache
performed better than PHP on Windows with IIS. But if we look closer to the
results than one can figure out that the graphs tend to touch each other, hence
we carried our test from the point we left in the previous issue and increased
the number of executions to 18,000. We took the readings and plotted them in a
graph. The data we plotted in the graph was executions per second, ie the total
number of executions divided by time taken. Based on the previous issue results,
we thought that the lines would intersect but surprisingly that was not the
case. The lines do not intersect with each other even at 18,000 executions. For
both, the execution graphs were parallel and from our findings we believe the
lines will never intersect; but yes, the execution time will become less as the
number of executions increase. We have also plotted the graph for total time
taken to execute the program and found that as the total number of executions is
increased the total time taken by both the OSes increases. This makes Linux
64-bit better over Windows 64-bit.We are in the process of continuously testing
this out and you can find the updated results on

This graph shows the difference
in performance of PHP-based program on Linux 32-bit and Linux 64-bit. Linux
64-bit is of course better.
Surprisingly, compared to
Windows 64-bit, the performance of the PHP-based program on Linux 32-bit, on
the same configuration, is better.

We have also tested Linux 32-bit for upto 14,000 executions just to see the
difference in performance as compared Linux 64-bit and Windows 64-bit. Yes, the
performance was low compared to Linux 64-bit but compared to Windows 64-bit the
performance was surprisingly better. We have also plotted a graph for this which
gives you a better idea. To provide a better picture we have plotted two
different graphs which show the difference in performance between PHP on Linux
64-bit and Windows 64-bit. From the graph it is clear that the performance with
Linux 32-bit is lower as compared to Linux 64-bit, but as compared to Windows
64-bit the performance difference is not too much.

So, PHP on Linux with Apache is better than Windows with IIS but as the load
increases the difference in performance reduces.

No Comments so far

Jump into a conversation

No Comments Yet!

You can be the one to start a conversation.