Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Big server-is-watching-you

1,218 views

Published on

Zendcon 2011 talk
Monitoring and its performance impact using Zend Server

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Big server-is-watching-you

  1. 1. Big server is watchingyouMaurice KherlakianProfessional services consultantmaurice.k@zend.comtwitter.com/zendhttp://ca.linkedin.com/in/mkherlakian
  2. 2. About me • Originally from Lebanon, based in Montreal since 2003 • BS in Computer Science from the American University of Beirut • Speak english, french and arabic • Been using PHP for the past 10 years • Worked on some large and very heavy traffic websites (4M+ page views/day) • Zend Consultant for the past 2 years • Had the opportunity to work on some very large accounts like NYSE, Guthy- Renker, Best Buy, Levolor, Harvard, UBM, Shaklee… • Deliver consulting (architecture and performance) and training (all of Zend’s courses) • Married, have a 14 months old daughter and 2 persian cats • During little free time I fly (but mostly crash) R/C planes and helicopters2
  3. 3. About the session • Covers Zend Server’s monitoring and profiling features • Monitoring and code tracing through application examples • Session is demo-based3
  4. 4. Problem Statement • Applications get developed and deployed on disparate environments • Focus typically on speed of development (time crunches), which can leave sub-optimal code performance-wise • Test data typically different than production data  Production data sets are typically much larger, leading to different scenarios  Production users are notorious for entering data that makes the application break • Failure, and especially performance problem reports are vague • They are also very difficult to reproduce4
  5. 5. So how do we capture those problems as soon as they occur?5
  6. 6. The application • Needed an application to demo • Customer applications and examples would have been ideal but… • Created BeerIOU • DISCLAIMER: The application is intentionally written not to follow best practices, and has bad code6
  7. 7. The problems Slow page • Captured a slow request execution event • The Monitor and its rules • How do we diagnose it?  By using code tracing • Problem was that API randomly took long times to load7
  8. 8. The problems PHP errors • Captured a PHP error event • How do we diagnose it?  By using code tracing • Problem was that API changed return format8
  9. 9. The problems High memory usage • Captured a High memory usage • How do we diagnose it?  By using code tracing • Problem was that favorite beers DD has too many entries instantiated into objects • Caching is not always the best option9
  10. 10. The problems Slow web service • Maintaining highly scalable infrastructure means being able to predict response times • The less time an Apache process spends serving a request the better • When dealing with unpredictable loads, offload the request processing (using Job Queue for example)10
  11. 11. Performance impact of monitoring and code tracing • Monitoring is not free (in terms of resources, not like free beer)  Stress/load test with monitoring and CT enabled/disabled  Results may vary ;) • Code tracing buffer  Larger means more memory  Can run in stand-by mode11
  12. 12. Monitoring and code tracing on/off benchmark • Test-get-beer 10 seconds, 6 concurrent requests cache enabed cache disabled Monitoring and CT off 3.65 rps / 298Mb 1.40 rps / 226Mb Monitoring ON, CT off 3.39 rps / 315 Mb 1.37 rps / 280Mb Monitoring and CT on 3.37 rps / 327 Mb 1.28 rps / 275Mb rps % on/off 108.31% 109.38% Memory % on/off 109.73% 121.68%12
  13. 13. Home page • Home 10 seconds, 6 concurrent requests cache enabed Monitoring and CT off 79.59 rps / 52.7Mb Monitoring ON, CT off 79.59 rps / 63.4 Mb Monitoring and CT on 79.20 rps / 68.4 Mb rps % on/off +/-0% Memory % 129.79%13
  14. 14. Additional features • Events can be set up to send emails  Default for all events  Individually per event • Events management (open, closed, re-open, ignore) • Monitor and Code tracing’s main advantages  They can run un production (Optimizer + is always active)  Easy interface, easy to use • Monitoring can be disabled on a per-page basis  Using zend_monitor_event_reporting API14
  15. 15. Conclusion • Monitoring is an essential part of application lifecycle  Applies both for development and production • Not enough to rely on inaccurate reports • Some sysadmin tools (Gomez, Splunk, Xymon, Cacti) are great for server monitoring but none monitor PHP itself internally15
  16. 16. Next steps • Download Zend Server (http://www.zend.com/en/products/server/) • Generate a 30 day trial license (http://www.zend.com/en/products/server/license) • Test it out with your own application16
  17. 17. Questions? Questions?17
  18. 18. Thank you Thank you Email: maurice.k@zend.com Twitter: twitter/mkherlakian Linekdin: http://ca.linkedin.com/in/mkherlakian The full source code for this demo can be found at: git@github.com:mkherlakian/BeerIOU18

×