SlideShare ist ein Scribd-Unternehmen logo
1 von 55
Downloaden Sie, um offline zu lesen
Optimizing ASP.Net and PHP
Web Applications on IIS 7.5
                                               Alessandro Pilotti
                                    info@cloudbasesolutions.com
                                                       MVP / IIS

             MCSD (VS 6.0 & .Net), MCAD, MCSE, MCDBA,
                         MCT, RHCE, SCJP2


  Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
IT Camp 2011
• Thanks for coming!
• ITCamp is made possible by our sponsors:




      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Session agenda
•   IIS 7.5 Architecture
•   WebPI
•   FastCGI
•   Wincache Extensions for PHP
•   Output Caching
•   Application Request Routing
•   AppFabric Caching
•   Session management in PHP & SQL Server

        Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Architecture - IIS 6
      Web Request                                                       • Monolithic
Authentication                                                          • Extension via
NTLM        Basic        Anon                                             ISAPI ony
…
                          CGI
Determine                 Static
Handler                   File
                                          ASP.NET
                          ISAPI
…
                                          PHP
Send Response
Log                 Compress




         Premium conference on Microsoft’s Dev and ITPro technologies      @itcampro / #itcampro
Architecture IIS 7.5
   Web Request                                        • Features separated in
                                      NTLM
                                       Basic
                                                        modules
Authentication
                                       Anon                 – More than 40
Authorization
…                                                     • Modules fit in a
ResolveCache                           CGI
…
                                                        common pipeline
                                      Static
                                      File            • Modules employ
Determine Handler
                                       ISAPI            common API
…
UpdateCache                                           • Managed or
                                     Compress
                                                        unmanaged
Send Response                          Log




     Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Anatomy of a Request in IIS 7.x
                                                              • HTTP .sys
                                                                receives the
                                                                request
                                                              • WAS
                                                              • applicationHost
                                                                .config
                                                              • WWW service
                                                              • HTTP .sys config
                                                              • W3WP
                                                              • WP execution
                                                              • Response


    Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Request – W3WP details




Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
WAS and W3SVC




Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
versioning
• IIS 5.0
   – Windows 2000
• IIS 5.1
   – Windows XP
• IIS 6.0
   – Windows Server 2003
• IIS 7.0
   – Windows Vista / Server 2008
• IIS 7.5
   – Window 7 / Server 2008 R2

       Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Web Platform Installer 3
• Single tool to easily deploy:
  – Frameworks
  – Extensions
  – Tools
  – Applications
     • E.g.: DNN, Joomla, etc
• Always updated


      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
WEB PI 3




Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Web PI 3




Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Web PI 3




Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Web Platform Installer

DEMO


       Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
FastCGI 1.5
• Very popular in the Apache environment, for PHP Perl,
                                                 ,
  Ruby, etc
• CGI is slow: every request generates a process instance!
• FastCGI employs the same process for many requests
• Supported on IIS 7.x and IIS 6.0 (the latter via fcgiext.dll
  ISAPI)
• Written in collaboration with Zend (PHP) but is generic
• In IIS 7.x: Enable CGI among the IIS role services
• Note: Install Hotfix KB980363 on IIS 7.0 to get version
  1.5!
        Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
FastCGI Setup




Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
FastCGI – version differences

Feature                                                       5.1/6.0     7.0      7.5
Monitoring file changes                                       Yes         Yes      Yes
Real-Time max Inst. tuning                                    Yes         Yes      Yes
STDERR support                                                Yes         Yes      Yes
SIGTERM support                                               Yes         Yes      Yes
Env. variable _FCGI_X_PIPE_                                   Yes         Yes      Yes
Proc. Pool per application                                    Yes         Yes      Yes
UTF-8 variable encoding                                       Yes         Yes      No
IIS CPU Limit support                                         No          Yes      Yes




           Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
FastCGI - PHP
• Install PHP 5.2 or 5.3
  – During setup choose FastCGI
• As an alternative, deploy via WebPI
• WP3P.exe
  – Loads iisfcgi.dll
  – Executes php-cgi.exe
