Docstoc

IIS 7.0 Performance and Best Practices

Document Sample
IIS 7.0 Performance and Best Practices Powered By Docstoc
					Clint Edmonson
Architect Evangelist
Microsoft Corporation
Offer a menu of server configurations to
developers (and create using separate app pools)
 Provide a copy of server's ASP.NET config files
to developers
 Require a load test before allowing apps into
production (at least the home page)
 Implement a server change request and tracking
system
 Don't allow developer access to production
servers
Use an n-tiered architecture (e.g. web tier, service
tier, and database tier)
  Keep your UIs dumb
  Develop a set of shared enterprise components
& services
   Security (Authorization, Authentication)
   Event Logging & Notification
   Database Location & Access
   Service Location & Access
   Encryption
Don't hard code IP addresses, use DNS names
 Assume your app will be running in a web farm
 Assume you'll be sharing resources with other
web apps
 Assume your app will be restarted on a regular
basis
 Minimize your web.config complexity
Shawn Travers
IT Pro Evangelist
Microsoft Corporation

http://blogs.technet.com/shawnt
                                                                                        Publishing
                                 Application                    Health and
                                Development                     Diagnostics
                                 .NET Extensibility                  HttpLogging

                                    ISAPIFilter                  RequestMonitor
                                                                                       Performance
                                 ISAPIExtension

                                     ASP.Net                                            StaticCompression




                                                                                       Management
                                                                                       Management Console



Core HTTP Server Components
  DirBrowsing    HttpRedirect      DefaultDoc         CustomErrors        StaticFile



Process Model (Windows Process Activation Service)
      ProcessModel              .Net Environment               Configuration API
Architecture changes
  Componentization
     Componentization reduces attack surface and allows for server “hardening”
     according to business needs
  Built-in accounts and groups
  SID injections for IIS_IUSRS group and worker process
  to help with site migration without security compromise
  Application Pool Isolation by default
New security management features for IT Pros
  Request Filtering rules
  URL Authorization rules
  Secure remote management via HTTPS
  Allow fine-grained control over feature delegation to
  non-web server administrators
                • 3.0 • Difficult       IIS
IIS 6.0, 5.0, 4.0,Decentralized to manage 7.0

                    • Difficult to replicate
            • Text based
                     • Machine-level IIS_schema.xml
            • Scriptable             depository
                    • Requires direct server access
            • Extensible
            • Understandable
 metabase.xml
            • Easy to deploy      machine.config
                                  applicationHost.config
            • Easy to delegate    web.config
.NET Framework settings                  Main IIS 7.0 settings

       machine.config                       applicationHost.config


  ASP.NET settings

       root web.config



   Sites                  Applications               Virtual Directories

       web.config              web.config                  web.config
Minimum Install by Default
XCopy Deployment
Built-in User Accounts
Shared Hosting
             • Install a module on the server
Installing     (native modules only)
Modules      • Enable the module in an application


 Using       • Manually edit the configuration store
Modules      • Use IIS Manager or appcmd.exe

             • Use only the modules you need
Selecting    • Replace core server modules with
Modules        custom modules
                              Unified Design
                              ModularCore
                              ServerPipeline
                              • Same pipeline serves
                              • Completely modular
          Unified             • No unnecessary
          Pipeline              content for all
                                web server handlers
                              • overhead
                                Mappath algorithm
                              • New native
                              • Designed for remote
                              • Managed Request
                                extensibility model
                                batching
                                administration
                              • .NET extensibility
Modular                       • Configuration cache
Design               Server   • support static
                                Improved
                      Core     compression
