Windows Azure Acid Test

  • 1,658 views
Uploaded on

Presentation delivered by Matt Done, Head Of Platform Development at expanz Pty. Ltd. during DDD Sydney event on 2 July 2011. …

Presentation delivered by Matt Done, Head Of Platform Development at expanz Pty. Ltd. during DDD Sydney event on 2 July 2011.
Matt demonstrates what it takes to setup a highly sophisticated load test, using the Azure environment and how to use the results to optimise a fully blown application development platform and application server running on Azure.
Recording of this presentation can be found at www.youtube.com/expanzTV

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • recorded video can be found here: http://vimeo.com/26261446
    Are you sure you want to
    Your message goes here
    Be the first to like this
No Downloads

Views

Total Views
1,658
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
12
Comments
1
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • DB Transactions are free for internal apps. Data transfer is 10c per 1gb. MSDN includes 5gb
  • vvvv
  • During our Private Beta Program we are looking for thought leading developers for trialling an exclusive preview of our next generation Line Of Business (LOB) Application Development Platform, the ‘expanzPLATFORM 2011’ (eP).Though we’re a small Aussie start-up, we’ve achieved some pretty cool stuff already. Analyst RecognitionOne of six companies global by Gartner as a ‘cool vendor’.Proof Of Conceptwe built and run a multi-tenant, multi device, multi general ledger ERP SaaS app with eP which is live on Azure and used by large Australian distribution companies. Mission Critical ProjectLogica built and deployed the app that counted all votes for the recent NSW 2011 State Election, using eP.Our core values to developers areProductivity extreme code reuse / inheritancemetadata driven framework (rather than code gen)business logic is all on the server side and supports any clientPortability Client – Native Thin UX on any client/device Server - Premise/Hosted/Cloud (Windows)If you believe great design and architecture matters, that writing code (preferably once) is the best way to handle complexity, then you’ll enjoy getting under our hood. To join and qualify for your free perpetual license, please email us at beta@expanz.com with ‘DDD Attendee’ in your subject line before 22 July 2011.