• Config: PHP.INI
  – E.g.: fastcgi.impersonate = 1

      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
PHP on IIS – other options
• ISAPI
  – Previous choice
  – Low reliability due to reentrance problems
  – DLL loaded at W3SVC instance level
     • Security issues!!
• CGI (not FastCGI!)
  – Awful performance



      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
PHP on IIS - Performance
• PHP gets compiled at runtime
  – Reads source file and generates
    bytecode
  – Process repeated at each request
• Not a problem for small loads
• Huge bottleneck otherwise
  – Various solutions available
  – Now (PHP 5.x) no one available natively

     Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
PHP Accelerators
• Tools whose purpose is to improve
  the PHP execution time
• Most popular available:
  – APC (default on PHP 6.0)
  – eAccelerator
  – Zend Server
  – Windows Cache Extension for PHP

     Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
WinCache for PHP
• Open source project developed by
  Microsoft
• IIS Specific
• Requires PHP 5.2 or 5.3 x86
  – Non thread safe version
• Provides features not available in
  APC and other accelerators

     Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
WinCache for PHP
• Setup
  – Web Platform Installer
  – Direct download
  – Source code
• PHP configuration
     .ini
  – extension = php_wincache.dll
  – Verify setup with phpinfo()
  – maxInstances = 0 for best performance!

      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
WinCache for PHP
• PHP Bytecode Cache
  – Subsequest calls to a script employ precompiled and
    cached bytecode
• PHP scripts loaded in memory
  – Reduced I/O, mainly for UNC Paths!
• Cache handled via Shared Memory
• Absolute path caching
  – Optimizes the time required to resolve relative paths
• Cache based session handler
  – By default PHP uses a file system based solution
       Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
WinCache for PHP
• User cache
  – wincache_ucache_set(key, value)
  – wincache_ucache_get(key)
  – Etc
• User Cache session handler
  – session.save_handler = wincache


     Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
FastCGI / PHP / WinCache

DEMO


       Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
IIS 7.x Output Caching
• Very efficient way to optimize an
  application
• There 2 type of contents
  – Static
  – Dynamic
      • Based on a degree of dynamism and determinism
  –


       Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
IIS 7.x Output Caching
• IIS provides two caching policies
  – User mode (IIS 7.x worker process)
  – Kernel mode
    • Cache in HTTP.sys memory
    • Faster!
• Parameter based (header, QueryString)
• Not to be confused with ASP.Net output
  caching!

      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Kernel Caching - limits
• No user mode modules or features
  – E.g. Authentication
• varyByQueryString parameter not
  supported
• Management:
  – netsh http show cache
  – Netsh http delete cache …



      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
IIS 7.x Output Caching
• Caching can be enabled for static and
  “semi-dynamic” content

• Caching enabled for each site
  – Via UI
  – Via Command Line (appcmd)




      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Caching Rules
• IIS decides if “it is worth” to cache some
  content
• Parameters
  – frequentHitTimePeriod
     • Default 10s
  – frequentHitThreshold
     • Default 2
• ServerRuntime in applicationHost.config



       Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
ServiceRuntime sample
<system.webServer>
   <serverRuntime enabled="true"
     frequentHitThreshold="5"
     frequentHitTimePeriod="00:00:20" />
</system.webServer>




     Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Output Caching

DEMO


      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Application Request Routing (ARR)
               2.5
•   Based on the URL Rewrite module
•   Enhances Availability and scalability
•   Load balancing
•   Health monitoring
•   Client Affinity
•   Works at level 5 ISO/OSI
    – Can work with a NLB (level 3) solution
• ARR 2 introduces a caching option


         Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Load balancing




Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Creating a Web Farm




Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Server farm config




Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Application Request Routing

DEMO


       Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
AppFabric
• Extension with two separated main
  areas
  – WCF and WF service housing
    MSDN video (in Italian  )
    http://www.microsoft.com/italy/beit/Generic.aspx?
    video=1a5e02e4-c881-4ef9-ac86-61dd7a370f70
  – Distributed Cache
    • Solution to increase scalability and
      performance

     Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
