Zend Server: A Guided Tour

Post on 17-May-2015

8,090 views 2 download

Tags:

description

This presentation overviews the different features in Zend Server 5.0, including performance features, application level monitoring for PHP, Job Queueing for PHP and the new production code tracing featurePresented at ZendCon 09

transcript

Zend Server: A Guided Tour

By Shahahr EvronTechnical Product Manager, Zend Technologies

2

Welcome!

I am your tour guide today:▶ A PHP programmer since 2002▶ At Zend since 2005▶ Technical Product Manager for Zend Server

Yes, I have a difficult name (at least for English speakers)

▶ Shachar (German, Dutch)

▶ Shajar (Spanish)

▶ Шахар (Russian)

▶ (Arabic) شخر

▶ (Hebrew) שחר

3

AgendaZend Server: What & Why?

Improving PHP's manageability▶ Installation, Zend Server Administration UI

Improving your application's performance▶ Optimizer+, Data Cache, Page Cache, Job Queue

Improving your application's reliability▶ Zend Monitor, Code Tracing

4

What is Zend Server?...and why should I care?

5

...Well, Just ask your friend at marketing!

“Zend Server is a complete, enterprise-ready Web Application Server for

running and managing PHP applications that require a high level of reliability, performance and

security.”

6

Let's try to make sense out of that..

Zend Server Is:▶ A complete, well tested PHP runtime environment▶ Supported and updated by Zend▶ Comes with a set of extra features that:

● Improve the performance and reliability of PHP applications● Make it easier to manage a consistent PHP environment

Comes in two flavors:▶ Zend Server▶ Zend Server Community Edition

7

Manageability Features...making PHP even simpler

8

Installation

Zend Server uses OS-native installers▶ Linux: Deb and RPM repositories▶ Windows: MSI▶ Mac OS X*: PKG installer

This is good because:▶ Native means well-known, convenient, proven, reliable▶ Upgrading, updating, modifying and removing is easy▶ Automating, scripting and bundling is also easy

* Mac OS X is Community Edition only

9

For example, the DEB installation...

All you have to do is:▶ Add a line to /etc/apt/sources.list▶ Run the usual aptitude or apt-get commands, or use Synaptic

10

For example, the DEB installation...

And you get:▶ The latest stable* PHP version

● With additional testing done by Zend's QA team● With Zend's extra components

▶ All packaging features supported by your distribution's tools:● automatic update notifications, configuration management● Repository mirroring / proxying capabilities● Ability to hold back / roll back / remove specific components

If you know your way around Debian, you can also easily:▶ Script & automate the installation▶ Create your own meta-packages that include the parts you need

11

The Administration InterfaceZend Server's GUI allows you to conveniently...

▶ Control the different Zend Server components▶ Control your PHP settings

● PHP Extensions● PHP Directives

▶ Monitor the current system status● Extension status● PHP status● Logs● Available updates & security fixes

12

Performance Features

13

Zend Server's approach to performanceA Web application's performance is affected by many different factors...

...This is why taking a single measure will only give partial results

14

Zend Server's approach to performanceReally improving performance requires combining different measures:

▶ Configuration Optimization▶ Opcode Optimization and Caching▶ Data Caching and Page Caching▶ Off-line or parallel execution

Not all performance optimizations are equal▶ Some are almost free and should be done in almost all cases▶ Some are expensive and should not be done without insight

Zend Server provides the measures, and the insight!

15

Optimizer+Eliminates the stuff you don't really need:

▶ Code optimizer● Optimizes certain code fragments to improve execution speed

▶ Opcode cache● Caches the optimized, compiled bytecode in RAM● Reduces or eliminates

compile time● Reduces or eliminates

disk access

Magento Drupal SugarCRM CE05

101520253035404550

2.24

13.96 12.69

5.3

45.5541.73

Bare PHP Optimizer+

16

Data CachingProvides a set of API functions for caching of data items

▶ DB query results, web service calls, complex or hard-to-get data▶ Output elements

▶ Allows skipping slow PHP code chunks▶ Shared memory and Disk storage backends▶ Data could be grouped using namespaces▶ APC user cache compatibility layer▶ Zend Framework Zend_Cache_Backend adapters

17

Page CachingDon't execute a single line of PHP if you don't have to...

