big server-is-watching-you

18
October 2011 Big server is watching you Maurice Kherlakian Professional services consultant [email protected] twitter.com/zend http://ca.linkedin.com/in/mkherlakian

Upload: mkherlakian

Post on 28-Jun-2015

740 views

Category:

Technology


0 download

DESCRIPTION

Zendcon 2011 talkMonitoring and its performance impact using Zend Server

TRANSCRIPT

Page 1: Big server-is-watching-you

October 2011

Big server is watching youMaurice Kherlakian

Professional services consultant

[email protected]

twitter.com/zend

http://ca.linkedin.com/in/mkherlakian

Page 2: Big server-is-watching-you

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

Page 3: Big server-is-watching-you

3

• Covers Zend Server’s monitoring and profiling features

• Monitoring and code tracing through application examples

• Session is demo-based

About the session

Page 4: Big server-is-watching-you

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

Page 5: Big server-is-watching-you

5

So how do we capture those problems as soon as they occur?

Page 6: Big server-is-watching-you

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

Page 7: Big server-is-watching-you

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

Page 8: Big server-is-watching-you

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

Page 9: Big server-is-watching-you

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

Page 10: Big server-is-watching-you

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)

Page 11: Big server-is-watching-you

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

Page 12: Big server-is-watching-you

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%

Page 13: Big server-is-watching-you

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%

Page 14: Big server-is-watching-you

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

Page 15: Big server-is-watching-you

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

Page 16: Big server-is-watching-you

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

Page 17: Big server-is-watching-you

17

Questions?

Questions?

Page 18: Big server-is-watching-you

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