Transcript

  • 1. Windows AzureAcid Test!DDD Sydney, 2 July 2011
    Matt Done, expanz Pty. Ltd.
  • 2. Agenda
    Presentation Overview
    What is Azure and SQL Azure
    Goals of the Load Test
    Testing Setup
    Test Results
    Cost Comparisons
    Live Demo
    Questions
  • 3. Presentation Overview
    Topics
    Load testing in Windows Azure and the various benefits it brings
    Horizontally Scalable, Stateful computing.
    High performance WCF (Windows Communications Foundation)
    Intended Audience
    Enterprise Architects, Solution Architects
    Developers involved in large scale applications
    People who love Azure!!
  • 4. What is Windows Azure
    • Microsoft Cloud Based Platform as a Service (PaaS)
  • What is SQL Azure
    • Microsoft Cloud Based Database as a Service (DBaaS)
  • Goals of the load test
    • To prove the efficiency of the expanz Platform under load of 10000+ concurrent users.
    • 5. Have an environment to tweak performance settings and to find potential bottlenecks.
    • 6. To assess how the Azure platform performs under load.
    • 7. To assess how SQL azure performs under load.
  • Application Architecture
  • 8. Load Testing Architecture
  • 9. Azure Load Test Costs
    Load Testing Setup Cost
    Total Cost = $15.71 per hour
  • 10. Local Debug
  • 11. Local/Remote Debug
    Problem
    • Need to test and locally debug
    • 12. Azure will not accept remote connections
    Solution
    Install SSH server (Putty, BitVise)
    Start azure compute emulator
    Start local client
    Start SSH client and port forward to Web service port on remote machine
    Start testing
  • 13. (Very) Simple Banking App
  • 14. Load Test Setup
  • 15. Database Setup
    Table Sizing
    Indexes
    • Non Clustered Index on [dbo].[Transactions], Columns account_id, [transactiondate]
    • 16. Non Clustered Index on [dbo].[Transactions], Columns [billingaddressbook_id]
    • 17. Non Clustered Index on [dbo].[Transactions], Columns [account_id]
    • 18. Non Clustered Index on [dbo].[BillingAddressBooks], Columns [user_id]
    Considerations
    • Make sure the Database resides at the same location as your application
  • Load Test Execution
    • Record trace of required processes
    • 19. Allocate percentage execution for each process
    • 20. Determine wait time figure (100ms or 1 sec)?
    • 21. Each execution waits a random amount of time, based on processExecutionDelay. Thread.Sleep(myRandom.Next(processExecutionDelay));
    • 22. Each User session is a single thread. 2500 users = 2500 threads.
  • Web Service Request/Response Capture
    DesignObjectives
    • Do not log to SQL Azure database
    • 23. Do not log to file system
    • 24. Preserve thread pool threads for load test execution
    • 25. Preserve bandwidth and CPU as little as possible
    Solution
    • Use SQL Azure table storage
    • 26. Capture Request/Responses and send to Site Manager
    • 27. Site Manager will process and commit records
    • 28. Use actual threads and not thread pool threads
    Issues
    • Batch table storage requests in lots of 20-50 and use SaveChangesWithRetries
    • 29. Use Thread.Startinstead of  ThreadPool.QueueUserWorkItem
    • 30. Datetime.Now only accurate to 15-20ms. Use StopWatchclass
  • Capturing Diagnostics in Azure
    • Azure has an API for logging diagnostic information to TableStorage
    • 31. Counter names are normal windows counter. Eg@"Processor(_Total)% Processor Time" , @"MemoryAvailable MBytes"
    • 32. Data can be viewed with Cerebrata Diagnostics Studio (Demo)
  • Load Test Results (First Cut)
    Application Instances Setup
    Load Test Instance Setup
    • 1 Extra Large Instance
    • 33. 4 Geographic locations
    • 34. 5 Large Web Services
    • 35. 1 Large Site Manager
    • 36. 5 Large Session Managers
    Large Instance = 4 x 1.6 GHz cpu’sand 7 GB of ram
    Test Result Summary
    Run duration = 32 Minutes
    Total Transactions = 1.89 Million
    Average Number of Transactions per Minute = 59767
    Average WS Response Time = 70ms
    Average CPU Utilisation (App Servers) = 30%
    Min Memory (App Servers) = 4Gb
    NOT GOOD ENOUGH. NEED MORE!!!
  • 37. Load Test First Cut Investigation
    • WCF Web services are not multithreaded by default
    [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
    • When enabling multiple concurrency, throttling is important
     <serviceThrottling maxConcurrentSessions="400"  maxConcurrentInstances="400" maxConcurrentCalls="400" />
    • When using Channel Factories, max number of open concurrent connections is 10.
    • 38. Adjust max concurrent connections when using TCP or Named pipe bindings, is 2.
    <system.net>   
      <connectionManagement>      
    <add address="*" maxconnection="500"/>   
      </connectionManagement> 
    </system.net>
    • Azure load balancer is not throttling connections. Throttle Connections using ServicePointManager.DefaultConnectionLimit in Web Role
    • 39. Avoid closing factory connections in a finally block. Or do both.
  • The channel factory, factory
    Problem
    • Limit of 10 open connections.
    • 40. For singleton to singleton operations, comms is problematic
    • 41. Aborted and faulted channels
    Solution
    • Create a factory of channel factories(pooling)
    • 42. Needs to be Muti-threaded.
    Couple of Cool and not so cool things (Code)
    • Parallel Linq (PLinq)
    • 43. To get a Service Channel Guid Use the following
    ((IClientChannel)channel).SessionId
    • Concurrent Collections. Not so cool.
  • Run 2,3,4…
    Application Instances Setup
    Load Test Instance Setup
    • 5 Medium Instances
    • 44. 4 Geographic locations
    • 45. 10 Large Web Services
    • 46. 1 Extra Large Site Manager
    • 47. 8 Large Session Managers
    Large Instance = 4x 1.6 GHz cpu’sand 7 GB of ram
    Test Result Summary
    Run duration = 30 Minutes
    Total Transactions = 7.8 Million
    Average Number of Transactions per Minute = 161245
    Max Transactions per Minute = 211589
    Error Rate = 0.014%
    Average Web Service response time = 39ms
    Average CPU Utilisation (App Servers) = 70%
    Min Memory (App Servers) = 4Gb
    Total Cost = $12.88 per hour
  • 48. Headline Results
  • 49. Time line
    Default WCF Settings. 5 Instances
    Default WCF Settings. 10 Instances
    Multithreaded Service. Per Session Context
    Create Channel Factory Factory
    Raise tcp Connections limit
    Adjust Instance Counts
  • 50. Demo
    • Live Diagnostics
    • 51. Live Table Storage
    • 52. Live working client
    • 53. Please find full recording of my session at
    www.youtube.com/expanzTV
  • 54. Thank you for following my presentation!
    Please take the time to have a look at the next slide with an exclusive invitation for DDD attendees from expanz as a DDD sponsor.
  • 55. BETA
    Perpetual License exclusively for DDD Attendees
    During our Private Beta Program expanz are looking for thought leading developers for trialling an exclusive preview of their next generation Line Of Business (LOB) Application Development Platform, the ‘expanzPLATFORM 2011’
    As a DDD Melbourne, Sydney or Adelaide attendee, you qualify for participating in our Private Beta program. To join and receive your free perpetual license after launch, please email us at beta@expanz.com with
    ‘DDD Attendee’ in your subject line before 22 July 2011.