Presentation is loading. Please wait.

Presentation is loading. Please wait.

Running PHP on the Windows Azure Platform

Similar presentations


Presentation on theme: "Running PHP on the Windows Azure Platform"— Presentation transcript:

1 Running PHP on the Windows Azure Platform
Brian Swan PHP Developer Advocate Microsoft @brian_swan

2 Lots I could talk about…
Why is PHP 5.3 faster on Windows than previous versions of PHP? Version 3.0 (beta) of the SQL Server Driver for PHP is available. SQL Server ODBC driver for Linux is coming. Hadoop for Windows Server/Azure is coming.

3 But I’ll tour Windows Azure (by looking at auto-scaling)

4 Windows Azure Platform Overview
Developer Experience Use existing skills and tools. Compute Storage Management Relational data Connectivity Access control AppFabric Composite applications LOB Applications ON-PREMISES

5 What type of cloud is Windows Azure?
Packaged Software Storage Servers Networking O/S Middleware Virtualization Data Applications Runtime You manage Infrastructure (as a Service) Storage Servers Networking O/S Middleware Virtualization Data Applications Runtime Managed by vendor You manage Platform (as a Service) Managed by vendor You manage Storage Servers Networking O/S Middleware Virtualization Applications Runtime Data Software (as a Service) Managed by vendor Storage Servers Networking O/S Middleware Virtualization Applications Runtime Data PaaS: you build it, Windows Azure runs it Automatic OS patching Elasticity and scale Utility billing Higher-level services ACS, Traffic Manager, Caching, CDN

6 What are Web and Worker roles?
In general, think of a “role” as on OS template. Web Role External Facing HTTP/HTTPS Endpoint Short lived calls (Think Web Server) Worker Role Internal Facing TCP/HTTP Endpoint Long running processes (Think Service or Deamon) Subscription = billing & determining what pieces of the platform you want to 'rent'. It also allows you to allocate both the Account Administrator (person who pays the bills,) and the Service Administrator, who administrates everything in the Azure portal. Sometimes these are both the same person, sometimes not. A subscription is also a container for services (hosted services and others, such as storage services). A hosted service is both a container for deployments and a management interface; there are certain operations that must be performed at the service level. A deployment is a logical container for roles. There are also certain operations to be performed at this level, such as configuring the number of instances for a given role within a deployment. Role is when you get down to being almost purely a container, but role also somewhat defines function (web, worker, VM), and can be thought of as a container of instances (of a certain function). There is also a VM Role You configure and maintain the OS. Lacks persistent state.

7 Instance Sizes and Costs
Cores CPU Speed Memory Cost/hour Ex. Small Shared 1.0 GHz 768 MB $0.04 Small 1 1.6 GHz 1.75 GB $0.12 Medium 2 3.5 GB $0.24 Large 4 7 GB $0.48 Ex. Large 8 14 GB $0.96 Local storage varies with instance size.

8 What is Azure Storage? Don’t forget
Tables: simply (and loosely) structured data (not relational) Blobs: large, unstructured binary data (audio, video, etc.) Queues: serially accessed messages Don’t forget Storage Costs $0.14 GB/month* $0.01/10k transactions Transfer Costs $0.15 GB outbound *

9 Azure Table Storage Query Performance Unique Partition Key
Row Key Timestamp DeliveryAddress OrderAmount Kirk NC1701 10/24/2011 6:05:15 PM 6855 Kobayashi Maru Drive $35,490.00 NC1701A 10/23/2011 6:09:10 PM 409 Tiberious Road $98.99 NC1701B 10/24/2011 6:00:15 AM 1024 Priceline Ave $4,523.99 Archer 31415 11/20/2010 8:05:15 AM 999 Sliders Blvd $5,780.99 1 10/04/2011 6:55:15 PM 1405 Suliban Road $55.39 234 09/24/2011 6:05:15 AM DS9, Level 29, Suite 782 $1.58 Bender 10/24/2010 7:05:15 PM 900 South Futurama Drive $87,399.99 Query Performance VIN Super Fast Unique Partition Key Very Fast Partition Key + Row Key Slower Only Partition Key No Row Key Slowest No Partition Key 12345 KJUDH Property Max = 255 Combined size of all data in an entity cannot exceed 1MB. This size includes the size of the property names as well as the size of the property values or their types, which includes the two mandatory key properties (PartitionKey and RowKey). PartitionKey and RowKey are of string type, and each key is limited to 1KB in size.

10 Azure Blob Storage Blob Account Container images videos PIC01.JPG
Account Container Blob PIC01.JPG images PIC02.JPG Containers are like folders (but they can’t contain other containers, only blobs). mymedia videos VID01.AVI

11 *100 TB is the size limit for an entire storage account
Containers and Blobs Containers Multiple containers per account Create/destroy on the fly One container can hold up to 100 TB* worth of blobs Set access policies (private, public read, full public read) Set metadata No search/query (i.e. no WHERE MetadataValue = ?) Blobs A blob can be up to 1 TB in size Set access policy *100 TB is the size limit for an entire storage account Under the covers there are 2 types of blobs: block and page blobs.

12 What is the Diagnostics Monitor?
An Azure component (MonAgentHost.exe) that collects diagnostic data for application instances Starts automatically by default Must define a storage account connection string

13 How does it work (in a nutshell)?
Role Instance Role Instance Starts Diagnostic Monitor Starts Monitor is configured Imperatively at Start time Remotely any time Monitor buffers data locally User can set a quota (FIFO) User initiates transfer to storage Scheduled or On Demand Role Diagnostic Monitor Local directory storage Windows Azure Storage

14 Diagnostic Data Sources
Default Destination Trace Logs Enabled Table Diagnostic Infrastructure Logs IIS Logs Blob Performance Counters Disabled Windows Event Logs IIS Failed Request Logs Crash Dumps Arbitrary Files

15 What is the Management API?
A REST API that allows you to manage services under an Azure subscription. Examples include… Create/stop/start/delete a deployment Move staging deployment to production Increasing the number of instances Initiate a rolling upgrade Etc. (almost anything you can do via the management portal) All API calls must be signed with an X509 certificate Limitations of the Management API: Can’t get billing data Can’t create a subscription Can’t create storage or compute services Can’t deploy management certificates

16 Windows Azure SDK for PHP
Open Source project Mostly platform independent (only the packaging tools have a Windows dependency) Features PHP classes for Windows Azure Blobs, Tables & Queues Scaffolds for quick application deployment Helper Classes for HTTP transport, AuthN/AuthZ, REST & Error Management Manageability, Instrumentation & Logging support Support for storing PHP sessions in Azure Table Storage Management API client Diagnostics client Command line tools set for packaging, management , diagnostics, and deployment

17 Auto-scaling a Windows Azure/PHP application
Demo Auto-scaling a Windows Azure/PHP application Windows Azure SDK for PHP + …

18 Code GolferMessageBoard code is on the TechNet Wiki: Auto-scaling code is on GitHub: Read about it here:

19 Other Resources http://blogs.msdn.com/b/silverlining
A PHP on Windows Azure Learning Plan Why is PHP 5.3 faster on Windows than previous versions of PHP? Version 3.0 (beta) of the SQL Server Driver for PHP is available. SQL Server ODBC driver for Linux is coming. Hadoop for Windows Server/Azure is coming.

20 Try It Out

21 Q & A?


Download ppt "Running PHP on the Windows Azure Platform"

Similar presentations


Ads by Google