Archive for the ‘Web Servers’

PHP Performance Test : Linux & Windows

Identical Hardware was used to make the tests.

  • Intel Core2Duo 2.4 GHz
  • 2 GB DDR2 RAM
  • 160 GB SATA 7200 RPM
  • Windows Server 2003/Ubuntu

PHP on Linux Versus PHP on Windows

  • RAW statement execution is faster on Windows.
  • Function Calls are faster on Windows
  • Object Creation & Access are faster on Linux with PHP 5.2 but faster on Windows with PHP 5.3
  • Library calls are faster on Linux. (Example: Encryption process is 3-5 times faster on Ubuntu.)
  • File Access is faster on Linux by a small percentage, except for file copy operations which is as much as 60% slower on Windows probably due to the ACL advanced security.
  • MySQL access with Linux is faster by more than a little and on Windows, MySQL access deteriorates in version 5.3
  • PostgreSQL performance is very close on both platforms (within 6/100 of a second for 1000 Operations) – It’s faster on Windows and faster still on Windows with PHP 5.3
  • MS SQL Server access from PHP 5.2 on Windows is marginally slower than MySQL access on Linux.

Windows Cache Extension For PHP By Microsoft

Windows Cache Extension for PHP has been released by Microsoft. It is currently in its Beta version. If you are heavily dealing with PHP applications on Windows platform, then this is the very cool thing for you. Your PHP applications can run faster than ever even on Windows Platform. It is only available forPHP 5.2.X, Non-thread-safe build and PHP 5.3 X86, Non-thread-safe VC9 build. One another requirement is that this cache extension runs only and only if the IIS is configured to execute PHP with FastCGI.

Supported Configurations

  • Windows XP SP3 with IIS 5.1 and FastCGI Extension
  • Windows Server 2003 with IIS 6.0 and FastCGI Extension
  • Windows Vista SP1 with IIS 7.0 and FastCGI Module
  • Windows Server 2008 with IIS 7.0 and FastCGI Module
  • Windows 7 with IIS 7 and FastCGI Module
  • Windows Server 2008 R2 with IIS 7.0 and FastCGI Module
  • As the name itself suggests, this is the caching technique that results into the better performance. Every PHP request does not need to ask for the same resource from the same source as the resource is cached.

Available cache extensions are Windows Cache Extension 1.0 for PHP 5.2 – Beta and Windows Cache Extension 1.0 for PHP 5.3 – Beta

Installation of this cache extension is very easy. Here are the steps.

  • Download and copy the DLL file
  • Place it at \ext directory of your php installation
  • Update the php.ini file and add extension extension = php_wincache.dll
  • Refresh the application pools and restart necessary services
  • PHP caching techniques available are PHP opcode cache, file cache and relative file path cache.