AppFabric Cache - Scalability
• The problem:
  – Increasing load, means distributing it on
    more hosts
  – ARR is not a data oriented tool
  – The cache works at a data level
• Other advantages:
  – Works also as a session provider
  – It can be integrated in EF as a 2nd level cache


      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
AppFabric Cache Architecture




   Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
AppFabric Setup




Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
AppFabric Cache Cluster
• Fault tolerant solution
• Every host keeps a replicated copy of the
  data
• Doesn’t require Windows Clustering
• Configuration based on the “leadHost”
  concept
  – Host delegated to “master” the cluster
    configuration

      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
AppFabric Cache Cluster
• Configuration can be kept on:
  – SQL Server
     • LeadHost not required
  – Shared storage + XML file
     • LeadHost required
  – Custom provider
• LeadHost can be redundant
• Note: SQL / storage can become a single point
  of failure! (valutare cluster etc)


      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
AppFabric Cache TCP/IP
•   Replication: 22236
•   Arbitration: 22235
•   Cluster: 22234
•   Cache: 22233




        Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
AppFabric Cache Client
• Any .Net 3.5 o 4.0
• Install the “Cache Client” feature only
• In Visual Studio, register:
  – Microsoft.ApplicationServer.Caching.Client
  – Microsoft.ApplicationServer.Caching.Core

• Assembly available in
  – %systemroot%System32AppFabric
     • Sostituire con SysWOW64 se x86 su x64



       Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
AppFabric Cache client session
• Enabling AppCache as a session provider
  in web.config

  <sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider”>
         <providers>
       <add name="AppFabricCacheSessionStoreProvider”
       type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider,
                  Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral,
       PublicKeyToken=31bf3856ad364e35”
       cacheName="TestWPC” sharedId="DemoApp1"/>
       </providers>
  </sessionState>




          Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
PowerShell
•   Start-CacheCluster
•   New-Cache
•   Grant-CacheClientAllowedAccount
•   Get-Cache
•   Get-CacheStatistics




       Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Concurrency models
• Optimistic
  – Versioning
  – Version number checked during a Put
    operation
• Pessimistic
  – Lock
  – Watchout for performance issues…
  – Note: Put doesn’t check for locks!


      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
AppFabric Cache

DEMO


      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
PHP + MSSQL Sessions
• Scaling out an application on a web farm
  requires proper session management
• Tipically offloaded to a database or a
  state server
• ASP .Net offers ready made solutions
• PHP can be extended implementing a
  small number of documented callbacks


      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
PHP + MSSQL Sessions
• SQL Server Drivers for PHP 1.1
  – Installable also via WebPI (recommended)
• In PHP.ini
  – extension=php_pdo_sqlsrv.dll
  – session.save_handler = user
• PHP handler to implement:
  – session_set_save_handler



      Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
PHP + MS SQL Server Session handling

DEMO


       Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Q&A


  Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro
Don’t forget!
Get your free Azure pass!                            We want your feedback!

• 30+15 days, no CC req’d                        • Win a WP7 smartphone
   – http://bit.ly/ITCAMP11                             – Fill in your feedback forms
   – Promo code: ITCAMP11                               – Raffle: end of the day




        Premium conference on Microsoft’s Dev and ITPro technologies   @itcampro / #itcampro

Weitere ähnliche Inhalte

Was ist angesagt?

Netlab+overview
Netlab+overviewNetlab+overview
Netlab+overview
elgraini
 
Calling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBayCalling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBay
Tony Ng
 

Was ist angesagt? (20)

Virtualization aware Java VM
Virtualization aware Java VMVirtualization aware Java VM
Virtualization aware Java VM
 
Getting started with PHP on IBM i
Getting started with PHP on IBM iGetting started with PHP on IBM i
Getting started with PHP on IBM i
 
Eclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimesEclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimes
 
PHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourPHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel Tour
 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and more
 
Under the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT CompilerUnder the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT Compiler
 
Zend_Tool: Practical use and Extending
Zend_Tool: Practical use and ExtendingZend_Tool: Practical use and Extending
Zend_Tool: Practical use and Extending
 
