Your SlideShare is downloading. ×
0
How to get the most with Windows and Windows Azure<br />Kanwaljeet Singla & Sumit Chawla<br />Microsoft Corporation<br />
Agenda<br />PHP on Windows<br />How to make PHP fly on IIS<br />SQL Server Driver for PHP<br />Web Platform Installer<br /...
FastCGI<br />Fast and Reliable.<br />v1.0 released in Oct 2007<br />v1.5 released in Nov 2009<br />Consistent set of featu...
FastCGI (cont.)<br />New features:<br />Auto-tuning of maxInstances<br />Automatic recycling of PHP processes when php.ini...
PHP 5.3<br />PHP 5.3 improvements:<br />Using VC9 compiler (PHP 5.2 used VC6)<br />Optimized API calls (using Win32 instea...
WinCache 1.0  <br />PHP Accelerator optimized for Windows<br />Opcode cache<br />File cache<br />Resolve path cache<br />D...
Why use opcode cache?<br />To serve index.php in WordPress, PHP has to read, parse, compileand execute more than 100 php f...
WinCache 1.0<br />Useful Tips:<br />Increase maxInstances or use dynamic maxInstances<br />Adjust file cache and opcode ca...
WinCache 1.1<br />Beta2 released in April 2010<br />Object cache – Compatible with APC APIs<br />WinCache session handler<...
SQL Server Driver for PHP<br />Thin layer over SNAC (ODBC)<br />Single functional layer with thin API layer on top<br />SQ...
SQL Server Driver for PHP Tips<br />Scrollable Cursor: scrollable but slower<br />Use sqlsrv_has_rows() w/ CURSOR_FORWARD ...
SQL Server Query Tips<br />Range query:<br />SELECT * FROM table ORDER BY date LIMIT 20,10<br />Use TOP & ROW_NUMBER<br />...
Web Platform Installer<br />Easy way to install IIS components, PHP 5.2, PHP and Asp.Net web applications etc.<br />Demo<b...
Community participation<br />WinCache is on PECL and SQL driver for PHP is on codeplex<br />IIS and WinCache documentation...
Miscellaneous tips<br />Set IP address of MySql machine in hosts file<br />Build PHP yourself and statically link WinCache...
What is Windows Azure?<br />It’s an Operating System<br /> In the Cloud.<br />Simple Answer?<br />Windows Azure: operating...
Microsoft Data Centers<br />Vision<br />Go Inside<br />Energy Efficient<br />Containers<br />North American Data Centers<b...
The Windows Azure Model<br />http://www.microsoft.com/windowsazure/windowsazure<br />
Windows Azure RolesThis is how your code runs in the cloud<br />Worker Role<br />Web Role<br />Public Internet<br />Public...
SQL AzureRelational Database in the cloud<br />Based on SQL Server technologies<br />Scale databases up or down based on b...
What about hosting my PHP + MySQL on Windows Azure?<br /><ul><li>Yes, you can do it
If you do, you are using Windows Azure only as an infrastructure service
This means you are responsible for managing the infrastructure</li></ul>Solutions<br />MySQL<br />PHP Web App<br />Hosted ...
Deploying PHP Apps to Windows Azure<br />PHP Application<br />PHP Core<br />Windows Azure Deployment Package<br />(cspkg +...
Windows Azure Command-line Tool for PHP<br />Create new applications or convert existing PHP applications to Windows Azure...
Demo<br />Deploy WordPress to Windows Azure<br />http://wordpress.visitmix.com<br />
Windows Azure Command-line Tool for PHP<br />What’s new<br />Worker Role Support<br />Ability to attach an external drive ...
Browser<br />Web Role<br />1<br />2<br />3<br />LB<br />Queue<br />7<br />4<br />6<br />5<br />Worker Role<br />Blob Store...
Other Windows Azure SDKs and ToolsWindows Azure SDK for PHP<br />Overview<br />Enables PHP developers to take advantage of...
Other Windows Azure SDKS and Tools<br />Windows Azure Eclipse Tools<br />+ Fast CGI +  Eclipse IDE + PHP SDK for Windows A...
Summary<br />Recap<br />PHP on Windows has come a long way in the last few years<br />We are committed to improving the PH...
Additional Resources<br />PHP on Windows<br />http://windows.php.net/<br />http://php.iis.net/<br />http://www.microsoft.c...
Upcoming SlideShare
Loading in...5
×

How to get the most with Windows and Windows Azure

3,834

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,834
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
26
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "How to get the most with Windows and Windows Azure"

  1. 1. How to get the most with Windows and Windows Azure<br />Kanwaljeet Singla & Sumit Chawla<br />Microsoft Corporation<br />
  2. 2. Agenda<br />PHP on Windows<br />How to make PHP fly on IIS<br />SQL Server Driver for PHP<br />Web Platform Installer<br />Community<br />PHP on Windows Azure<br />What is the Microsoft Cloud?<br />Deploying a PHP application to the cloud<br />Windows Azure SDKs and Tools for PHP<br />Questions / Open Discussion<br />
  3. 3. FastCGI<br />Fast and Reliable.<br />v1.0 released in Oct 2007<br />v1.5 released in Nov 2009<br />Consistent set of features across all IIS versions:<br />FastCGI in IIS 7.5 – new features included in OS<br />FastCGI in IIS 7.0 – install the FastCGI update (http://www.iis.net/expand/FastCGI)<br />FastCGI in IIS 5.1/IIS 6.0 – install FastCGI 1.5 extension<br />Recommended way of running PHP on Windows<br />
  4. 4. FastCGI (cont.)<br />New features:<br />Auto-tuning of maxInstances<br />Automatic recycling of PHP processes when php.ini changes<br />Useful tips<br />Use latest version of FastCGI and turn on dynamic maxInstances and monitorChangesTo features<br />Increase InstanceMaxRequests value and match the value to PHP_FCGI_MAX_REQUESTS environment variable<br />
  5. 5. PHP 5.3<br />PHP 5.3 improvements:<br />Using VC9 compiler (PHP 5.2 used VC6)<br />Optimized API calls (using Win32 instead of POSIX)<br />All PHP libraries built from the source code<br />Compatibility fixes<br />Windows builds are available at:<br />http://windows.php.net/<br />From: http://ilia.ws/files/Confoo2010_PHP53.pdf <br />“Substantial performance improvements on Windows (40% +)” <br />
  6. 6. WinCache 1.0 <br />PHP Accelerator optimized for Windows<br />Opcode cache<br />File cache<br />Resolve path cache<br />Download from:<br />http://www.iis.net/expand/WinCacheForPhp<br />Contributed by MS to PECL:<br />Source code on http://pecl.php.net/wincache/<br />Documentation on http://www.php.net/wincache/<br />BSD license<br />Contributions are welcome!<br />
  7. 7. Why use opcode cache?<br />To serve index.php in WordPress, PHP has to read, parse, compileand execute more than 100 php files!<br />
  8. 8. WinCache 1.0<br />Useful Tips:<br />Increase maxInstances or use dynamic maxInstances<br />Adjust file cache and opcode cache sizes. Use wincache.php to study cache usage<br />Keep wincache.chkinterval value high on production servers and low on development machines<br />Restrict access to wincache.php by using built-inauthentication or web server authentication<br />
  9. 9. WinCache 1.1<br />Beta2 released in April 2010<br />Object cache – Compatible with APC APIs<br />WinCache session handler<br />File change notification support<br />Function hooks<br />Useful Tips:<br />Turn on user cache if application supports it<br />Port from existing code which uses APC’s object cache<br />Keep file change notification turned on<br />Turn on session handler if not running a web farm<br />
  10. 10. SQL Server Driver for PHP<br />Thin layer over SNAC (ODBC)<br />Single functional layer with thin API layer on top<br />SQL Server Driver for PHP 1.1<br />SQL Server Driver for PHP 2.0<br />php_sqlsrv.dll<br />php_pdo_sqlsrv.dll<br />php_sqlsrv.dll<br />PDO API<br />SQLSRV Native API<br />SQLSRV Native API<br />Core Functional Layer<br />SQL Server Native Client (ODBC)<br />
  11. 11. SQL Server Driver for PHP Tips<br />Scrollable Cursor: scrollable but slower<br />Use sqlsrv_has_rows() w/ CURSOR_FORWARD if you only need to check if there’s data in the resultset, it’s faster and doesn’t move the cursor<br />If scrollable required, consider CURSOR_STATIC first<br />WarningsReturnAsErrors: ON by default<br />Remember to turn it OFF in deployment<br />Should we change default to OFF?<br />UTF-8 encoding<br />The default for PDO, available per col/param<br />Should we make this the default for sqlsrv_xxx?<br />Use transactions for DDL to improve performance<br />
  12. 12. SQL Server Query Tips<br />Range query:<br />SELECT * FROM table ORDER BY date LIMIT 20,10<br />Use TOP & ROW_NUMBER<br />SELECT sub2.*,ROW_NUMBER() OVER(ORDER BY sub2._l2) AS _lFROM ( SELECT 1 AS _l2, sub1.* FROM ( SELECT TOP(30) * FROM table ORDER BY date ) AS sub1) as sub2WHERE _l BETWEEN 20 AND 30;<br />SELECT * FROM (<br /> SELECT *, ROW_NUMBER() OVER(ORDER BY date)<br />AS _l FROM table<br />) AS t<br />WHERE _l BETWEEN 20 AND 30<br />ORDER BY _l;<br />
  13. 13. Web Platform Installer<br />Easy way to install IIS components, PHP 5.2, PHP and Asp.Net web applications etc.<br />Demo<br />PHP 5.3 will be offered through WebPI soon<br />
  14. 14. Community participation<br />WinCache is on PECL and SQL driver for PHP is on codeplex<br />IIS and WinCache documentation on php.net<br />Participating on PHP newsgroups<br />Working with PHP developers to improve PHP and PHP installer<br />Working with PHP application developers to integrate URLRewrite, WinCache<br />
  15. 15. Miscellaneous tips<br />Set IP address of MySql machine in hosts file<br />Build PHP yourself and statically link WinCache<br />Compile and optimize using PGO for maximum performance<br />URLRewrite<br />Includes htaccess importer<br />Use IIS warm-up module to fill opcode cache before first request arrives<br />
  16. 16. What is Windows Azure?<br />It’s an Operating System<br /> In the Cloud.<br />Simple Answer?<br />Windows Azure: operating system as an online serviceMicrosoft SQL Azure: fully relational cloud database solutionWindows Azure platform AppFabric: connects cloud services and on-premises applicationsMicrosoft Codename “Dallas”: information marketplace for data and web services <br />
  17. 17. Microsoft Data Centers<br />Vision<br />Go Inside<br />Energy Efficient<br />Containers<br />North American Data Centers<br />European Data Centers<br />Asian Data Centers<br />Dublin<br />Chicago<br />Washington<br />Amsterdam<br />San Antonio<br />Hong Kong<br />Singapore<br />
  18. 18. The Windows Azure Model<br />http://www.microsoft.com/windowsazure/windowsazure<br />
  19. 19. Windows Azure RolesThis is how your code runs in the cloud<br />Worker Role<br />Web Role<br />Public Internet<br />Public Internet<br />[1..n]<br />Web Role<br />Worker Role<br />[1..m]<br />Load<br /> Balancer<br />Load balanced Web Farm<br />IIS7 web server<br />Serves HTTP/HTTPS requests<br />No inbound connections by default<br />Typically used to process background tasks by reading requests from storage queue<br />Storage Services<br />Storage Service<br />
  20. 20. SQL AzureRelational Database in the cloud<br />Based on SQL Server technologies<br />Scale databases up or down based on business needs <br />No need to install or patch software or other physical administration <br />Automatic high availability and fault tolerance <br />Simple provisioning and deployment of multiple databases <br />http://www.microsoft.com/windowsazure/sqlazure<br />
  21. 21. What about hosting my PHP + MySQL on Windows Azure?<br /><ul><li>Yes, you can do it
  22. 22. If you do, you are using Windows Azure only as an infrastructure service
  23. 23. This means you are responsible for managing the infrastructure</li></ul>Solutions<br />MySQL<br />PHP Web App<br />Hosted Web Core Worker Role [1 VM Instance]<br />http://code.msdn.microsoft.com/hwcworker<br />MySQL Solution Accelerator [>=2 VM Instances]<br />http://code.msdn.microsoft.com/winazuremysqlphp<br />http://microsoftpdc.com/Sessions/SVC51<br />http://live.visitmix.com/MIX10/Sessions/SVC12<br />
  24. 24. Deploying PHP Apps to Windows Azure<br />PHP Application<br />PHP Core<br />Windows Azure Deployment Package<br />(cspkg + configuration)<br />PHP Extensions<br />Windows Azure Command-line Tool for PHP<br />http://azurephptools.codeplex.com/<br />Download at<br />
  25. 25. Windows Azure Command-line Tool for PHP<br />Create new applications or convert existing PHP applications to Windows Azure applications<br />Deploy to Local Development Fabric or the Windows Azure Cloud<br />No IDE required<br />http://azurephptools.codeplex.com/<br />Download at<br />
  26. 26. Demo<br />Deploy WordPress to Windows Azure<br />http://wordpress.visitmix.com<br />
  27. 27. Windows Azure Command-line Tool for PHP<br />What’s new<br />Worker Role Support<br />Ability to attach an external drive to your Windows Azure Instance [aka X-Drive]<br />http://azurephptools.codeplex.com/<br />Download at<br />
  28. 28. Browser<br />Web Role<br />1<br />2<br />3<br />LB<br />Queue<br />7<br />4<br />6<br />5<br />Worker Role<br />Blob Store<br />Running background tasks with PHP on Windows Azurehttp://phpworkerdemo.cloudapp.net/<br />
  29. 29. Other Windows Azure SDKs and ToolsWindows Azure SDK for PHP<br />Overview<br />Enables PHP developers to take advantage of the Microsoft Cloud Services Platform  – Windows Azure.  <br />Features<br />PHP classes for Windows Azure Blobs, Tables & Queues (for CRUD operations)<br />Helper Classes for HTTP transport, AuhN/AuthZ, REST & Error Management<br />Manageability, Instrumentation & Logging support<br />Also Distributed via Zend Framework <br />Project Site<br />http://www.codeplex.com/PHPAzure<br />Logical architecture <br />Your PHP application<br />XML<br />REST<br />Compute<br />Storage<br />Manage<br />Deployment scenarios<br />PHP Runtime<br />Any internet connected Server<br />PHP Runtime<br />REST<br />REST<br />
  30. 30. Other Windows Azure SDKS and Tools<br />Windows Azure Eclipse Tools<br />+ Fast CGI + Eclipse IDE + PHP SDK for Windows Azure <br />1<br />2<br />4<br />3<br />
  31. 31. Summary<br />Recap<br />PHP on Windows has come a long way in the last few years<br />We are committed to improving the PHP experience on Windows<br />Windows Azure Platform offers scalable operating system as service and relational database services in the cloud<br />Windows Azure is more than a hosting infrastructure<br />There are several SDKs and Tools available for developing and deploying PHP Apps to the Microsoft Cloud<br />Call to Action<br />What scenarios are important to you?<br />What would make Windows Azure more interesting for you?<br />
  32. 32. Additional Resources<br />PHP on Windows<br />http://windows.php.net/<br />http://php.iis.net/<br />http://www.microsoft.com/web/php/<br />http://forums.iis.net/<br />http://www.ksingla.net<br />php.windows mailing list<br />PHP Interoperability<br />http://www.interoperabilitybridges.com<br />http://www.azure.com/interoperability<br />http://blogs.msdn.com/interoperability<br />
  33. 33. Contact Information<br /> PHP on Windows<br /> PHP Interoperability<br />Kanwaljeet Singla (IIS and WinCache Developer)<br />ksingla@microsoft.com<br />http://twitter.com/kjsingla<br />http://blogs.iis.net/ksingla/<br />Ruslan Yakushev (IIS Program Manager)<br />ruslany@microsoft.com<br />http://twitter.com/ruslany<br />http://ruslany.net/<br />Venkat Raman Don (IIS and WinCache Tester)<br />donraman@microsoft.com<br />http://blogs.iis.net/donraman<br />Pierre Joye (PHP Core Developer)<br />pajoye@php.net<br />http://twitter.com/PierreJoye<br />Mark Brown (IIS Product Manager)<br />http://twitter.com/markjbrown<br />http://blogs.msdn.com/markbrown/<br />Sumit Chawla<br />sumit.chawla@microsoft.com<br />Jean-Christophe<br />jccim@microsoft.com<br />Vijay Rajagopalan<br />vijayr@microsoft.com<br />Karri Dunn<br />Karri.dunn@microsoft.com<br />Jas Sandhu<br />Jassand@microsoft.co<br />Interoperability Team Blog<br />http://blogss.msdn.com/interoperability<br />
  34. 34. Questions<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×