Big server-is-watching-you
-
Upload
mkherlakian -
Category
Technology
-
view
739 -
download
0
description
Transcript of Big server-is-watching-you
October 2011
Big server is watching youMaurice Kherlakian
Professional services consultant
twitter.com/zend
http://ca.linkedin.com/in/mkherlakian
2
• 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 helicopters
About me
3
• Covers Zend Server’s monitoring and profiling features
• Monitoring and code tracing through application examples
• Session is demo-based
About the session
4
• 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 reproduce
Problem Statement
5
So how do we capture those problems as soon as they occur?
6
• 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 code
The application
7
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 load
The problems
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 format
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 option
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)
11
• 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 mode
Performance impact of monitoring and code tracing
12
• Test-get-beer
Monitoring and code tracing on/off benchmark
10 seconds, 6 concurrent requests cache enabed cache disabledMonitoring and CT off 3.65 rps / 298Mb 1.40 rps / 226MbMonitoring ON, CT off 3.39 rps / 315 Mb 1.37 rps / 280MbMonitoring 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%
13
• Home
Home page
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%
14
• 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 API
Additional features
15
• 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 internally
Conclusion
16
• 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 application
Next steps
17
Questions?
Questions?
18
Thank youEmail: [email protected]
Twitter: twitter/mkherlakian
Linekdin: http://ca.linkedin.com/in/mkherlakian
The full source code for this demo can be found at:
[email protected]:mkherlakian/BeerIOU
Thank you