Connection Type            Connection Speed           5KB Pages per Second
PPP/SLIP via modem         28.8 Kbps                  About half of 1 page
Frame Relay/fast modem     56 Kbps                    Almost 1 page
ISDN        Traffic Type   128 Kbps     Bytes Sent    Just over 2 pages
Typical DSLTCP connection 640 Kbps      180 (approx.) Almost 11 pages
DS1/T1      GET request    1.536 Mbps 256 (approx.) 26 pages
10-megabit Ethernet
           5-KB file                    case)
                           8 Mbps (best 5,120         (Up to) 136 pages
DS3/T3                      44.736 Mbps 1,364 (approx.)760 pages
            Protocol overhead
OC1         Total                                    880
                           51.844 Mbps 6,920 (55,360 bits)pages
100-megabit Ethernet       80 Mbps (best case)        (Up to) 1,360 pages
OC3                        155.532 Mbps               2,650 pages
OC12                       622.128 Mbps               10,580 pages
1-gigabit/sec Ethernet     800 Mbps (best case)       (Up to) 13,600 pages
Utilize the Network Card
• Offload TCP processing
• Resources and interrupt moderation

Tune TCP Parameters
• Receive Window
• Compound TCP

Measure Performance
• NttTCP
• Extended TCP statistics
                                                 Backup
                                                 Settings
Streamline IIS and                              and Clear
Web Applications                                  Cache


  Optimize the              Keep the
  Network                     New                                  Change
                            Setting or                            one Setting
                             Revert

    Optimize Disk I/O

      Optimize Operating
      System for Server
                                   Compare to               Benchmark
                                    Previous                 with New
        Benchmark Default          Benchmark                  Setting
        Settings First
                                                                 ASP.NET
                      Trim and
  HTTP                                     Application          Thread Pool
                     Consolidate
Compression                               Streamlining          Configuration
                      Content
                                                                  Options
                                          Minimize roundtrips
                     Reduce image file           < 10            Maxconnection
Static compression        size
   is enabled by                             Minimize data
       default                              transfer < 100K
                                                                maxWorkerThreads
                                          Limit query results   and maxIoThreads
                     Remove extraneous
                           data            Limit calls to Web
                                               Services         maxconnection and
                                                                 minFreeThreads
 Enable dynamic                            Turn off tracing /
 compression if                                 debug
CPU load permits                                                   Ensure that
                      Consolidate files                         maxWorkerThreads
                                          Minimize View state   – minFreeThreads
                                                                      >=12.
Segregate demand
 (content versus
    database)


    Estimate
   aggressive
   throughput
  requirements


Work with vendor
 for appropriate
 storage design
 Tracing
Log File
Microsoft.com sees a 10% performance improvement
overall
More powerful compression
  For static and dynamic content
Default Document optimization
Output Caching
  Per URL, query string and/or request headers
  APIs for putting responses in the output cache
Kernel mode SSL and Windows authentication
  Performance improvements
Improved Scalability
  Host thousands of sites for multi-tenancy scenarios
FastCGI
  Great way to run PHP on IIS
Enable Output Caching for semi-dynamic pages
Low bandwidth Branch Offices?
  Enable Dynamic Compression (~ 5% CPU overhead)
Need to run many web apps on a single box?
  Run IIS worker processes in Wow64 mode
    Room for the OS, scalability for your web apps
    It’s an per-AppPool setting now: Enable32BitAppOnWow64
Thinking about buying new Web Server
hardware?
  W2K8 scales extremely well on new multi-proc boxes
  (4 and 8 core)
ASP.NET op caching vs. IIS op caching vs. KM
output caching
1000s of requests per second?
  Remove modules you don’t need
You don’t know why some pages are so slow?
  Turn on Failed Request Tracing and the “time-taken”
  feature to investigate
You * script-mapped all requests to ASP.NET in
IIS6?
  Integrated Pipeline is much faster than an IIS6 *
  scriptmap solution
  Try together with IIS7 URL Authorization.
PHP applications?
  PHP on top of FastCGI is much faster than traditional
  CGI
The majority of your requests go to your Default
Document?
  Put it on top of the list
     Otherwise IIS7 has to check every time
     Static default documents will be cached in kernel-mode
Looking for tools to measures web server
performance?
  Try WCAT 6.3 from www.iis.net/downloads
Better compression for static and dynamic
content, as well as output caching
Kernel-mode improvements
Security by default with application isolation and
built-in accounts and groups
Best practices for IT pros like putting default
documents at the top of the list
Improved scalability for multi-tenancy scenarios
(high site density)
Improved support for application frameworks like
PHP and Python with FastCGI
                                                TechNet Plus
TechNet Plus is an essential premium web-enabled and live support resource that provides IT Professionals with fast
and easy access to Microsoft experts, software and technical information, enhancing IT productivity, control and
planning.


         Evaluate & Learn                                Plan & Deploy                           Support & Maintain


   Evaluate full versions of all Microsoft        Use the TechNet Library to plan for         2 complimentary Professional Support
   commercial software for evaluation—            deployment using the Knowledge Base,        incidents for use 24/7 (20% discount on
   without time limits. This includes all         resource kits, and technical training       additional incidents)
   client, server and Office applications.
                                                  Use exclusive tools like System Center      Access over 100 managed newsgroups
   Try out all the latest betas before public     Capacity Planner to accurately plan for     and get next business day response--
   release                                        and deploy Exchange Server and System       guaranteed
                                                  Center Operations Manager
   Keep your skills current with select                                                       Use the TechNet Library to maintain your
   Microsoft E-Learning courses free each         Stay informed with your free subscription   IT environment with security updates,
   quarter                                        to TechNet Magazine.                        service packs and utilities




Get all these resources and more with a TechNet Plus subscription.
For more information visit: technet.microsoft.com/subscriptions


                         CODE: TMSAM12
Learn                                Plan & Deploy                           Support & Maintain


   Evaluate full versions of all Microsoft        Use the TechNet Library to plan for         2 complimentary Professional Support
   commercial software for evaluation—            deployment using the Knowledge Base,        incidents for use 24/7 (20% discount on
   without time limits. This includes all         resource kits, and technical training       additional incidents)
   client, server and Office applications.
                                                  Use exclusive tools like System Center      Access over 100 managed newsgroups
   Try out all the latest betas before public     Capacity Planner to accurately plan for     and get next business day response--
   release                                        and deploy Exchange Server and System       guaranteed
                                                  Center Operations Manager
   Keep your skills current with select                                                       Use the TechNet Library to maintain your
   Microsoft E-Learning courses free each         Stay informed with your free subscription   IT environment with security updates,
   quarter                                        to TechNet Magazine.                        service packs and utilities




Get all these resources and more with a TechNet Plus subscription.
For more information visit: technet.microsoft.com/subscriptions


                         CODE: TMSAM12

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:27
posted:8/25/2012
language:English
pages:26