223: Modernization and Migrating from the ESB to Containers
223: Modernization and Migrating from the ESB to Containers223: Modernization and Migrating from the ESB to Containers
223: Modernization and Migrating from the ESB to Containers
 
Ibm i-modernization
Ibm i-modernizationIbm i-modernization
Ibm i-modernization
 
IBM Impact session CICS & java a tale of liberty
IBM Impact session CICS & java a tale of libertyIBM Impact session CICS & java a tale of liberty
IBM Impact session CICS & java a tale of liberty
 
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
 
PHP Batch Jobs on IBM i
PHP Batch Jobs on IBM iPHP Batch Jobs on IBM i
PHP Batch Jobs on IBM i
 
Websphere Application Server: Much more than Open Source
Websphere Application Server: Much more than Open SourceWebsphere Application Server: Much more than Open Source
Websphere Application Server: Much more than Open Source
 
Don Schwarz App Engine Talk
Don Schwarz App Engine TalkDon Schwarz App Engine Talk
Don Schwarz App Engine Talk
 
Netlab+overview
Netlab+overviewNetlab+overview
Netlab+overview
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi
 
Calling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBayCalling All Modularity Solutions: A Comparative Study from eBay
Calling All Modularity Solutions: A Comparative Study from eBay
 
What's New in IBM Java 8 SE?
What's New in IBM Java 8 SE?What's New in IBM Java 8 SE?
What's New in IBM Java 8 SE?
 
Serving Applications with Silverlight Streaming by Windows Live
Serving Applications with Silverlight Streaming by Windows LiveServing Applications with Silverlight Streaming by Windows Live
Serving Applications with Silverlight Streaming by Windows Live
 
Liberty: The Right Fit for Micro Profile?
Liberty: The Right Fit for Micro Profile?Liberty: The Right Fit for Micro Profile?
Liberty: The Right Fit for Micro Profile?
 

Andere mochten auch

ITCamp 2012 - Paul Roman - Hybrid solutions in Office 365
ITCamp 2012 - Paul Roman - Hybrid solutions in Office 365ITCamp 2012 - Paul Roman - Hybrid solutions in Office 365
ITCamp 2012 - Paul Roman - Hybrid solutions in Office 365
ITCamp
 
How to make money with Suse
How to make money with SuseHow to make money with Suse
How to make money with Suse
SalesExchange
 

Andere mochten auch (8)

Configuring The Network Server
Configuring The Network ServerConfiguring The Network Server
Configuring The Network Server
 
Building drupal web farms with IIS - part 1
Building drupal web farms with IIS - part 1Building drupal web farms with IIS - part 1
Building drupal web farms with IIS - part 1
 
Veeam Cloud Connect Replication
Veeam Cloud Connect ReplicationVeeam Cloud Connect Replication
Veeam Cloud Connect Replication
 
ITCamp 2012 - Paul Roman - Hybrid solutions in Office 365
ITCamp 2012 - Paul Roman - Hybrid solutions in Office 365ITCamp 2012 - Paul Roman - Hybrid solutions in Office 365
ITCamp 2012 - Paul Roman - Hybrid solutions in Office 365
 
How to make money with Suse
How to make money with SuseHow to make money with Suse
How to make money with Suse
 
OpenStack + Nano Server + Hyper-V + S2D
OpenStack + Nano Server + Hyper-V + S2DOpenStack + Nano Server + Hyper-V + S2D
OpenStack + Nano Server + Hyper-V + S2D
 
Building a Microsoft cloud with open technologies
Building a Microsoft cloud with open technologiesBuilding a Microsoft cloud with open technologies
Building a Microsoft cloud with open technologies
 
Step by Step Installation of Microsoft SQL Server 2012
Step by Step Installation of Microsoft SQL Server 2012 Step by Step Installation of Microsoft SQL Server 2012
Step by Step Installation of Microsoft SQL Server 2012
 

Ähnlich wie ITCamp 2011 - Alessandro Pilotti - Optimizing ASPNet and PHP apps on IIS 7.5

ITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interopITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp
 
AMF Flash and .NET
AMF Flash and .NETAMF Flash and .NET
AMF Flash and .NET
Yaniv Uriel
 
ITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
ITCamp 2011 - Cristian Lefter - SQL Server code-name DenaliITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
ITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
ITCamp
 
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignalITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
ITCamp
 
Netflix oss season 2 episode 1 - meetup Lightning talks
Netflix oss   season 2 episode 1 - meetup Lightning talksNetflix oss   season 2 episode 1 - meetup Lightning talks
Netflix oss season 2 episode 1 - meetup Lightning talks
Ruslan Meshenberg
 
ITCamp 2013 - Adrian Stoian - Whats new in ConfigMgr 2012 SP1
ITCamp 2013 - Adrian Stoian - Whats new in ConfigMgr 2012 SP1ITCamp 2013 - Adrian Stoian - Whats new in ConfigMgr 2012 SP1
ITCamp 2013 - Adrian Stoian - Whats new in ConfigMgr 2012 SP1
ITCamp
 

Ähnlich wie ITCamp 2011 - Alessandro Pilotti - Optimizing ASPNet and PHP apps on IIS 7.5 (20)

ITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interopITCamp 2011 - Mihai Nadas - Windows Azure interop
ITCamp 2011 - Mihai Nadas - Windows Azure interop
 
Afs manager
Afs managerAfs manager
Afs manager
 
AMF Flash and .NET
AMF Flash and .NETAMF Flash and .NET
AMF Flash and .NET
 
VA Smalltalk Update
VA Smalltalk UpdateVA Smalltalk Update
VA Smalltalk Update
 
ITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
ITCamp 2011 - Cristian Lefter - SQL Server code-name DenaliITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
ITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
 
PHP on Windows 2008
PHP on Windows 2008PHP on Windows 2008
PHP on Windows 2008
 
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignalITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
ITCamp 2012 - Alessandro Pilotti - Web API, web sockets and RSignal
 
Netflix oss season 2 episode 1 - meetup Lightning talks
Netflix oss   season 2 episode 1 - meetup Lightning talksNetflix oss   season 2 episode 1 - meetup Lightning talks
Netflix oss season 2 episode 1 - meetup Lightning talks
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
SD Times - Docker v2
SD Times - Docker v2SD Times - Docker v2
SD Times - Docker v2
 
DevNetCreate Workshop - build a react app - React crash course
DevNetCreate Workshop - build a react app - React crash courseDevNetCreate Workshop - build a react app - React crash course
DevNetCreate Workshop - build a react app - React crash course
 
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalBuilding modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
 
Using Databases and Containers From Development to Deployment
Using Databases and Containers  From Development to DeploymentUsing Databases and Containers  From Development to Deployment
Using Databases and Containers From Development to Deployment
 
Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)
Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)
Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)
 
London DevOps Meetup - PaaS as a platform for devops
London DevOps Meetup - PaaS as a platform for devopsLondon DevOps Meetup - PaaS as a platform for devops
London DevOps Meetup - PaaS as a platform for devops
 
A Technical Deep Dive on Protecting Acropolis Workloads with Rubrik
A Technical Deep Dive on Protecting Acropolis Workloads with RubrikA Technical Deep Dive on Protecting Acropolis Workloads with Rubrik
A Technical Deep Dive on Protecting Acropolis Workloads with Rubrik
 
JCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptxJCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptx
 
ITCamp 2013 - Adrian Stoian - Whats new in ConfigMgr 2012 SP1
ITCamp 2013 - Adrian Stoian - Whats new in ConfigMgr 2012 SP1ITCamp 2013 - Adrian Stoian - Whats new in ConfigMgr 2012 SP1
ITCamp 2013 - Adrian Stoian - Whats new in ConfigMgr 2012 SP1
 
IBM & Veeam: Bridging the availability gap
IBM & Veeam: Bridging the availability gapIBM & Veeam: Bridging the availability gap
IBM & Veeam: Bridging the availability gap
 
