Web-application's performance testing Ilkka Myllylä


Published on

1 Comment
  • Thanks for sharing your views dear.This is very usefully for me and to read about the Performance Testing Guidance for Web Applications from testingsorttricks.wordpress.com
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Web-application's performance testing Ilkka Myllylä

  1. 1. Web-application’s performance testing Ilkka Myllylä Reaaliprosessi Ltd
  2. 2. Agenda <ul><li>Research results about web-application scalability </li></ul><ul><li>Performance requirements specification </li></ul><ul><li>Load testing tools </li></ul><ul><li>Load test preparation </li></ul><ul><li>Load test execution </li></ul><ul><li>Analysis </li></ul><ul><ul><li>What is bottleneck and how to find it ? </li></ul></ul><ul><ul><li>Optimization and tuning </li></ul></ul><ul><ul><li>What is root cause and how to fix it ? </li></ul></ul>
  3. 3. Research results about web-application scalability
  4. 4. Is scalability problem ? <ul><li>Research results (Newport Group Inc.) </li></ul><ul><li>Scalability in production </li></ul><ul><ul><li>as required 48% </li></ul></ul><ul><ul><li>worse than requirements 52% (average 30%) </li></ul></ul><ul><li>Late from timetable and costs overrun </li></ul><ul><ul><li>as required 1 month and 70 000 euros </li></ul></ul><ul><ul><li>worse 2 months and 140 000 euros </li></ul></ul><ul><li>What explains bad results ? </li></ul><ul><ul><li>performance testing timing is most important factor </li></ul></ul>
  5. 5. Performance testing timing
  6. 6. Early start of testing is profitable <ul><li>Efficiency </li></ul><ul><ul><li>one and 2-5 user tests show average 80% of bottlenecks </li></ul></ul><ul><li>Costs </li></ul><ul><ul><li>late fixing costs many times more -> wrong architecture risk for example </li></ul></ul>
  7. 7. When to test performance ? <ul><li>Architecture validation </li></ul><ul><li>Component performance </li></ul><ul><li>New application system performance test </li></ul><ul><li>Major changes to application made </li></ul>
  8. 8. Realistic performance testing is not easy <ul><li>Too optimistic results are common problem </li></ul><ul><ul><li>” It worked in tests !” says 32 % (Gartner Group) </li></ul></ul><ul><li>Bad environment </li></ul><ul><ul><li>Testing environment not equal to production </li></ul></ul><ul><li>Bad design + implementation </li></ul><ul><ul><li>Load testing tool not used right way </li></ul></ul><ul><li>Wrong tool for a job </li></ul><ul><ul><li>Load test tool used not functional / does not include features needed </li></ul></ul>
  9. 9. Performance requirements specification
  10. 10. Performance requirements testability <ul><li>Requirements should be exact enough in order know how to test them </li></ul><ul><li>Usage information </li></ul><ul><ul><li>Different users and their profiles ? </li></ul></ul><ul><ul><li>Transaction amounts ? </li></ul></ul><ul><li>Response times </li></ul><ul><ul><li>Detailed response times requirements ? </li></ul></ul><ul><li>Technical constraints </li></ul><ul><ul><li>User terminals, software, connection speed ? </li></ul></ul><ul><ul><li>Technical architecture </li></ul></ul><ul><ul><li>Database size </li></ul></ul><ul><li>Security and reliability constraints </li></ul>
  11. 11. Completeness of requirements <ul><li>Sensibility check : Are customers requirements / calculations right and sensible ? </li></ul><ul><li>Completeness : What information is missing ? </li></ul><ul><ul><li>Checklist </li></ul></ul>
  12. 12. System usage information <ul><li>Goal : Real usage simulation that is close enough to reality </li></ul><ul><li>Business / use case scenarios are good starting point </li></ul><ul><li>Close enough ? </li></ul><ul><ul><li>Not all functions are tested but most important and most used are tested </li></ul></ul><ul><ul><li>3-5 scenarios is usually enough for one application </li></ul></ul><ul><li>Usage information : History info available ? </li></ul><ul><ul><li>Yes : Future scenarios ? </li></ul></ul><ul><ul><li>No : Estimation and calculation with known facts </li></ul></ul>
  13. 13. Transaction profile
  14. 14. User profiles
  15. 15. Does customers requirements / calculations make sense ? <ul><li>Expectations can be too high </li></ul><ul><ul><li>” Response time for all functions should be below 2 sec” </li></ul></ul><ul><ul><li>” In old system everything was very fast” </li></ul></ul><ul><li>Different functions are not equal </li></ul><ul><ul><li>requirements should be set individually for important use cases </li></ul></ul><ul><ul><li>and their functions </li></ul></ul><ul><li>Costs should be involved </li></ul><ul><ul><li>less response time, more costs </li></ul></ul><ul><ul><li>technically ”chalenging” requirements ? </li></ul></ul>
  16. 16. How long user is willing to wait ? <ul><li>Not simple thing </li></ul><ul><ul><li>different users have different requirements for same functions </li></ul></ul><ul><li>Research results (Netforecast Inc) </li></ul><ul><ul><li>two important factors : frequency and amount </li></ul></ul><ul><ul><li>strong variation between applications and functions </li></ul></ul><ul><ul><li>satisfactory average 10 s </li></ul></ul>
  17. 17. Frequency of use <ul><li>Frequency : How often user needs to use function ? </li></ul><ul><ul><li>more often user needs, less he/she is willing to wait </li></ul></ul><ul><li>Example 1 : Frequency </li></ul><ul><ul><li>Use case : Search customer info </li></ul></ul><ul><ul><li>A. Once a hour : requirement for response time 5 s </li></ul></ul><ul><ul><li>B. Once a month : requirement for response time 30 s </li></ul></ul>
  18. 18. Amount of information <ul><li>Amount : How much valuable information we get as result ? </li></ul><ul><ul><li>more information one get, more he/she is willing to wait </li></ul></ul><ul><li>Example 2 : Amount </li></ul><ul><ul><li>A. Saving function for few input fields : requirement for response time 3 s </li></ul></ul><ul><ul><li>B. Search function for product information (100 fields) : requirement for response time 10 s </li></ul></ul>
  19. 19. Response time requirements
  20. 20. Performance requirements in contracts <ul><li>Requirements for performance testing </li></ul><ul><ul><li>Appendix about performance requirements </li></ul></ul><ul><ul><li>Test engineer validate testability </li></ul></ul><ul><ul><li>Both customer and supplier benefit </li></ul></ul><ul><li>Good for customer </li></ul><ul><ul><li>No extra costs late in development cycle </li></ul></ul><ul><li>Good form supplier </li></ul><ul><ul><li>No new ”surprise” requirements late in development cycle </li></ul></ul><ul><li>What about performance testing tools ? </li></ul><ul><ul><li>expensive investment </li></ul></ul>
  21. 21. Load testing tools
  22. 22. Types of performance testing <ul><li>Concurrency </li></ul><ul><ul><li>one to several users concurrently in risk scenarios </li></ul></ul><ul><ul><li>manual testing normally </li></ul></ul><ul><li>Performance </li></ul><ul><ul><li>requirements for scalability ? </li></ul></ul><ul><ul><li>load testing tool needed </li></ul></ul><ul><li>Load </li></ul><ul><ul><li>max number of users ? </li></ul></ul><ul><li>Reliability </li></ul><ul><ul><li>long usage possible without degrading performance ? </li></ul></ul>
  23. 23. Load testing tools - markets <ul><li>Mercury Interactive market leader (> 50%) </li></ul><ul><li>Big six have 90% of markets </li></ul><ul><li>100’s of small companies </li></ul><ul><li>Prices for major tools quite high </li></ul><ul><li>Growing market </li></ul>
  24. 24. Load testing tools– options to get one <ul><li>Buy licence (+ consulting) </li></ul><ul><ul><li>usually virtual user count pricing </li></ul></ul><ul><li>Buy service </li></ul><ul><ul><li>load generation externally </li></ul></ul><ul><li>Rent licence (+ consulting) </li></ul><ul><ul><li>need for only limited time and maybe for just this one project </li></ul></ul>
  25. 25. Load testing tools – main functions <ul><li>Recording and editing scripts </li></ul><ul><li>Scenario design and running </li></ul><ul><li>Analysis and reporting </li></ul>
  26. 26. Load testing tools - features <ul><li>Lots of obligatory features </li></ul><ul><ul><li>script recording </li></ul></ul><ul><ul><li>parametrizing </li></ul></ul><ul><ul><li>scenario design </li></ul></ul><ul><ul><ul><li>ramp up and weighting </li></ul></ul></ul><ul><ul><ul><li>different scripts running concurrently </li></ul></ul></ul><ul><ul><li>online results / feedback </li></ul></ul><ul><ul><ul><li>error detection </li></ul></ul></ul><ul><ul><ul><li>transaction level response times </li></ul></ul></ul><ul><ul><li>http protocol support </li></ul></ul>
  27. 27. Load testing tools - features <ul><li>Lots of usually needed features </li></ul><ul><ul><li>Distributed clients </li></ul></ul><ul><ul><li>Unix/Linux clients </li></ul></ul><ul><ul><li>Multi protocol support </li></ul></ul><ul><ul><li>Multi speed support </li></ul></ul><ul><ul><li>Multi browser support </li></ul></ul><ul><ul><li>Server monitoring </li></ul></ul><ul><ul><li>Content validation </li></ul></ul><ul><ul><li>Dynamic urls supported </li></ul></ul>
  28. 28. Features - Make or buy <ul><li>Some features are possible to be done manually </li></ul><ul><ul><li>server monitoring </li></ul></ul><ul><ul><li>analysis and reporting </li></ul></ul><ul><li>Usability </li></ul><ul><ul><li>best tools are really easy to use </li></ul></ul><ul><ul><li>others need lots of work and ”programming experience” </li></ul></ul><ul><li>Workarounds </li></ul><ul><ul><li>more features than promised with clever trics </li></ul></ul>
  29. 29. Good tool combination <ul><li>Separate load and monitoring tool </li></ul><ul><ul><li>even from different vendor ? </li></ul></ul><ul><ul><li>how about profiling ? </li></ul></ul><ul><li>Script reusability </li></ul><ul><ul><li>same scripts for functional and load testing </li></ul></ul>
  30. 30. Load test preparation
  31. 31. Testing environment <ul><li>Same as production environment </li></ul><ul><ul><li>Other applications dividing same resources (firewall etc) ? </li></ul></ul><ul><li>Controllable </li></ul><ul><ul><li>No outside disturbance </li></ul></ul>
  32. 32. ” Basic” optimization made <ul><li>What is basic optimization ? </li></ul><ul><ul><li>Server parameters are validated by responsible persons and list of values given to load testers </li></ul></ul><ul><ul><li>Database : sql performance checked and necessary indexes exists </li></ul></ul><ul><li>Without basic optimization load test is waste of time </li></ul><ul><ul><li>just first obvious bottleneck is found and no real information exists </li></ul></ul>
  33. 33. Load test cases <ul><li>First each script separately with ramp-up usage </li></ul><ul><ul><li>easier to see what is problem straight away </li></ul></ul><ul><li>Real usage scenario with weighted scripts </li></ul><ul><ul><li>usually many test runs before goals are achieved’ </li></ul></ul><ul><ul><li>time for repeated tests </li></ul></ul><ul><ul><li>usual usage first then special occasions </li></ul></ul><ul><li>What-if scenarios </li></ul><ul><ul><li>one change at time to see influence of changing factor </li></ul></ul><ul><li>Risk based testing </li></ul><ul><ul><li>different location and speed testing </li></ul></ul><ul><ul><li>hacker testing -> Dos attack etc </li></ul></ul>
  34. 34. Script selection <ul><li>User or process scripts ? </li></ul><ul><ul><li>both are possible </li></ul></ul><ul><li>Example : Petshop application – user oriented </li></ul><ul><ul><li>Create order - returning customer </li></ul></ul><ul><ul><li>Create order - new customer </li></ul></ul><ul><ul><li>Searching customer </li></ul></ul><ul><li>Example : Petshop application – process oriented </li></ul><ul><ul><li>Registeration </li></ul></ul><ul><ul><li>Create order </li></ul></ul><ul><ul><li>Search order </li></ul></ul>
  35. 35. Script recording and editing <ul><li>Script = Program code (C, Perl etc) to execute test automatically </li></ul><ul><li>Basic recording </li></ul><ul><ul><li>execute test case with recording on </li></ul></ul><ul><ul><li>check and set recording options before start </li></ul></ul><ul><ul><li>generates script </li></ul></ul><ul><li>Editing </li></ul><ul><ul><li>parametrizing </li></ul></ul><ul><ul><li>transactions </li></ul></ul><ul><ul><li>think time changes </li></ul></ul><ul><ul><li>checkpoints </li></ul></ul><ul><ul><li>comments </li></ul></ul>
  36. 36. Parametrizing <ul><li>Recorded script includes hard coded input values </li></ul><ul><ul><li>If we execute load test with hard coded values results are not realiastic (too good or bad) </li></ul></ul><ul><li>Parametrizing = Different input values for different virtual users </li></ul><ul><ul><li>all users of system have different user information </li></ul></ul><ul><ul><li>more realistic load </li></ul></ul>
  37. 37. Test data generation <ul><li>Parameter data with right distribution </li></ul><ul><ul><li>Generation of test data to text files which load tools can use </li></ul></ul><ul><li>Real amount of data in databases </li></ul><ul><ul><li>Backup and restore procedures </li></ul></ul>
  38. 38. Transaction <ul><li>Detailed response time information inside script </li></ul><ul><li>Exact execution times and problem transactions could be seen </li></ul><ul><ul><li>script with 10 transactions -> when response time increase, are all the tranasactions equally slow or just some ? </li></ul></ul>
  39. 39. Checkpoint <ul><li>Functions in script that check correctness of results during execution </li></ul><ul><li>In some tools could be set automatically </li></ul><ul><ul><li>Others need manual implementation </li></ul></ul><ul><li>Find errors otherwise not seen </li></ul>
  40. 40. Think time <ul><li>Think time = Time user uses for looking and input before making next request to server </li></ul><ul><li>Important parameter when estimating usage </li></ul><ul><ul><li>Less think time means more frequent request and more load to servers </li></ul></ul><ul><li>Example </li></ul><ul><ul><li>100 users logged to system with 10 s average think time = 1 user 6 transactions/ minute and 100 users 600 t/min = 10 tps </li></ul></ul><ul><ul><li>If think time is 30 s load is 3 tps </li></ul></ul>
  41. 41. Comments <ul><li>Making and testing scripts = software development </li></ul><ul><ul><li>comments for meintenance </li></ul></ul><ul><ul><li>tools own naming is not always good -> changes needed to get readability </li></ul></ul>
  42. 42. Script testing <ul><li>Executing single script succesfully </li></ul><ul><ul><li>at least twice </li></ul></ul><ul><ul><li>with checkpoints and parameters </li></ul></ul>
  43. 43. Scenario creation and testing <ul><li>Usage information and ramp-up of different scripts in same scenario </li></ul><ul><li>Designed counters available and working for testing </li></ul><ul><li>Test run with couple of users </li></ul>
  44. 44. Ramp-up <ul><li>Ramp-up </li></ul><ul><ul><li>User amount increase little by little </li></ul></ul><ul><ul><li>In real life usually amounts does not change immediately </li></ul></ul><ul><ul><li>When user amount increase little by little, it is easy to see how response time and utilization develop </li></ul></ul><ul><ul><li>Stabilizing before next level of load </li></ul></ul><ul><li>Example : 1000 users use system at same time </li></ul><ul><ul><li>first 50 users then 50 more every 10 minutes until response time is bad or errors start to increase </li></ul></ul>
  45. 45. Collection of performance counters <ul><li>Responsiblity of getting performance counters is usually divided between </li></ul><ul><ul><li>administrators </li></ul></ul><ul><ul><li>developers </li></ul></ul><ul><ul><li>testers -> Load Tool monitors </li></ul></ul><ul><li>Load tool monitors should tested </li></ul><ul><ul><li>not always so easy to get information from servers as vendor says </li></ul></ul>
  46. 46. Load test execution
  47. 47. Reset and warm-up <ul><li>Reset situation </li></ul><ul><ul><li>Old tests should not influence </li></ul></ul><ul><li>Warm-up </li></ul><ul><ul><li>Before actual test, some usage need to done </li></ul></ul>
  48. 48. Synchronizing people involved <ul><li>Test manager gets ready from all people involved </li></ul><ul><li>When test ends syncronization again to stop monitors </li></ul><ul><li>Collection of results </li></ul>
  49. 49. Active online following <ul><li>Counters </li></ul><ul><ul><li>following online monitors </li></ul></ul><ul><ul><li>response time and throughput </li></ul></ul><ul><ul><li>client and server system counters (cpu, memory, disk) </li></ul></ul><ul><li>Error messages </li></ul><ul><ul><li>if lot of errors occured test should be stopped </li></ul></ul><ul><ul><li>errors occur often before application run out of system resourches </li></ul></ul>
  50. 50. Response time <ul><li>Most important counter for performance </li></ul><ul><li>Response time = time user needs to wait before able to continue </li></ul><ul><li>Industry standard for response time : 8 seconds </li></ul><ul><li>With response time usage information is needed too </li></ul><ul><ul><li>simultaneous user amount and what most of they are doing </li></ul></ul><ul><li>Example </li></ul><ul><ul><li>100 simultaneous sessions, 50% update and 50% search </li></ul></ul><ul><ul><li>Response time requirement 4 s to 95% of insert and update of bill insert. To other functions requirement is 8 s. </li></ul></ul>
  51. 51. Throughput <ul><li>Another important counter for validating scalability </li></ul><ul><li>Amount of transactions, events, bytes or hits per second </li></ul><ul><li>usual counter tps (=transaction per second) </li></ul><ul><li>Requirements could be told as throughput value </li></ul><ul><li>Bottleneck could be seen easily with saturation point of throughput </li></ul>
  52. 52. Throughput and response time
  53. 53. Performance ”knee”
  54. 54. What is bottleneck and how to find it ?
  55. 55. What is bottleneck and why it is important ? <ul><li>Any resource (software, hardware, network) which limits speed of application </li></ul><ul><ul><li>under requirements </li></ul></ul><ul><ul><li>from good to even better (changing requirements) </li></ul></ul><ul><li>Bootleneck is result </li></ul><ul><ul><li>reason should be analysed and fixed </li></ul></ul><ul><ul><li>for example disk i/o is bootleneck and fix is to distribute log file and database files to different disks </li></ul></ul><ul><li>” Chain is as strong as it’s weakest link” </li></ul><ul><ul><li>application is as fast as worse bottleneck permits </li></ul></ul>
  56. 56. How can we identify bottleneck ? <ul><li>Using application and measuring </li></ul><ul><ul><li>response time and throughput </li></ul></ul><ul><ul><li>resourche usage measuring </li></ul></ul><ul><li>One user </li></ul><ul><ul><li>ralative slowness and resourche utilization (= not yet bottleneck but possible to see that bigger amounts of users will couse one) </li></ul></ul><ul><li>Several users </li></ul><ul><ul><li>trends possible to see already (=1 user 1s, 5 users 3 s, 1000 users ? s) </li></ul></ul><ul><li>Required amount of users </li></ul><ul><ul><li>Actual max usage scenatio </li></ul></ul>
  57. 57. Not so nice features of bottleneck <ul><li>Real bottleneck influence load of other resources </li></ul><ul><ul><li>” everything influences everything” </li></ul></ul><ul><ul><li>when disk is bottleneck, processor looks like one too (but is not) </li></ul></ul><ul><ul><li>when real bottleneck is fixed other problem will be solved too </li></ul></ul><ul><ul><li>if we increase processor power, it does not help </li></ul></ul><ul><li>Real bottleneck ”create” other problems but hide them too </li></ul><ul><ul><li>first bottleneck should be solved in order to see next real bottleneck </li></ul></ul>
  58. 58. Amount and finding of bottlenecks <ul><li>One application has usually many bottlenecks </li></ul><ul><ul><li>many changes are needed in order to </li></ul></ul><ul><li>One test finds only one bottleneck </li></ul><ul><ul><li>many iterations are needed in order to fix all bottlenecks </li></ul></ul>
  59. 59. Most common bottlenecks in web-applications
  60. 60. Server counters and profiling <ul><li>What counters and log/profile information do we need in order see bottleneck and root cause ? </li></ul><ul><li>Two levels of counters </li></ul><ul><ul><li>system counters – cpu utilization % </li></ul></ul><ul><ul><li>application software counters – Oracle cache hit ratio % </li></ul></ul><ul><li>Log/profile information </li></ul><ul><ul><li>detail level resource usage information </li></ul></ul>
  61. 61. Collecting system counters <ul><li>Memory, CPU, network and disk counters could be collected </li></ul><ul><ul><li>with operating system dependent programs like Windows Performance monitor or Unixin sar,top etc </li></ul></ul><ul><ul><li>with load testing programs like LoadRunner or QALoad </li></ul></ul><ul><li>Collecting with load testing programs is easier and information is in easy to analyze/report form </li></ul><ul><li>Counters for all four are needed </li></ul>
  62. 62. Interpreting system counters <ul><li>Most important counters </li></ul><ul><ul><li>CPU – queue length tells if it is too busy </li></ul></ul><ul><ul><li>Disk – queue length tells if it is too busy </li></ul></ul><ul><ul><li>Network - queue length tells if it is too busy </li></ul></ul><ul><ul><li>Memory – hard page faults (disk) tells if it is too small </li></ul></ul><ul><li>However one counter is not enough </li></ul><ul><ul><li>to be sure more counters are needed </li></ul></ul><ul><ul><li>to see root couse more counters are needed </li></ul></ul>
  63. 63. Application counters <ul><li>Collecting with load testing programs is easy and information is in easy to analyze/report form </li></ul><ul><li>However all counters are not available to load testing tools </li></ul><ul><ul><li>online monitors (Websphere, WebLogic) could be used to complement information </li></ul></ul><ul><li>Different products have different counters </li></ul><ul><ul><li>need for understanding that particular product </li></ul></ul>
  64. 64. Profiling tools <ul><li>Collecting exact information in call level </li></ul><ul><ul><li>memory usage </li></ul></ul><ul><ul><li>disk i/o usage </li></ul></ul><ul><ul><li>response time </li></ul></ul><ul><li>Collecting information may influence quite much to results </li></ul><ul><ul><li>one solution is to make two test runs : one without logging/profiling and other with them </li></ul></ul>
  65. 65. Example 1 : One clear bottleneck <ul><li>One of four system resources is busy </li></ul><ul><ul><li>easy to see bottleneck </li></ul></ul>
  66. 66. Example 2 : More than one system resources looks bad <ul><li>However only one resource is real bottleneck </li></ul><ul><ul><li>others are ”side effects” of real bottleneck </li></ul></ul>
  67. 67. Example 3 : None of system resources looks bad <ul><li>Where is the bottleneck then ? </li></ul><ul><ul><li>usually some software application uses works inefficiently internally or interface queue to external systems does not work efficiently </li></ul></ul>
  68. 68. What is root cause and how to fix it ?
  69. 69. How to see root cause ? <ul><li>Application level information is usually needed and always good to have </li></ul><ul><ul><li>Software code problems could be solved when we see which is slow function </li></ul></ul><ul><li>Some root causes are easy to see while others needs sophisticated monitoring and profiling </li></ul>
  70. 70. Software implementation <ul><li>Database server </li></ul><ul><ul><li>Bad sql from performance point of view (works but not efficiently) </li></ul></ul><ul><ul><li>No or not good enough indexes used </li></ul></ul><ul><li>Application server </li></ul><ul><ul><li>Object references not freed -> too much objects in heap </li></ul></ul><ul><ul><li>Bad methods used from performance point of view </li></ul></ul><ul><li>Idea is to decrease load to hardware resouches </li></ul>
  71. 71. Efficiency <ul><li>Not efficient use of existing hardware resources </li></ul><ul><ul><li>Parametrizing and configuring help </li></ul></ul>
  72. 72. Capacity <ul><li>Resource too slow for handling events fast enough </li></ul><ul><li>More resourches or reconfiguring existing resourches </li></ul><ul><ul><li>Cpu from web-server to db server </li></ul></ul>
  73. 73. Hard constraints and requirements <ul><li>Client’s complicated business logic requirements </li></ul><ul><ul><li>too much bytes needed in user interface (slow network speed) </li></ul></ul><ul><ul><li>too many different sources of information needed (syncronous) </li></ul></ul><ul><ul><li>long transactions; single function needs many chained updates </li></ul></ul><ul><li>Security requirements </li></ul><ul><ul><li>too much request to web server -> encrypted network traffic </li></ul></ul><ul><li>Online data needed </li></ul><ul><ul><li>many big updates needed immediately </li></ul></ul>
  74. 74. Bad design <ul><li>Application tiers </li></ul><ul><ul><li>distribution of tiers possible (=EJB vs pure Servlet) </li></ul></ul><ul><li>Technology </li></ul><ul><ul><li>too much information in session object </li></ul></ul><ul><li>Infrastructure </li></ul><ul><ul><li>not compatible versions of different vendors from performance point of view </li></ul></ul><ul><ul><li>needed functionality not available (= distibution not supported) </li></ul></ul>
  75. 75. Tuning <ul><li>Tuning </li></ul><ul><ul><li>application </li></ul></ul><ul><ul><li>server software </li></ul></ul><ul><ul><li>operating system </li></ul></ul><ul><ul><li>network </li></ul></ul><ul><li>Usually good choice </li></ul><ul><ul><li>fast to do </li></ul></ul><ul><ul><li>risks to regression small </li></ul></ul><ul><li>Usually tuning is not enough </li></ul><ul><ul><li>changes are needed </li></ul></ul>
  76. 76. Changing <ul><li>Application code </li></ul><ul><li>Application software </li></ul><ul><li>Hardware </li></ul><ul><li>Network infrastructure </li></ul>
  77. 77. Tuning vs change <ul><li>Tuning is not so risky </li></ul><ul><li>Change is not always possible </li></ul><ul><li>In practise both are valid and equally considered </li></ul>
  78. 78. Example : Tuning vs change <ul><li>Sales system has application server processor bottleneck </li></ul><ul><li>Could be removed </li></ul><ul><ul><li>More processing power </li></ul></ul><ul><ul><li>Less processing needed -> application code change </li></ul></ul><ul><li>If application logic need to be changed a lot </li></ul><ul><ul><li>More processing power choosed </li></ul></ul><ul><li>If application logic need to be changed a little </li></ul><ul><ul><li>application code change choosed </li></ul></ul><ul><li>If both are fast, easy and costs are low </li></ul><ul><ul><li>both are choosed </li></ul></ul>
  79. 79. Removing bottlenecks <ul><li>Idea : Removing root cause of bottleneck one by one </li></ul><ul><li>Rerun same test to see influence </li></ul>
  80. 80. Testing part of system <ul><li>Sometimes it is difficult to see bottleneck and root cause </li></ul><ul><ul><li>More information is needed in order to understand system better </li></ul></ul><ul><ul><li>Testing just one suspect at time is usually possible but could need much effort </li></ul></ul><ul><li>Testing only one extent at time is ultimate way </li></ul>
  81. 81. Top – down optimizing <ul><li>When there is plenty of time </li></ul><ul><ul><li>not very fast, but efective </li></ul></ul><ul><li>Idea : Optimize one level at time </li></ul><ul><li>-> Level by level readyness </li></ul><ul><ul><li>No jumping between levels </li></ul></ul>Application code Application software Operating system Hardware
  82. 82. Memory–cache-pool-area usage <ul><li>Idea : Data or service that application needs is already in memory as much as possible </li></ul><ul><li>System level </li></ul><ul><ul><li>big enough memory -> not much swapping needed </li></ul></ul><ul><ul><li>proxy server caches content </li></ul></ul><ul><li>Application level </li></ul><ul><ul><li>big enough database connection pool -> new objects not needed </li></ul></ul><ul><ul><li>big enough database sort area -> not much swapping needed </li></ul></ul>
  83. 83. Connection and thread pools <ul><li>Creating many objects at startup </li></ul><ul><ul><li>new user gets object from pool </li></ul></ul><ul><ul><li>when used object returns to pool </li></ul></ul>
  84. 84. Synchronous and asynchronous traffic <ul><li>If possible actions could happen asyncronously (= no need to wait that action is ready) </li></ul><ul><li>Interfaces to other systems </li></ul>
  85. 85. Distributing load <ul><li>Between servers </li></ul><ul><ul><li>load balancing </li></ul></ul><ul><li>Inside server </li></ul><ul><ul><li>cpus </li></ul></ul><ul><ul><li>disks </li></ul></ul><ul><li>Between networks </li></ul><ul><ul><li>segments </li></ul></ul>
  86. 86. Cut down features <ul><li>Sometimes only possibility is to cut down features and requirements </li></ul><ul><ul><li>deadline too neat to make other optimizing </li></ul></ul><ul><ul><li>costs or risks too big when doing anything else </li></ul></ul>
  87. 87. Making recomendations for correcting actions <ul><li>Need usually interpretion of results from different persons </li></ul><ul><ul><li>however understanding and criticality is needed </li></ul></ul><ul><li>Results should be clear </li></ul><ul><ul><li>usual ”It is not our software but yours” conversations could be avoided if nobody can question results and recomendations </li></ul></ul><ul><ul><li>need to show where problem is not ! </li></ul></ul>
  88. 88. Example : Internet portal <ul><li>Application : Many background systems develop data to this portal </li></ul><ul><li>Response time in USA:ssa 5 s, when connections are fast </li></ul><ul><li>In Asia every connection takes 2 sec and moving elements between server and client is slow too </li></ul><ul><li>Logic : 12 frames inside each other </li></ul><ul><li>Result : Opening first page takes 2 s*12 + 30 s = 54 sec </li></ul><ul><li>Requirement : 8 sec </li></ul>
  89. 89. Corrective actions and ideas <ul><li>Idea 1 : Faster connection </li></ul><ul><ul><li>not possible -> thousands of internet customers </li></ul></ul><ul><li>Idea 2 : Content nearer to customer </li></ul><ul><ul><li>pictures partly to client workstations -> security regulations prevent partly </li></ul></ul><ul><ul><li>content to servers near customers (Content Delivery Network) </li></ul></ul><ul><ul><li>helps some but not enough </li></ul></ul><ul><li>Idea 3 : Packaging of data </li></ul><ul><ul><li>helps some but not enough </li></ul></ul><ul><li>Idea 4 : Application logic change -> less frames </li></ul><ul><ul><li>lot of costs </li></ul></ul><ul><ul><li>requirements achieved </li></ul></ul>
  90. 90. Error and lessons learned <ul><li>Internet users with slow connections and different geagraphical areas </li></ul><ul><ul><li>can be important user group </li></ul></ul><ul><ul><li>Technical design failed to this group </li></ul></ul><ul><li>Perfotmance testing late in development cycle </li></ul><ul><ul><li>too late </li></ul></ul><ul><ul><li>not simulated real usage good enough </li></ul></ul><ul><li>Pilot users saved much </li></ul><ul><ul><li>not widely used when problems we seen </li></ul></ul><ul><li>Solution was found (as usual) </li></ul><ul><ul><li>but fixing took much time and money </li></ul></ul>