Php Performance On Windows
Upcoming SlideShare
Loading in...5
×
 

Php Performance On Windows

on

  • 21,659 views

The slides from the PHP Architect session "PHP Performance on Windows"

The slides from the PHP Architect session "PHP Performance on Windows"

Statistics

Views

Total Views
21,659
Views on SlideShare
21,150
Embed Views
509

Actions

Likes
2
Downloads
133
Comments
0

9 Embeds 509

http://www.techgig.com 218
http://www.daxmax.com 172
http://www.slideshare.net 71
http://daxmax.com 37
http://www.linkedin.com 6
http://channel.me 2
http://itspark.ro 1
http://translate.googleusercontent.com 1
http://www.google.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Php Performance On Windows Php Performance On Windows Presentation Transcript

  • PHP Performance on Windows Mark Brown, Ruslan Yakushev Microsoft
  • A Little History 2006 • PHP on Win/IIS = Big Joke 2007 • IIS FastCGI 2008 • windows.php.net • PHP 5.3 2009 • PHP 5.3 Release • WinCache 1.0 2010 • FastCGI 1.5 • WinCache 1.1
  • PHP Community and Microsoft • “PHP on Windows” project involves: – PHP core developers – PHP installer developers – PHP documentation team – PHP community and influentials – PHP applications communities (WordPress, Joomla, Drupal, others) – Many others…
  • CGI  FASTCGI
  • CGI vs FastCGI • (CGI on Windows) == SLOW !!! – New PHP process per request • FastCGI == (CGI on steroids) – Re-use PHP processes in a process pool – Single-threaded execution environment – Use Non-Thread Safe PHP with IIS FastCGI • PHP ISAPI? – Stay away!!! Use FastCGI instead – No ISAPI support in 5.3 anyway
  • CGI vs. FastCGI
  • CGI vs. FastCGI CGI Processes FastCGI processes
  • FastCGI 1.5 • New features: – Auto-tuning of maxIntances for optimal performance – Automatic recycling of PHP processes with config change MonitorChangesTo setting – No more restarts with changes to php.ini • Consistent set of features across all IIS versions: – For IIS 7.5 in WS08 R2 – new features are included – For IIS 7.0 in WS08 – install the FastCGI update (http://www.iis.net/expand/FastCGI) – For IIS 5.1 & 6.0 – install FastCGI 1.5 extension
  • IIS FastCGI and PHP Setup - automated • Use the easiest option - Web Platform Installer!  Get Web Platform Installer from http://www.microsoft.com/web/php/
  • Add PHP installer option
  • IIS FastCGI & PHP Setup - manual • Follow the instructions on php.net: • IIS 5.1 and IIS 6.0: – php.net/manual/en/install.windows.iis6.php • IIS 7 and later: – php.net/manual/en/install.windows.iis7.php • PHP configuration – php.net/manual/en/install.windows.manual.php
  • PHP 5.2  PHP 5.3
  • PHP 5.3 improvements • PHP 5.3 improvements: – Using VC9 compiler (PHP 5.2 used VC6) – Optimized API calls (using Win32 instead of POSIX) – All PHP libraries built from the source code – Compatibility fixes • Windows builds are available at: – http://windows.php.net/ From: http://ilia.ws/files/Confoo2010_PHP53.pdf “Substantial performance improvements on Windows (40% +)”
  • WINCACHE
  • WinCache 1.0 • PHP Accelerator optimized for Windows – Opcode cache – File cache – Resolve path cache • Download from: – http://www.iis.net/expand/WinCacheForPhp • Contributed by MS to PECL: – Source code on http://pecl.php.net/wincache/ – Documentation on http://www.php.net/wincache/ – BSD license Contributions are welcome!
  • Why use opcode cache? To serve an index.php in WordPress, PHP has to read, parse, compile and execute more than 100 PHP files!
  • WinCache in action Just add extension=php_wincache.dll in php.ini. No app code changes necessary!
  • WinCache and CPU usage • WinCache significantly reduces CPU load • Use FastCGI maxInstances setting to load CPU more • Set maxInstances to 0 to enable auto tuning
  • WinCache and CPU usage Increased FastCGI maxInstances from 4 (default) to 10
  • WinCache 1.1 User Cache API: • Stores app data in shared memory • Function by function compatible with APC
  • WinCache 1.1 – Session Handler • Stores PHP session data in shared memory • Enabled in php.ini : session.save_handler = wincache • Session storage is not persistent in beta, but will be in RC: – Use the code snapshot to try it out.
  • WinCache 1.1 user cache in action Instructions on how to configure WordPress to use WinCache user cache: http://ruslany.net/2010/03/make-wordpress-faster-on-iis-with-wincache-1-1/
  • WinCache statistics script Always restrict access to wincache.php by using built-in authentication or web server authentication!
  • What’s next? • Popular PHP applications to adopt WinCache: – Joomla 1.6 – Drupal cacherouter module – Sugar CRM • WinCache improvements: – File change notifications support – Function hooks
  • Summary • In 3 years Windows/IIS has become a great option for hosting PHP applications • In 2 years the PHP performance on Windows has improved considerably.
  • PHP on Windows - Contacts • Pierre Joye • Venkat Raman Don • (PHP Core Developer) – pajoye@php.net • (IIS and WinCache Tester) – donraman@microsoft.com – http://twitter.com/PierreJoye – http://blogs.iis.net/donraman • Mark Brown • Kanwaljeet Singla • (Web Platform) • (IIS and WinCache – twitter.com/markjbrown Developer) – blogs.msdn.com/markbrown/ – ksingla@microsoft.com – http://twitter.com/kjsingla • Ruslan Yakushev – http://blogs.iis.net/ksingla/ • (IIS Program Manager) – ruslany@microsoft.com – http://twitter.com/ruslany – http://ruslany.net/
  • PHP on Windows - resources • http://windows.php.net/ • http://php.iis.net/ • php.windows mailing list • http://forums.iis.net/
  • Test setup • Quad core CPU + 4 GB RAM • Windows Server 2008 with IIS 7.0 and FastCGI • PHP 5.3.2 • WinCache 1.1 beta • WordPress 2.9.2 • + Load Generator and MySQL on the same box