+ All Categories
Transcript
Page 1: Zend Server: A Guided Tour

Zend Server: A Guided Tour

By Shahahr EvronTechnical Product Manager, Zend Technologies

Page 2: Zend Server: A Guided Tour

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) שחר

Page 3: Zend Server: A Guided Tour

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

Page 4: Zend Server: A Guided Tour

4

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

Page 5: Zend Server: A Guided Tour

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.”

Page 6: Zend Server: A Guided Tour

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

Page 7: Zend Server: A Guided Tour

7

Manageability Features...making PHP even simpler

Page 8: Zend Server: A Guided Tour

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

Page 9: Zend Server: A Guided Tour

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

Page 10: Zend Server: A Guided Tour

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

Page 11: Zend Server: A Guided Tour

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

Page 12: Zend Server: A Guided Tour

12

Performance Features

Page 13: Zend Server: A Guided Tour

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

Page 14: Zend Server: A Guided Tour

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!

Page 15: Zend Server: A Guided Tour

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+

Page 16: Zend Server: A Guided Tour

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

Page 17: Zend Server: A Guided Tour

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

Page 18: Zend Server: A Guided Tour

18

Page Caching

Page 19: Zend Server: A Guided Tour

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!

Page 20: Zend Server: A Guided Tour

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

Page 21: Zend Server: A Guided Tour

21

Job Queue – A Common Execution Flow

Page 22: Zend Server: A Guided Tour

22

Reliability FeaturesMake sure it keeps running!

Page 23: Zend Server: A Guided Tour

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

Page 24: Zend Server: A Guided Tour

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

Page 25: Zend Server: A Guided Tour

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

Page 26: Zend Server: A Guided Tour

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

Page 27: Zend Server: A Guided Tour

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

Page 28: Zend Server: A Guided Tour

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

Page 29: Zend Server: A Guided Tour

29

Code Tracing

Page 30: Zend Server: A Guided Tour

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

Page 31: Zend Server: A Guided Tour

31

…So, what have we seen?

Page 32: Zend Server: A Guided Tour

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!

Page 33: Zend Server: A Guided Tour

33

Thanks!Email me: [email protected] 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.


Top Related