Presentation confoo optimization_sherifzaroubi

691 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
691
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • What can cause these Apache children to slow down or completely stall ?
  • Mon Cinema – NFS Failed on writesCvendu – Clustering (That famous 4 am call)
  • Try to stagger your communicationsSoft launch when you can
  • Estimate your peak and design for it
  • Zend_Cache’s default config.NET Component
  • Beware when updating production serversAlways have a Hot backup to rollback
  • Correct planning of test scenarios# Visitors, Average Time on page, # Concurrent usersCorrect estimation of your traffics shapeRead/Write ratio, Cache Hits/Miss ratio
  • Correct planning of test scenarios# Visitors, Average Time on page, # Concurrent usersCorrect estimation of your traffics shapeRead/Write ratio, Cache Hits/Miss ratioReplicate a production environment as closely as possibleMake sure that you have correct amounts of data
  • Understand
  • A project lands on your deskWhere can it break ?
  • Set your boundries !Make sure people understand
  • How are you going to measure your boundaries
  • Presentation confoo optimization_sherifzaroubi

    1. 1. Optimization of web applications<br />An introduction<br />
    2. 2. Whois Sherif ?<br /><ul><li>Bachelor in Computer Science Concordia University
    3. 3. Worked for 3 years as a Web Developer
    4. 4. Then 2.5 years as a Perl Programmer handling large scale ecommerce web sites
    5. 5. Then for 2.5 years as Software Architect, Team Lead for (J2EE)
    6. 6. Worked for 2.5 years as IT Director, Software Architect at w.illi.am/ </li></li></ul><li>Overview<br />
    7. 7. Overview<br />How does Apache Prefork handle your request<br />Projects that #Failed<br />What I have learned<br />
    8. 8. Apache Prefork<br />
    9. 9. Request/Response Cycle (Apache Prefork)<br />Apache Main Process<br />Request on port 80<br />
    10. 10. Request/Response Cycle (Apache Prefork)<br />Apache Main Process<br />Request on port 80<br />ForkChild<br />Child Process<br />
    11. 11. Request/Response Cycle (Apache Prefork)<br />Apache Main Process<br />Apache Main Process<br />Request on port 80<br />ForkChild<br />Child Process<br />SendRespond<br />
    12. 12. Request/Response Cycle (Apache Prefork)<br />Request/Response Cycle (Apache Prefork)<br />Apache Main Process<br />Apache Main Process<br />Child Process<br />Child Process<br />
    13. 13. Request/Response Cycle (Apache Prefork)<br />Apache Main Process<br />Requeston port 80<br />Child Process<br />
    14. 14. Request/Response Cycle (Apache Prefork)<br />Apache Main Process<br />Requeston port 80<br />Child Exists<br />Child Process<br />
    15. 15. Request/Response Cycle (Apache Prefork)<br />Apache Main Process<br />Apache Main Process<br />Child Exists<br />Child Process<br />Child Process<br />
    16. 16. Request/Response Cycle (Apache Prefork)<br />Apache Main Process<br />Child Process<br />Child Process<br />
    17. 17. Request/Response Cycle (Apache Prefork)<br />Apache Main Process<br />Child Process<br />Child Process<br />
    18. 18. Request/Response Cycle (Apache Prefork)<br />Apache Main Process<br />Child Process<br />Child Process<br />
    19. 19. Past Failings<br />Conclusions<br />Minimize response time<br />Do not let the children hang<br />Don’t use to many children<br />
    20. 20. How I #Failed<br />
    21. 21. Challenges : Component Failure<br /># Failure<br />Hardware failure<br />RAID fails<br />Node in cluster fails<br />
    22. 22. Challenges : Component Failure<br /># Failure<br />Hardware failure<br />RAID fails<br />Node in cluster fails<br />Learning : <br />Design for 60% usage<br />KISS<br />
    23. 23. Challenges : Peaks in traffic<br /># Failure<br />Successful marketing campaigns<br />Radio Station – 10 stations announcement<br />TV Personality – News agency interviews<br />
    24. 24. Challenges : Peaks in traffic<br /># Failure<br />Successful marketing campaigns<br />Radio Station – 10 stations announcement<br />TV Personality – News agency interviews<br />Learning <br />Try to stagger your communications<br />Soft launch when you can<br />
    25. 25. Challenges : Peaks in traffic<br /># Failure<br />Important news events<br />
    26. 26. Challenges : Peaks in traffic<br /># Failure<br />Important news events<br />Learning : <br />Estimate your peak and design for it<br />
    27. 27. Challenges : Unproven code<br /># Failure<br />Third party libraries can go wrong<br />
    28. 28. Challenges : Unproven code<br /># Failure<br />Third party libraries can go wrong<br />Learning<br />Beware of 3rd party libraries<br />Profile all new code<br />Profile all new code<br />Profile all new code<br />
    29. 29. Challenges : Unproven code<br /># Failure<br />Updated System libraries<br />Memcached client libraries update<br />GD2 Client library update<br />
    30. 30. Challenges : Unproven code<br /># Failure<br />Updated System libraries<br />Memcached client libraries update<br />GD2 Client library update<br />Learning<br />Beware when updating production servers<br />Always have a Hot backup to rollback<br />
    31. 31. Challenges : Stress tests<br /># Failure<br />Stress tests the false insurance<br />
    32. 32. Challenges : Stress tests<br /># Failure<br />Stress tests the false insurance<br />Learning<br />Correct planning of test scenarios<br />Correct estimation of your traffics shape<br />Replicate a production environment as closely as possible<br />
    33. 33. Challenges : Conclusions<br />The 10 Conclusions<br />Design for 60% usage<br />Try to stagger your communications<br />Soft launch when you can<br /><ul><li>Estimate your peak and design for it</li></ul>Beware when updating production servers<br />Always have a Hot backup to rollback changes<br />Correct planning of test scenarios<br />Correct estimation of your traffics shape<br /><ul><li>Replicate a production environment</li></li></ul><li>Challenges : Conclusions<br />The 10 Conclusions<br />Design for 60% usage<br />Try to stagger your communications<br />Soft launch when you can<br /><ul><li>Estimate your peak and design for it</li></ul>Beware when updating production servers<br />Always have a Hot backup to rollback changes<br />Correct planning of test scenarios<br />Correct estimation of your traffics shape<br /><ul><li>Replicate a production environment</li></ul>Most importantly<br /><ul><li>Understand your Hardware components
    34. 34. Understand your Software components
    35. 35. Understand your Human components
    36. 36. Understand your Marketing pushes</li></li></ul><li>How to optimize <br />
    37. 37. Optimization<br />Optimization is not about code<br />Optimization is not about RAIDed disks<br />Optimization is not about software architecture<br />Optimization is not about caching systems<br />Optimization is not about load<br />
    38. 38. Optimization<br />Optimization is not about code<br />Optimization is not about RAIDed disks<br />Optimization is not about software architecture<br />Optimization is not about caching systems<br />Optimization is not about load<br />Optimization is about all the pieces working in unison <br />Optimization is an ongoing process<br />
    39. 39. Optimization : Finding the bottleneck<br />Optimization starts with Risk<br />
    40. 40. Optimization : Finding the bottleneck<br />Optimization starts with Risk<br />Set the Assumptions<br /># Users<br />Mix of traffic<br />Connection speed<br />....<br />
    41. 41. Optimization : Finding the bottleneck<br />Optimization starts with Risk<br />Set the Assumptions<br /># Users<br />Mix of traffic<br />Connection speed<br />....<br />Define your System metrics<br />Page load time<br />Page weight<br />Memory usage<br />CPU Usage<br />Load average<br />
    42. 42. Optimization : Finding the bottleneck<br /><ul><li>What is Normal ? Benchmark your metrics</li></ul>Optimization starts with Risk<br />Set the Assumptions<br /># Users<br />Mix of traffic<br />Connection speed<br />....<br />Define your System metrics<br />Page load time<br />Page weight<br />Memory usage<br />CPU Usage<br />Load average<br />
    43. 43. Optimization : Finding the bottleneck<br /><ul><li>What is Normal ? Benchmark your metrics
    44. 44. Profile the code
    45. 45. CPU Time
    46. 46. Look at %</li></ul>Optimization starts with Risk<br />Set the Assumptions<br /># Users<br />Mix of traffic<br />Connection speed<br />....<br />Define your System metrics<br />Page load time<br />Page weight<br />Memory usage<br />CPU Usage<br />Load average<br />
    47. 47. Optimization : Finding the bottleneck<br /><ul><li>What is Normal ? Benchmark your metrics
    48. 48. Profile the code
    49. 49. CPU Time
    50. 50. Look at %
    51. 51. Load test your system</li></ul>Optimization starts with Risk<br />Set the Assumptions<br /># Users<br />Mix of traffic<br />Connection speed<br />....<br />Define your System metrics<br />Page load time<br />Page weight<br />Memory usage<br />CPU Usage<br />Load average<br />
    52. 52. Optimization : Finding the bottleneck<br /><ul><li>What is Normal ? Benchmark your metrics
    53. 53. Profile the code
    54. 54. CPU Time
    55. 55. Look at %
    56. 56. Load test your system
    57. 57. Tweak your system
    58. 58. Max Children
    59. 59. Spare Children
    60. 60. NFS settings
    61. 61. Caching
    62. 62. Session handling
    63. 63. Etc ...</li></ul>Optimization starts with Risk<br />Set the Assumptions<br /># Users<br />Mix of traffic<br />Connection speed<br />....<br />Define your System metrics<br />Page load time<br />Page weight<br />Memory usage<br />CPU Usage<br />Load average<br />
    64. 64. Optimization : Finding the bottleneck<br />Conclusion<br />I am more riskconscious<br />I think before I code<br />I profile, and profile, and profile<br />I define my test scenarios<br />Development environment as close as possible to the Production environment<br />I test my deployments<br />And always have a Plan B in case I forget something!<br />

    ×