How to get the most with Windows and Windows Azure
Upcoming SlideShare
Loading in...5

How to get the most with Windows and Windows Azure






Total Views
Views on SlideShare
Embed Views



1 Embed 20 20



Upload Details

Uploaded via as Microsoft PowerPoint

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.

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

    How to get the most with Windows and Windows Azure How to get the most with Windows and Windows Azure Presentation Transcript

    • How to get the most with Windows and Windows Azure
      Kanwaljeet Singla & Sumit Chawla
      Microsoft Corporation
    • Agenda
      PHP on Windows
      How to make PHP fly on IIS
      SQL Server Driver for PHP
      Web Platform Installer
      PHP on Windows Azure
      What is the Microsoft Cloud?
      Deploying a PHP application to the cloud
      Windows Azure SDKs and Tools for PHP
      Questions / Open Discussion
    • FastCGI
      Fast and Reliable.
      v1.0 released in Oct 2007
      v1.5 released in Nov 2009
      Consistent set of features across all IIS versions:
      FastCGI in IIS 7.5 – new features included in OS
      FastCGI in IIS 7.0 – install the FastCGI update (
      FastCGI in IIS 5.1/IIS 6.0 – install FastCGI 1.5 extension
      Recommended way of running PHP on Windows
    • FastCGI (cont.)
      New features:
      Auto-tuning of maxInstances
      Automatic recycling of PHP processes when php.ini changes
      Useful tips
      Use latest version of FastCGI and turn on dynamic maxInstances and monitorChangesTo features
      Increase InstanceMaxRequests value and match the value to PHP_FCGI_MAX_REQUESTS environment variable
    • PHP 5.3
      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:
      “Substantial performance improvements on Windows (40% +)”
    • WinCache 1.0
      PHP Accelerator optimized for Windows
      Opcode cache
      File cache
      Resolve path cache
      Download from:
      Contributed by MS to PECL:
      Source code on
      Documentation on
      BSD license
      Contributions are welcome!
    • Why use opcode cache?
      To serve index.php in WordPress, PHP has to read, parse, compileand execute more than 100 php files!
    • WinCache 1.0
      Useful Tips:
      Increase maxInstances or use dynamic maxInstances
      Adjust file cache and opcode cache sizes. Use wincache.php to study cache usage
      Keep wincache.chkinterval value high on production servers and low on development machines
      Restrict access to wincache.php by using built-inauthentication or web server authentication
    • WinCache 1.1
      Beta2 released in April 2010
      Object cache – Compatible with APC APIs
      WinCache session handler
      File change notification support
      Function hooks
      Useful Tips:
      Turn on user cache if application supports it
      Port from existing code which uses APC’s object cache
      Keep file change notification turned on
      Turn on session handler if not running a web farm
    • SQL Server Driver for PHP
      Thin layer over SNAC (ODBC)
      Single functional layer with thin API layer on top
      SQL Server Driver for PHP 1.1
      SQL Server Driver for PHP 2.0
      PDO API
      SQLSRV Native API
      SQLSRV Native API
      Core Functional Layer
      SQL Server Native Client (ODBC)
    • SQL Server Driver for PHP Tips
      Scrollable Cursor: scrollable but slower
      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
      If scrollable required, consider CURSOR_STATIC first
      WarningsReturnAsErrors: ON by default
      Remember to turn it OFF in deployment
      Should we change default to OFF?
      UTF-8 encoding
      The default for PDO, available per col/param
      Should we make this the default for sqlsrv_xxx?
      Use transactions for DDL to improve performance
    • SQL Server Query Tips
      Range query:
      SELECT * FROM table ORDER BY date LIMIT 20,10
      Use TOP & ROW_NUMBER
      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;
      SELECT * FROM (
      AS _l FROM table
      ) AS t
      WHERE _l BETWEEN 20 AND 30
      ORDER BY _l;
    • Web Platform Installer
      Easy way to install IIS components, PHP 5.2, PHP and Asp.Net web applications etc.
      PHP 5.3 will be offered through WebPI soon
    • Community participation
      WinCache is on PECL and SQL driver for PHP is on codeplex
      IIS and WinCache documentation on
      Participating on PHP newsgroups
      Working with PHP developers to improve PHP and PHP installer
      Working with PHP application developers to integrate URLRewrite, WinCache
    • Miscellaneous tips
      Set IP address of MySql machine in hosts file
      Build PHP yourself and statically link WinCache
      Compile and optimize using PGO for maximum performance
      Includes htaccess importer
      Use IIS warm-up module to fill opcode cache before first request arrives
    • What is Windows Azure?
      It’s an Operating System
      In the Cloud.
      Simple Answer?
      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
    • Microsoft Data Centers
      Go Inside
      Energy Efficient
      North American Data Centers
      European Data Centers
      Asian Data Centers
      San Antonio
      Hong Kong
    • The Windows Azure Model
    • Windows Azure RolesThis is how your code runs in the cloud
      Worker Role
      Web Role
      Public Internet
      Public Internet
      Web Role
      Worker Role
      Load balanced Web Farm
      IIS7 web server
      Serves HTTP/HTTPS requests
      No inbound connections by default
      Typically used to process background tasks by reading requests from storage queue
      Storage Services
      Storage Service
    • SQL AzureRelational Database in the cloud
      Based on SQL Server technologies
      Scale databases up or down based on business needs
      No need to install or patch software or other physical administration
      Automatic high availability and fault tolerance
      Simple provisioning and deployment of multiple databases
    • What about hosting my PHP + MySQL on Windows Azure?
      • 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
      PHP Web App
      Hosted Web Core Worker Role [1 VM Instance]
      MySQL Solution Accelerator [>=2 VM Instances]
    • Deploying PHP Apps to Windows Azure
      PHP Application
      PHP Core
      Windows Azure Deployment Package
      (cspkg + configuration)
      PHP Extensions
      Windows Azure Command-line Tool for PHP
      Download at
    • Windows Azure Command-line Tool for PHP
      Create new applications or convert existing PHP applications to Windows Azure applications
      Deploy to Local Development Fabric or the Windows Azure Cloud
      No IDE required
      Download at
    • Demo
      Deploy WordPress to Windows Azure
    • Windows Azure Command-line Tool for PHP
      What’s new
      Worker Role Support
      Ability to attach an external drive to your Windows Azure Instance [aka X-Drive]
      Download at
    • Browser
      Web Role
      Worker Role
      Blob Store
      Running background tasks with PHP on Windows Azure
    • Other Windows Azure SDKs and ToolsWindows Azure SDK for PHP
      Enables PHP developers to take advantage of the Microsoft Cloud Services Platform  – Windows Azure.  
      PHP classes for Windows Azure Blobs, Tables & Queues (for CRUD operations)
      Helper Classes for HTTP transport, AuhN/AuthZ, REST & Error Management
      Manageability, Instrumentation & Logging support
      Also Distributed via Zend Framework
      Project Site
      Logical architecture
      Your PHP application
      Deployment scenarios
      PHP Runtime
      Any internet connected Server
      PHP Runtime
    • Other Windows Azure SDKS and Tools
      Windows Azure Eclipse Tools
      + Fast CGI + Eclipse IDE + PHP SDK for Windows Azure
    • Summary
      PHP on Windows has come a long way in the last few years
      We are committed to improving the PHP experience on Windows
      Windows Azure Platform offers scalable operating system as service and relational database services in the cloud
      Windows Azure is more than a hosting infrastructure
      There are several SDKs and Tools available for developing and deploying PHP Apps to the Microsoft Cloud
      Call to Action
      What scenarios are important to you?
      What would make Windows Azure more interesting for you?
    • Additional Resources
      PHP on Windows mailing list
      PHP Interoperability
    • Contact Information
      PHP on Windows
      PHP Interoperability
      Kanwaljeet Singla (IIS and WinCache Developer)
      Ruslan Yakushev (IIS Program Manager)
      Venkat Raman Don (IIS and WinCache Tester)
      Pierre Joye (PHP Core Developer)
      Mark Brown (IIS Product Manager)
      Sumit Chawla
      Vijay Rajagopalan
      Karri Dunn
      Jas Sandhu
      Interoperability Team Blog
    • Questions