▶ Caches entire HTTP response ▶ Super fast (seriously!)▶ Configured from UI, no code changes required▶ Live / cached decision is based on request or session parameters▶ Variants can be created

based on request or session parameters

No Cache Session Rule Other Rule0

100

200

300

400

500

600

700

21.94

201.17

589.26

18

Page Caching

19

Job QueueA PHP script often needs to handle several tasks.

▶ Some of which don't need to be interactive

Think of a typical on-line forum:▶ A user posts a message to a thread▶ Message is saved in the DB▶ Emails are sent to all thread watchers▶ Search index is refreshed▶ Feeds are regenerated

Your end user shouldn't wait for these to finish!

20

Job Queue Job Queue allows you to

▶ Put certain tasks into a separate execution queue● Off-load to a later time (or even run in parallel)● Off-load to a different server

▶ Execute certain tasks at a specified time● Distribute processing load to off-hours

▶ Execute certain tasks periodically

While..▶ Maximizing reuse of existing infrastructure & code▶ Making sure nothing falls between the cracks▶ Doing it all from a PHP API

21

Job Queue – A Common Execution Flow

22

Reliability FeaturesMake sure it keeps running!

23

Reliability?Getting your application out there is one thing, keeping it working properly is a different story!

Zend Server helps you by:▶ Making sure your software is

up-to-date, including critical fixes▶ Monitoring your apps for errors,

slowdowns and other troubles▶ Capturing data that can be used

when resolving any detected issues

24

Application Level MonitoringZend Server Monitor will watch your application for:

▶ PHP Errors (including warnings, notices, uncaught exceptions...)▶ Failing functions (user-defined or internal)▶ Failing DB queries ▶ Slow functions (user-defined or internal) or DB queries▶ Slow request executions▶ High memory consumption▶ Errors reported by Zend Server

components

When an issue is detected, Zend Server will report an event

25

Root Cause AnalysisRecurring events are aggregated and placed on a timeline

▶ So you can know if a problem repeats, and if so when

Each event report contains context information that can assist in debugging the event:

▶ URL, file, line, error message, repeat count etc.▶ Request information (GET, POST, COOKIE etc.)▶ Server information ▶ Session Information▶ Backtrace (if relevant)

For many errors, this information is crucial for debugging

26

Integration with Zend StudioZend Server integrates with Zend Studio and allows you to “replay” an event

▶ In a debugging session▶ In a profiling session

▶ This can be done with one button click from the GUI▶ …or, by exporting the event data and passing it to a developer,

from the developer's IDE

▶ You can also “replay” on an alternate testing server

In many cases this eliminates time spent on reproduction

27

Code TracingReproducing an issue is not always possible...

▶ Dependency on specific SESSION state▶ Dependency on specific database state▶ “Replaying” the request is risky or impossible

Zend Code Tracing can capture the entire execution flow▶ ...and, it is efficient enough to be used in most production

environments!

“Hindsight is always twenty-twenty.”- Billy Wilder

28

Code TracingCan be used in several ways:

▶ Automatic tracing in case of a Zend Monitor event● For example a PHP error, a slow execution or high memory usage

▶ Manually through the GUI or from a browser▶ Through API

Can capture the following information:▶ Execution tree including function calls and included files▶ Function agrument and return parameters▶ Output and header generation▶ Location of errors, exceptions and Zend Monitor events▶ For each node, execution time and memory usage is measured

29

Code Tracing

30

Updates & Hot Fixes from ZendZend Server is regularly updated with...

▶ PHP releases▶ Zend Framework releases▶ Important patches to PHP and supporting components

● Bugs fixed by the PHP team but not yet released● Patches committed by Zend to the PHP source tree, but not yet

released

Zend also issues hot-fixes when needed▶ All relevant security reports are analyzed by Zend▶ This includes PHP, extensions, libraries, and other components▶ Zend is committed to releasing hot-fixes for critical issues

31

…So, what have we seen?

32

Closing Words...Zend Server can help you to...

▶ Stop worrying about PHP updates▶ Improve your applications performance using various tools

● Some improvement is effortless● You get the infrastructure for future improvement● You get the diagnostic tools for prioritizing optimizations

▶ Know about production issues as they happen

▶ Quickly resolve these issues

Focus on your own applications!

33

Thanks!Email me: shahar.e@zend.comLearn more at http://www.zend.com/server

Copyright © 2009 Zend Technologies Ltd.

This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.