Zend Server: A Guided Tour

By Shahahr Evron Technical Product Manager, Zend Technologies

Welcome!
I am your tour guide today:
▶ ▶ ▶

A PHP programmer since 2002 At Zend since 2005 Technical Product Manager for Zend Server
(at least for English speakers)

Yes, I have a difficult name
▶ ▶

Shachar Shajar

(German, Dutch)

(Spanish) (Russian)

▶ ▶ ▶

Шахар

‫( ﺷﺨﺮ‬Arabic) ‫( שחר‬Hebrew)

2

Agenda
Zend 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

3

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

performance and security.Well.... enterpriseready Web Application Server for running and managing PHP applications that require a high level of reliability.” 5 . Just ask your friend at marketing! “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 6 .Let's try to make sense out of that.. Zend Server Is: ▶ ▶ ▶ A complete.

.making PHP even simpler 7 ..Manageability Features .

reliable Upgrading. modifying and removing is easy Automating. updating. proven.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. scripting and bundling is also easy * Mac OS X is Community Edition only 8 . convenient.

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

the DEB installation.For example. 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 10 ... 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.

▶ ▶ 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 11 ..The Administration Interface Zend Server's GUI allows you to conveniently..

Performance Features 12 .

.Zend Server's approach to performance A Web application's performance is affected by many different factors. ...This is why taking a single measure will only give partial results 13 ..

Zend Server's approach to performance Really 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! 14 .

Optimizer+ Eliminates the stuff you don't really need: ▶ Code optimizer ● Optimizes certain code fragments to improve execution speed Caches the optimized.55 41.96 2.24 5.73 ▶ Opcode cache ● ● ● 13. compiled bytecode in RAM Reduces or eliminates compile time Reduces or eliminates disk access Bare PHP 50 45 40 35 30 25 20 15 10 5 0 Optimizer+ 45.69 Magento SugarCRM CE 15 .3 Drupal 12.

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 ▶ ▶ ▶ ▶ ▶ 16 .Data Caching Provides a set of API functions for caching of data items ▶ ▶ DB query results. web service calls.

..94 No Cache Session Rule Other Rule 201. no code changes required Live / cached decision is based on request or session parameters Variants can be created based on request or session parameters 700 600 500 400 300 200 100 0 21. ▶ ▶ ▶ ▶ ▶ Caches entire HTTP response Super fast (seriously!) Configured from UI.Page Caching Don't execute a single line of PHP if you don't have to.17 589.26 17 .

Page Caching 18 .

Job Queue A 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! 19 .

▶ ▶ ▶ Maximizing reuse of existing infrastructure & code Making sure nothing falls between the cracks Doing it all from a PHP API 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 Distribute processing load to off-hours ▶ Execute certain tasks at a specified time ● ▶ Execute certain tasks periodically While.

Job Queue – A Common Execution Flow 21 .

Reliability Features Make sure it keeps running! 22 .

keeping it working properly is a different story! Zend Server helps you by: ▶ Making sure your software is up-to-date.Reliability? Getting your application out there is one thing. slowdowns and other troubles Capturing data that can be used when resolving any detected issues 23 ▶ ▶ . including critical fixes Monitoring your apps for errors.

. Zend Server will report an event 24 . notices. uncaught exceptions.Application Level Monitoring Zend Server Monitor will watch your application for: ▶ ▶ ▶ ▶ ▶ ▶ ▶ PHP Errors (including warnings.) 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..

) Server information Session Information Backtrace (if relevant) For many errors. POST. Request information (GET. and if so when Each event report contains context information that can assist in debugging the event: ▶ ▶ ▶ ▶ ▶ URL. line. repeat count etc. file. COOKIE etc. error message.Root Cause Analysis Recurring events are aggregated and placed on a timeline ▶ So you can know if a problem repeats. this information is crucial for debugging 25 .

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 26 .Integration with Zend Studio Zend 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.

” .and..Billy Wilder Zend Code Tracing can capture the entire execution flow ▶ ... it is efficient enough to be used in most production environments! 27 . ▶ ▶ ▶ Dependency on specific SESSION state Dependency on specific database state “Replaying” the request is risky or impossible “Hindsight is always twenty-twenty..Code Tracing Reproducing an issue is not always possible.

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. execution time and memory usage is measured 28 . exceptions and Zend Monitor events For each node.Code Tracing Can be used in several ways: ▶ Automatic tracing in case of a Zend Monitor event ● For example a PHP error.

Code Tracing 29 .

.Updates & Hot Fixes from Zend Zend Server is regularly updated with. libraries. and other components Zend is committed to releasing hot-fixes for critical issues 30 . but not yet released Zend also issues hot-fixes when needed ▶ ▶ ▶ All relevant security reports are analyzed by Zend This includes PHP.. extensions. ▶ ▶ ▶ 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.

what have we seen? 31 .…So.

.Closing Words.... ▶ ▶ 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! 32 . Zend Server can help you to.

171 Second Street.e@zend. Suite 300.zend. visit http://creativecommons.com Learn more at http://www. This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3. To view a copy of this license. California. 33 . 94105.0 Unported License.0/ or send a letter to Creative Commons.org/licenses/by-nc-sa/3. San Francisco.com/server Copyright © 2009 Zend Technologies Ltd. USA.Thanks! Email me: shahar.

Sign up to vote on this title
UsefulNot useful