IBM's Cloud Storage Options
IBM's Cloud Storage OptionsIBM's Cloud Storage Options
IBM's Cloud Storage Options
 

Mehr von ITCamp

ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UXITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp
 

Mehr von ITCamp (20)

ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
 
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
 
ITCamp 2019 - Peter Leeson - Managing Skills
ITCamp 2019 - Peter Leeson - Managing SkillsITCamp 2019 - Peter Leeson - Managing Skills
ITCamp 2019 - Peter Leeson - Managing Skills
 
ITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
ITCamp 2019 - Mihai Tataran - Governing your Cloud ResourcesITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
ITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
 
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UXITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
 
ITCamp 2019 - Florin Coros - Implementing Clean Architecture
ITCamp 2019 - Florin Coros - Implementing Clean ArchitectureITCamp 2019 - Florin Coros - Implementing Clean Architecture
ITCamp 2019 - Florin Coros - Implementing Clean Architecture
 
ITCamp 2019 - Florin Loghiade - Azure Kubernetes in Production - Field notes...
ITCamp 2019 - Florin Loghiade -  Azure Kubernetes in Production - Field notes...ITCamp 2019 - Florin Loghiade -  Azure Kubernetes in Production - Field notes...
ITCamp 2019 - Florin Loghiade - Azure Kubernetes in Production - Field notes...
 
ITCamp 2019 - Florin Flestea - How 3rd Level support experience influenced m...
ITCamp 2019 - Florin Flestea -  How 3rd Level support experience influenced m...ITCamp 2019 - Florin Flestea -  How 3rd Level support experience influenced m...
ITCamp 2019 - Florin Flestea - How 3rd Level support experience influenced m...
 
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
 
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The EnterpriseITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
 
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal TrendsITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
 
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data LakeITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
 
ITCamp 2019 - Andy Cross - Business Outcomes from AI
ITCamp 2019 - Andy Cross - Business Outcomes from AIITCamp 2019 - Andy Cross - Business Outcomes from AI
ITCamp 2019 - Andy Cross - Business Outcomes from AI
 
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud StoryITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
 
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
 
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
 
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go NowITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
 
ITCamp 2019 - Peter Leeson - Vitruvian Quality
ITCamp 2019 - Peter Leeson - Vitruvian QualityITCamp 2019 - Peter Leeson - Vitruvian Quality
ITCamp 2019 - Peter Leeson - Vitruvian Quality
 
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World ApplicationITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
 
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

ITCamp 2011 - Alessandro Pilotti - Optimizing ASPNet and PHP apps on IIS 7.5

  • 1. Optimizing ASP.Net and PHP Web Applications on IIS 7.5 Alessandro Pilotti info@cloudbasesolutions.com MVP / IIS MCSD (VS 6.0 & .Net), MCAD, MCSE, MCDBA, MCT, RHCE, SCJP2 Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 2. IT Camp 2011 • Thanks for coming! • ITCamp is made possible by our sponsors: Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 3. Session agenda • IIS 7.5 Architecture • WebPI • FastCGI • Wincache Extensions for PHP • Output Caching • Application Request Routing • AppFabric Caching • Session management in PHP & SQL Server Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 4. Architecture - IIS 6 Web Request • Monolithic Authentication • Extension via NTLM Basic Anon ISAPI ony … CGI Determine Static Handler File ASP.NET ISAPI … PHP Send Response Log Compress Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 5. Architecture IIS 7.5 Web Request • Features separated in NTLM Basic modules Authentication Anon – More than 40 Authorization … • Modules fit in a ResolveCache CGI … common pipeline Static File • Modules employ Determine Handler ISAPI common API … UpdateCache • Managed or Compress unmanaged Send Response Log Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 6. Anatomy of a Request in IIS 7.x • HTTP .sys receives the request • WAS • applicationHost .config • WWW service • HTTP .sys config • W3WP • WP execution • Response Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 7. Request – W3WP details Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 8. WAS and W3SVC Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 9. versioning • IIS 5.0 – Windows 2000 • IIS 5.1 – Windows XP • IIS 6.0 – Windows Server 2003 • IIS 7.0 – Windows Vista / Server 2008 • IIS 7.5 – Window 7 / Server 2008 R2 Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 10. Web Platform Installer 3 • Single tool to easily deploy: – Frameworks – Extensions – Tools – Applications • E.g.: DNN, Joomla, etc • Always updated Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 11. WEB PI 3 Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 12. Web PI 3 Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 13. Web PI 3 Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 14. Web Platform Installer DEMO Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 15. FastCGI 1.5 • Very popular in the Apache environment, for PHP Perl, , Ruby, etc • CGI is slow: every request generates a process instance! • FastCGI employs the same process for many requests • Supported on IIS 7.x and IIS 6.0 (the latter via fcgiext.dll ISAPI) • Written in collaboration with Zend (PHP) but is generic • In IIS 7.x: Enable CGI among the IIS role services • Note: Install Hotfix KB980363 on IIS 7.0 to get version 1.5! Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 16. FastCGI Setup Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 17. FastCGI – version differences Feature 5.1/6.0 7.0 7.5 Monitoring file changes Yes Yes Yes Real-Time max Inst. tuning Yes Yes Yes STDERR support Yes Yes Yes SIGTERM support Yes Yes Yes Env. variable _FCGI_X_PIPE_ Yes Yes Yes Proc. Pool per application Yes Yes Yes UTF-8 variable encoding Yes Yes No IIS CPU Limit support No Yes Yes Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 18. FastCGI - PHP • Install PHP 5.2 or 5.3 – During setup choose FastCGI • As an alternative, deploy via WebPI • WP3P.exe – Loads iisfcgi.dll – Executes php-cgi.exe • Config: PHP.INI – E.g.: fastcgi.impersonate = 1 Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 19. PHP on IIS – other options • ISAPI – Previous choice – Low reliability due to reentrance problems – DLL loaded at W3SVC instance level • Security issues!! • CGI (not FastCGI!) – Awful performance Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 20. PHP on IIS - Performance • PHP gets compiled at runtime – Reads source file and generates bytecode – Process repeated at each request • Not a problem for small loads • Huge bottleneck otherwise – Various solutions available – Now (PHP 5.x) no one available natively Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 21. PHP Accelerators • Tools whose purpose is to improve the PHP execution time • Most popular available: – APC (default on PHP 6.0) – eAccelerator – Zend Server – Windows Cache Extension for PHP Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 22. WinCache for PHP • Open source project developed by Microsoft • IIS Specific • Requires PHP 5.2 or 5.3 x86 – Non thread safe version • Provides features not available in APC and other accelerators Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 23. WinCache for PHP • Setup – Web Platform Installer – Direct download – Source code • PHP configuration .ini – extension = php_wincache.dll – Verify setup with phpinfo() – maxInstances = 0 for best performance! Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 24. WinCache for PHP • PHP Bytecode Cache – Subsequest calls to a script employ precompiled and cached bytecode • PHP scripts loaded in memory – Reduced I/O, mainly for UNC Paths! • Cache handled via Shared Memory • Absolute path caching – Optimizes the time required to resolve relative paths • Cache based session handler – By default PHP uses a file system based solution Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 25. WinCache for PHP • User cache – wincache_ucache_set(key, value) – wincache_ucache_get(key) – Etc • User Cache session handler – session.save_handler = wincache Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 26. FastCGI / PHP / WinCache DEMO Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 27. IIS 7.x Output Caching • Very efficient way to optimize an application • There 2 type of contents – Static – Dynamic • Based on a degree of dynamism and determinism – Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 28. IIS 7.x Output Caching • IIS provides two caching policies – User mode (IIS 7.x worker process) – Kernel mode • Cache in HTTP.sys memory • Faster! • Parameter based (header, QueryString) • Not to be confused with ASP.Net output caching! Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 29. Kernel Caching - limits • No user mode modules or features – E.g. Authentication • varyByQueryString parameter not supported • Management: – netsh http show cache – Netsh http delete cache … Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 30. IIS 7.x Output Caching • Caching can be enabled for static and “semi-dynamic” content • Caching enabled for each site – Via UI – Via Command Line (appcmd) Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 31. Caching Rules • IIS decides if “it is worth” to cache some content • Parameters – frequentHitTimePeriod • Default 10s – frequentHitThreshold • Default 2 • ServerRuntime in applicationHost.config Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 32. ServiceRuntime sample <system.webServer> <serverRuntime enabled="true" frequentHitThreshold="5" frequentHitTimePeriod="00:00:20" /> </system.webServer> Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 33. Output Caching DEMO Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 34. Application Request Routing (ARR) 2.5 • Based on the URL Rewrite module • Enhances Availability and scalability • Load balancing • Health monitoring • Client Affinity • Works at level 5 ISO/OSI – Can work with a NLB (level 3) solution • ARR 2 introduces a caching option Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 35. Load balancing Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 36. Creating a Web Farm Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 37. Server farm config Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 38. Application Request Routing DEMO Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 39. AppFabric • Extension with two separated main areas – WCF and WF service housing MSDN video (in Italian  ) http://www.microsoft.com/italy/beit/Generic.aspx? video=1a5e02e4-c881-4ef9-ac86-61dd7a370f70 – Distributed Cache • Solution to increase scalability and performance Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 40. AppFabric Cache - Scalability • The problem: – Increasing load, means distributing it on more hosts – ARR is not a data oriented tool – The cache works at a data level • Other advantages: – Works also as a session provider – It can be integrated in EF as a 2nd level cache Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 41. AppFabric Cache Architecture Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 42. AppFabric Setup Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 43. AppFabric Cache Cluster • Fault tolerant solution • Every host keeps a replicated copy of the data • Doesn’t require Windows Clustering • Configuration based on the “leadHost” concept – Host delegated to “master” the cluster configuration Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 44. AppFabric Cache Cluster • Configuration can be kept on: – SQL Server • LeadHost not required – Shared storage + XML file • LeadHost required – Custom provider • LeadHost can be redundant • Note: SQL / storage can become a single point of failure! (valutare cluster etc) Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 45. AppFabric Cache TCP/IP • Replication: 22236 • Arbitration: 22235 • Cluster: 22234 • Cache: 22233 Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 46. AppFabric Cache Client • Any .Net 3.5 o 4.0 • Install the “Cache Client” feature only • In Visual Studio, register: – Microsoft.ApplicationServer.Caching.Client – Microsoft.ApplicationServer.Caching.Core • Assembly available in – %systemroot%System32AppFabric • Sostituire con SysWOW64 se x86 su x64 Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 47. AppFabric Cache client session • Enabling AppCache as a session provider in web.config <sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider”> <providers> <add name="AppFabricCacheSessionStoreProvider” type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider, Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35” cacheName="TestWPC” sharedId="DemoApp1"/> </providers> </sessionState> Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 48. PowerShell • Start-CacheCluster • New-Cache • Grant-CacheClientAllowedAccount • Get-Cache • Get-CacheStatistics Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 49. Concurrency models • Optimistic – Versioning – Version number checked during a Put operation • Pessimistic – Lock – Watchout for performance issues… – Note: Put doesn’t check for locks! Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 50. AppFabric Cache DEMO Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 51. PHP + MSSQL Sessions • Scaling out an application on a web farm requires proper session management • Tipically offloaded to a database or a state server • ASP .Net offers ready made solutions • PHP can be extended implementing a small number of documented callbacks Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 52. PHP + MSSQL Sessions • SQL Server Drivers for PHP 1.1 – Installable also via WebPI (recommended) • In PHP.ini – extension=php_pdo_sqlsrv.dll – session.save_handler = user • PHP handler to implement: – session_set_save_handler Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 53. PHP + MS SQL Server Session handling DEMO Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 54. Q&A Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  • 55. Don’t forget! Get your free Azure pass! We want your feedback! • 30+15 days, no CC req’d • Win a WP7 smartphone – http://bit.ly/ITCAMP11 – Fill in your feedback forms – Promo code: ITCAMP11 – Raffle: end of the day Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro