Home
Zend Platform User Guide Disclaimer
Contents
1. KEREN H J ete lt T P E ES a A ishow directories containing i i ache D re Define E ecklist en 3 All Files wi 1 E BA B Cached B Acceleration Blacklist d E usr local apache ssl 29 htdocs i i e Accelerated Compression Blacklist ZE Document Roots HE File Name Lifetime Conditions iE C3 http kuzya 80 i i ba H 2 13 branch f 3 DIE testjava php e manual pi S O ZendPlatform i OE testphp 360 GET a ZendPlatformGUI 2 1 2 i DIR sc test oho i 0 sc test 188 O http dollytest 30 Li ie hitpst packsys_debien22 443 1 ON rev pho b H i OA phpinfo php Figure 15 File View The File view screen provides the following Full Page Content Caching options e amp Cache Select files to be cached and press to enable content caching for the selected files amp Do not Cache Disables Content Caching for the selected files e EZ Define Cache Displays the Define Caching Conditions screen to add detailed configurations for selected files e Update Blacklists Opens and modifies the current Blacklist 38 Configuring Zend Platform e EI Clean Cleans cached file copies e 1 Undo Cancels the last change to the settings Modify File Settings To Modify File Settings 1 Select a directory in the Tree View The list of files residing in that directory is displayed in the File View 2 Check the box next to the file s you wish to modify or the directory to select all files and su
2. Reset Accelerator Programmatically resetting the Accelerator with accelerator_reset You can programmatically reset the Accelerator by calling the PHP function accelerator_reset from within your PHP script Under certain circumstances such as a busy server or complex PHP processes it may take a few minutes to reset While Platform Performance Accelerator is being reset a certain degree of server performance degradation takes place since the accelerated scripts cannot be used during the reset period The server will run as if Platform Performance had not been loaded Platform Performance Accelerator memory is also reset whenever the Web server is restarted Code Compression Code compression is the process of using less bandwidth and increasing performance by compressing code before it is sent When to compress files The default setting for file compression is Off However files should be compressed under the following conditions e When the Web application s users are accessing the Web application with various low bandwidths that can benefit from the extra performance gained by compression e When there is a large quantity of Cached files When not to compress files There are some instances where it is preferable to deactivate compression for select files Compression can be deactivated in several ways e Deactivate compression entirely should be done if the server is set to handle compression to prevent compr
3. Zend Platform T User Guide Zend Platform V 2 1 2 for 15 OS a By Zend Technologies Inc www zend com Zend The php Company Zend Platform User Guide Disclaimer The information in this document is subject to change without notice and does not represent a commitment on the part of Zend Technologies Ltd No part of this manual may be reproduced or transmitted in any form or by any means electronic or mechanical including photocopying recording or information storage and retrieval systems for any purpose other than the purchaser s personal use without the written permission of Zend Technologies Ltd All trademarks mentioned in this document belong to their respective owners 1999 2006 Zend Technologies Ltd All rights reserved Zend Platform User Guide for i5 OS issued August 2006 DN ZP 15UG 170806 2 1 2 002 Table of Contents Chapter 1 Introduction to Zend Platform sssssssssssnnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 1 About Zend Platform for i5 OS 2 MIR MT c r PPP MU 2 Central Control Center 2 Zend Platform Overvlem cece cece eee e cece eee eee eens eee hehehe een ana nnns 3 ENVIFONMENES etzatera etn a ace hardin lk darent a nec datada ta ala ada ditta aacra t hacen dh dr cf Baers 4 dae A gl EE 6 Central GANAKO 7 lei CEET 8 Central Node Communication 10 Single Point of Access GUI cci oa dada 10 Chapter 2 Configuring KASUAN AEA LLAN
4. AABT NON Mate bres In Windows the quotes must be present The text file should contain one function name per line Example mysql_connect mysql pconnect mysql query mysql db query mysql unbuffered query User functions can also be included in the Watch Functions file Each user function must be added with its Class class function If necessary inheritances should also be included in the file as only functions explicitly specified in the Watched Functions file are watched Finding Events that Interest You Zend Platform provides several ways for viewing Events that occur each way has different advantages and can be used to suit different requirements as follows e Zend Central Console Events at a Glance displays the top five events that occurred on all the servers Double clicking on an Event in the Console opens its Event Details screen e PHP Intelligence System Health displays an up to date snapshot of events monitored by Zend Platform and listed by server and Event Type Selecting a Location Node or a specific Event Type automatically filters the view to display relevant Events in the Event List 64 PHP Intelligence e PHP Intelligence Event List is a filterable display for viewing events in a table according to various parameters Choosing Change Table Fields modifies these parameters This opens a selection list of all the possible field options This window also includes an option to loc
5. When an Event of a user defined Severity occurs in the user designated Server a specific Event Action notification will be invoked H x 7 Help Event Actions 06 Feb 2006 17 06 28 Action Rules Actions Add a new action rule Event Type Select event Seventy Select severity v Server Select server Action Select action MJ ZE Ada Active Scverity Event Type Server Action Remove v When AI wA Y occurs on Gollum w Send XML data to httpi gollum test php MIR Memove a When occurs on R Remove When occurs on we Remove OK Cancel Apply Figure 11 Define Action Rules From this screen you can e Add remove an Action Rule currently defined in the system e View Action Rules currently defined for an Action Type in the system e Edit an existing Action Rule and apply the changes e Disable an Action Rule 31 Zend Platform i5 OS User Guide To define Action Rules for a server 1 Select the Define Action Rules tab 2 Enter Action Rule parameters in the Add a New Action Rule area a Select an Event from the Events combo For a complete list of Events supported in the current version of Zend Platform refer to the Configure Alert Rules section above b Select the severity from the drop down list c Select a Server from the drop down list of servers currently defined in the system d Select an Action from the drop down list of Actions currently defined in the system 3
6. seen es 22 X KM Monit ii 72 MABEL 29 AML leal 29 Z ADI NP ETE 101 Zend Error 72 Zend Monitor assa 16 Zend Bes 10 6 enn 72
7. Technical Level Benefits e Platform s PHP J ava Bridge provides the ability to interact with plain J ava objects e Platform s Java Bridge operates without the overhead of a JVM for each Apache process e Platform s Java Bridge consumes a finite amount of memory which is almost disproportional to the amount of activity that s going through it Operating and Configuring Zend Platform s J ava Bridge This section describes procedures for operating and configuring Zend Platform s Java Bridge Configuring Run time For running J avaMW the following command can be used java Com Send javamw JavaServer For correct execution classpath should include javamw jar file in the directory where JavaMW is installed e g Unix lt install_dir gt bin javamw jar Windows install dir MbinNVjavamw jar 106 Java Bridge J ava Bridge Java Status Page The Java Bridge tab provides status information about the Java servers connected to the network The information displayed in the Java Status Page shows information about a selected server The active buttons on the Java Status Page are e Stop Shuts down the Java Bridge daemon e Start Restart Restarts the Java Bridge daemon e Refresh Refreshes the page for the selected server e Help Opens the Online Help for the Platform J ava Bridge The Java Status page includes information about e java Environment The Java Environment includes the Java Version Java V
8. Test results can also be sent by e mail and stored outside Zend Platform Performance Event Trigger Settings and Analysis Initially Zend Platform Event settings are based on predefined default parameters As such these settings require calibration to suit specific environments The anticipated results are Event Details generated based on default triggers Running Zend Platform for the first time will most probably cause abnormal event generation behavior to many or to little events This behavior is attributed to two causes 1 The Default triggers need to be calibrated 2 The PHP needs to undergo additional performance Optimization Before making any adjustments to the PHP code that may turn out to be unnecessary The first action that should be performed is to calibrate PHP Intelligence Calibrating Event Triggers for Performance Optimization Calibrating PHP Intelligence is the process of adjusting Event Triggers to accommodate a specific Web application Event Triggers are calibrated from PHP Intelligence Event Triggers Rules are configured on a selected server and can be subsequently applied to additional nodes with the Clone Wizard This option should be used in node cluster environments When calibrating Event Triggers for performance optimization the following performance related event types should be addressed e Slow Script Execution Absolute and Relative generates an event when script execution exceeds
9. CONTROLLING INFORMATION DISPLAYED IN AN EVENT CUSTOMIZING EVENTS DATABASE MAINTENANCE In this chapter we will discuss how PHP Intelligence can provide improved communication between developers managers and QA teams through implementing the Problem Resolution Lifecycle The Problem Resolution Lifecycle Background Developing and maintaining Web applications is an intricate and highly demanding process Zend Platform facilitates the intricacies of the development process by employing an efficient problem resolution infrastructure the Problem Resolution Lifecycle This infrastructure s main goal is to help make the most out of challenging environments and tight schedules and prevent problematic issues from falling between the cracks With the Problem Resolution Lifecycle organizations can improve communication between the development testing and IT teams to streamline the development and deployment processes Using PHP Intelligence in development and production environments unifies the working environment and ensures improved information collection and distribution between development teams testing teams and IT teams See illustration below 61 Zend Platform i5 OS User Guide Zend Platform in the Working Environment 26 VS 4 QE Ko ei CAS o S a GO 9 c GC d 9 P dS Ge zu Se xd 06 4 Ze KAN we Ss A Q N Se Manager s La es Detailed Bugs P Quality Assurance Developer Figure 25 P
10. 1 Specify the function name object methods can also be used for example bar Tool 22 Configuring Zend Platform 2 Use wild cards to specify a range of function names for example mysql_ will select all functions beginning with mysql_ 3 Specify the full path to a file containing a list of functions each in a new line Database related functions are directed and reported as Database Errors see the Database Error event type Watched Functions File Event Types The Watched Functions file can added Function Error and Slow Function Execution event types PHP Intelligence Configure Event Triggers by entering a function in the field and pressing Add or specifying the full path to a file containing a list of functions When the Watched Functions file is applied to the Function Error Event Type the functions included in the file will be monitored and an Event Details screen will be generated Slow Function Execution This is a performance monitoring event Slow Function Execution events are used to identify bottlenecks within functions providing a more granular approach than finding bottlenecks in pages This type of event is useful in the production process for pinpointing performance bottlenecks by watching functions that the user specifies Slow Function Execution events provide a different perspective on problems view outside problems through the eyes of PHP Despite the fact that the code may be run
11. Appendix E zend ini Configuration Settings The following table lists the zend ini directives Directives marked with YES do not require restarting the server apply changes Accelerator Directives Directive Reload zend accelerator max wasted percentage YES zend accelerator max warmup hits YES zend accelerator consistency checks YES zend accelerator force restart timeout YES zend accelerator perform timings YES zend accelerator validate timestamps YES zend accelerator max cached filesize YES zend accelerator revalidate freq YES zend accelerator min free disk YES zend accelerator php extensions NO zend accelerator user blacklist filename NO zend accelerator compress blacklist filename NO zend accelerator compression NO zend accelerator compress all NO zend accelerator enabled NO zend accelerator output cache enabled NO zend accelerator max accelerated files NO zend accelerator mmap base file NO zend accelerator httpd uid NO zend accelerator memory consumption NO zend accelerator allow noshm NO 154 zend accelerator output cache config NO zend accelerator output cache dir NO zend accelerator use cwd NO zend accelerator preferred memory model NO zend accelerator dups fix YES Monitor Directives Directive zend monitor max var len zend monitor warmup requests zend monitor load sample freq zend monitor rotate freq zend monitor reconnect timeout zend monitor wat
12. Bandwidth Server MaxClients Requests per second Number of Concurrent Requests 119 238 357 Requests per second Without the 205 15 8 30 8 29 9 Average Time per Request Number of Concurrent Requests 119 238 357 Average Time per Request Without the 205 7 5 7 7 11 9 Ve Requests per second With the ZDS 24 5 415 604 Average Time per Request With the 205 4 9 5 7 5 9 send file onp 31 Oct 04 15 45 Ext the 205 Bits the 205 69 2 4 r1 P o a S 15 119 238 357 Concurrency Parras tne 205 EZKON the 205 11 9 8 9 el ERR LS i 119 238 357 Concurrency Figure 23 Zend Download Server Test Results When the Zend Accelerator is disabled only cached scripts are tested 52 Configuring Zend Platform If you do decide to run the ZDS Test on a production server you can watch the log file to see how many concurrent jobs ZDS is handling This indicates the number of Apache processes that would have been used if the ZDS were not installed Clone Wizard Once all settings have been configured on a node the Clone Settings feature allows for applying these settings to the different nodes in one single process To clone configurations 1 Go to Zend Central Console and click Clone Wizard The Clone wizard dialog opens after selecting a source server Use the View Tree By field to quickly find the source server Select the Source S
13. Description Use current directory as a part of script key zend accelerator preferred memory model Description Shared memory model to use zend accelerator dups fix Description Use hack to prevent duplicate definition errors zend accelerator cgi base shm address Description The base address for the CGI CLI shared memory block Monitor Directives zend monitor max var len Description Maximum variable length for collected data in POST SERVERS Limit applies to each single value zend monitor warmup requests Description Number of requests until monitor would use averaging statistics to produce events zend monitor load sample freq Description Frequency of checking for load events seconds zend monitor rotate freq Description Frequency for rotating monitor internal log files seconds zend monitor reconnect timeout Description How long monitor will wait until trying to restore broken connection to central seconds zend monitor watch functions 124 APIs and Directives Description List of functions to watch for time events file reads list from file zend monitor watch results Description List of functions to watch for failure return events file reads list from file zend monitor collector host Description Hostname for central zend monitor collector port Description Port for central zend monitor log dir Description Directory where monitor logs will be kept zend monitor ser
14. Last Occurence e 18 Jan 2006 03 16 39 16 Jan 2006 17 01 31 16 Jan 2006 17 01 31 16 Jan 2006 17 01 30 16 Jan 2006 17 01 30 Save filter Location xurya dolly2 zend cffice dolly2 zend office dolly2 zend office dolly2 zend office Figure 28 E ei Virtual Hosts All s Save Remove filter Select Filter v Remove Vhost kuzys dolly2 zend office dolly2 zend office dolly2 zend office dollyZ zend office vent List URL my_test php fevent_creator event creator size scrpt ph size scrpt ph Source File Line my test php 3 4 event creator w php 354 event creator w php size script php size script php The Following list describes the fields that make up the Event List ID Sequential number assigned to an event Event Type A descriptive name assigned to the event Count Number of occurrences of the event First Occurrence Date and time of event s original occurrence Last Occurrence Date and time of event s most recent occurrence Location The name of the server or Aggregated Group where the event occurred Vhost Name of the Vhost where the event occurred URL The URL where the event occurred Source File Path to PHP source file Line Line in code where event occurred Aggregation Hint The hint in the code that caused the event to be aggregated Function Name Name of PHP function where
15. in the same way that GET variables are considered e REQUEST The variable is set by the GET or COOKIE methods Can be found in PHP REQUEST array as well e SERVER Server variable is set as a server environment variable When selecting a server variable those listed in PHP SERVER array it will also be used as a determining factor for cache hits in the same way that GET variables are considered To define a Server variable select a variable from the list or choose Add a new variable to type in another variable e SESSION The SESSION variable is useful when PHP sessions are in use Can be found in PHP SESSION array as well Note 1 If a script is cached using a SESSION variable and the session does not start in this script the script will not be cached 2 If a script is cached using a SESSION variable yet the cookies are disabled on the user side and the SESSION ID is embedded directly into the URL the caching will not take place e ALLSESSION The script depends on all of the variables present in the session Can be found in SESSION PHP array as well It is mandatory to choose at least one Dependency 44 Configuring Zend Platform File Compression In order to maintain that Cached files improve overall performance compression settings should be defined These settings determine which files should be compressed The mode of compression is gzip format if the browser supports this format If not the data
16. 1 Select the Filter By options Group and or Event Name you wish to apply to the table 2 Click Go to display the filtered events in the System Health table Event Reporting Event reporting is the process of identifying events that were generated for the same reason and can be reported X times rather than reporting multiple occurrences of the same event There are two options for reporting events 1 By Server un aggregated 2 By Group aggregated Aggregation by server happens when identical events are generated on different servers The same event is reported for each server separately This is the default Aggregation Groups Event aggregation reporting is the process of identifying events that were generated for the same reason and can be reported as one event that occurred X times rather that reporting multiple occurrences of the same event There are two options for aggregating events 1 By Server 2 By Group Aggregation by group happens when several servers are placed in a group that is defined as Aggregated Console Manage Cluster Manage Groups At the bottom of the System Health table there is a message stating that Events that took place on the server before the server was a member of an aggregated group Aggregation by server happens when identical events are generated on different servers The same event is reported for each server separately This is the default Event information can only
17. Baseline This baseline measures performance based on Zend Platform s default parameters that are immediately activated upon installation The default parameters are Event Trigger settings Code Optimization and Code Acceleration Once Zend Platform is installed these components automatically begin to work on the PHP code The result is and immediate improvement to the Web application and initial PHP Intelligence event generation based on default Event Trigger settings The purpose of the Zend Baseline is to evaluate overall performance in relation to the Zend Platform defaults This information is used as an initial starting point for subsequent calibration and optimizations 87 Zend Platform i5 OS User Guide In the Zend Baseline stage it is common to experience abnormal event generation behavior too many or too little events generated This is a normal part of the initial calibration stage necessary for identifying how to adjust performance settings to obtain optimal Web application performance Site Baseline The second Baseline is the actual calibration process Based on information collected and observed in the first Baseline the performance settings can be calibrated to suit each organization s specific Web application The Site Baseline enables one to obtain insight into the overall performance of the Web application Once the Site Baseline is established by configuring Event Triggers these events can be further analyzed to
18. Code Through TCPIP Za 2 Over SSL Using Tunneling to batira Zend Studio Figure 5 Communication with Zend Studio Zend Platform i5 OS User Guide Central Node Communication Traffic between the Central Server and Node clusters mostly occurs from the nodes to the central server with the nodes reporting event information through the collector component to Zend Central However Zend Platform has a Server Status feature that periodically checks the availability of each Node in the cluster and provides up to date information regarding the components installed on the nodes The following diagram illustrates the communication between the Central Server and Nodes in a Cluster Zend Platform Central Zend Platform Node Central Server www server Apache PHP Zend Central Collector Apache Process WWW AR Apache Process Apache Process Collector Component Database Apache Ping for Procese Server Status GUI Node Process Debugger Send Events Through TCPIP Over SSL Figure 6 Central Node Communication Single Point of Access GUI Zend Platform s sophisticated architecture enables to use the Central Server as a single point of access for node availability and configuration enabling to configure node settings and behavior from the Central Server itself This connectivity is achieved by the addition of GUI components on the Nodes as well as on the Central Server in the installation process In this process the C
19. EE 48 Zend Platform i5 OS User Guide Transparent Mode E 49 Testing the KE TEE 50 enable 53 User Manage MENE sisi ii SE NEEN naaa EEN e dE wa a nda 54 Adding and Editing HSO EEren ar stunts a dias 55 Adding CUJUS 55 Editing AUS LE 56 Adding and Editing Groups 57 elle ERT 57 User dada GEET 59 Chapter 3 ALABA UN GAN 61 The Problem Resolution Lifecycle c cece eee memes eese nenne 61 Hiesa EE 61 Implementing the Problem Resolution Urecvcle assez 63 Creating EVEN TEE 63 Finding Events that Interest ou 64 euala 66 SAA gl DEER 67 AggregatiOn GhOUPS 2 niet cctaecudcen add medad daa deta tea dd Bl aca rd ia 67 Ewent a daba 68 Working with the Event AAE 69 Event ZUA 72 Understanding Event Details 72 General aaa 73 Event Occurrence Nf O sasori nannaa eee meses eee nee ese nemen nne 74 ZENG Studio Ege mM 74 GAUAREN A ote eaten tama BEE d Iu USE dea 75 Show Source TEE TI Event Administration e a e e Nola at odds TI Controlling Information Displayed in an Event 78 C stomizi Ng OSALAN 79 Custom ALEA 79 Event Callbacks aek rrara E dee dE ee SE wanna ts 80 Aggregate HIDE zerk E EEEa erba E AEE ean EEE are et tare 82 Event Aggregation Rule 83 Database Maintenance esie toot A da 84 Chapter 4 A Au AAN 85 OVERVIEW E 85 Code Accelerathoniccs UT 85 Code OPTIMIZA iii ie 86 Dynamic Content Ten La iii di Aa 86 Flepp sei
20. Event Callbacks are created by extending information already provided in Event Details to provide an audit trail for problem conclusion Register and Un register User Event Handlers The event callback mechanism uses the following API functions e register_event_handler e unregister event handler Register Event Handler To register a user function as an event handler the following API can be implemented register event handler event handler func Shandler register name S event type mask Parameters e event handler func The first argument is a callback function that will be called when the event is triggered Object methods may also be statically invoked using this function by passing the array objectname methodname to the function parameter e handler register name The second argument is optional and represents the name under which the function is registered If no name is specified the function will be registered under its own name e event type mask The third parameter is an optional mask of event types on which the handler should called The default setting is MONITOR EVENT ALL When a monitor event is triggered all the user event handlers are called and the return value from the handler is saved in an array keyed by the name under which the event handler was registered The event handlers results array is saved in the script runs table The first parameter is the name of the called function and it has
21. Event Details screen Type includes basic and event specific details such as event type event ID Timestamp Severity number of occurrences error type error text triggered value load average Source File Line Script Name Host URI Vardata Type amp Name Function Name Argument Numeric Value Function Included Files Backtrace etc Contents of the XML output can be easily utilized and integrated to provide an information feed to various legacy systems such as Bug tracking systems for development and QA CRM applications for managing customer care management systems such as Tivoli and HP OpenView for system health information and most commonly generic monitoring systems such as Nagion or BigBrother that only provide OS service information 131 Zend Platform i5 OS User Guide Using event information developers and administrator teams have a single point of reference to streamline the maintenance workflow You can further enhance your development lifecycle by debugging your PHP code referenced in Event Details screens directly through the built in integration with Zend Studio This feature includes debug capabilities that enable you to add watches define conditional breakpoints view the stack trace and step into the source code to immediately debug the problem Zend Platform s XML output enables information to be easily interchanged Using Event Details developers can be sure that information pertaining to code database and
22. Event Triggers Graphs a System Health Ks Refresh F nato 30 Jan 2006 16 24 49 Logged in as Admin Filter Uy v Group All v O Aggregate servers ce Miok Mi Moderate Misavere PHP Server Database Enduser Location Figure 27 System Health Screen To view the System Health table 1 Go to PHP Intelligence System Health 2 Select the Filter By option to filter events displayed in the table Filter options are described in detail below 3 Click Go to display the System Health table The fields that make up the Event Summary table are as follows e Location where the event occurred e PHP Current PHP events for the selected Host e Server Overall events related to general performance of server e Database Database events related to handling of queries e End User The output site field includes status information about output site 66 PHP Intelligence Filtering Table Data Zend Platform allows you to filter the event information displayed in the System Health table There are three group options e All displays System Health information for all servers and groups e Ungrouped displays System Health information for servers that do not belong to a specific group e Server by name displays System Health information for the selected server group only e Aggregate servers aggregates the servers belonging to the same group into one row To filter the data displayed in the System Health table
23. Java server therefore even after restarting the web server the statistics are maintained This naturally does not apply to restarting the Java server which will restart the statistics collection from zero Using the active buttons provided on the Java Bridge user interface you can Stop the Java Bridge Restart the Java Bridge or Refresh the Status Information shown on screen for the selected server To stop the J ava Bridge 1 Click Stop Platform opens an information screen that tells you that the Java Bridge was successfully stopped 2 Click OK to close the window or the corner X Platform closes the window and returns to the Java Bridge main screen 108 Java Bridge Configuring the J ava Bridge Zend Platform s Java module has two configuration parameters e zend javamw threads How many worker threads the server is using allowing this number of concurrent requests to be executed Default is 20 e zend javamw port TCP port on which the server is listening Default is 10001 Example Script The following example is the shell script for running JavaMW This script should be customized when necessary export CLASSPATH S CLASSPATH pwd javamw jar java Dzend javamw threads 20 Dzend javamw port 10001 com zend javamw JavaServer Add other entries into CLASSPATH if you use non standard Java packages PHP Configuration The PHP module uses the following configuration directives e java server port TCP port
24. Order placed lt br gt Current shopping cart lt br gt 116 Java Bridge get shopping cart data from the bean Scene ESE ee ge E eut Carr eite GUI foreach cart as Sitem peine Vicen name e Sitea comme at Sitemi orice os yap release the object store gt remove ZZ The example code can be understood as follows The code example is written in PHP and forms part of a PHP Web application 2 The PHP application first initializes an operation with the EJB located at a specific URL that has the name jnp yourflowers com 1099 3 The code then specifies the bean YourflowersBean that the application will look for Next the bean object is returned from the EJ B server The application then calls methods in this case the Java application includes two functions e place order receiving two numbers client ID and the item ID to add to shopping cart e get cart receiving one number client ID and returning the list of the items placed in the shopping cart so far After script execution the referenced class may be disposed This completes the J ava Bridge chapter of the User Guide In this section we have described how provide and configure Zend Platform in order to obtain interoperability with other existing legacy or backend applications written in J ava 117 Chapter 6 APIs and Directives IN THIS CHAPTER ZEND PLATFORM APIS ACCELERATOR FUNCTIONS OUTPUT CACHE F
25. System Administrations a single point of reference for production environments and to streamline maintenance workflow In environments where multiple management applications are an everyday reality Zend Platform provides a flexible information feed to legacy systems relieving the overhead normally required to integrate with these applications 134 Tutorials Calling an EJ B on Websphere from PHP This tutorial reviews the steps needed to call an EJB on WebSphere from PHP using the J ava Bridge These instructions assume that the developer has a system s with WebSphere PHP and the Zend Platform installed To call an EJB on Websphere from PHP a script file needs to be created This script should start the javaMW server with the correct settings to run a Websphere client Some of the important things to remember are 1 Use IBM s java that ships with the Application Client to run the javaMW server 2 The jars containing the client classes for any EJB that is to be called need to be classpath of the javaMW server 3 The jars and environment variables for the WebSphere application client runtime need to be on the command line staring the javaMW server The following is an example script file for starting the javaMW server with the WebSphere runtime configuration options and the jars needed to call the Basic Calculator Technology sample shipped with Websphere This script is a modified version of the Basic Calculator Thin C
26. The information included in Event Details varies according to event type For example PHP Error Event Details include different information than a Slow Script Execution Event Details simply because these events require different information to perform diagnostic analysis For example A PHP Error will include in the General Information the error s text and in the Event Context the Function s Data However in a Slow Script Execution Error there is no need for the error text or the function s data and there will be information on how long the script ran for included files and the load average at the time of the event If there is not relevant data to display in an Event Details screen the section will not be included rather than appearing empty General Information The general information section of the Event Details provides basic information about the event depending on the event s type as follows lE Report for PHP Error 64 EN Severe Event Requested URL http kuzya my test php dd usr local apache ss 29 htdocs my test php red In file usr local apache ssi 29 htdoce my_test php on line 3 PHP Error of type E_ERROR error Call to undefined function sdds Figure 30 Event Details General Information e Title The top of the Event Details displays the event that generated the Error and the Event ID Error The Event ID can later be used to locate the event in the Event List or the Console in the filte
27. are being used and if necessary open these ports on your firewall Zend Platform i5 OS User Guide Architecture Zend Platform is a complete environment that provides rich functionality by interacting with the existing PHP in a simple and generic way Zend Platform is a non intrusive extension to an existing environment with minimal overhead that helps obtain enhanced performance and reliability Zend Platform extends the Zend Engine with the organization s execution environment providing the platform on which Web services business to commerce applications content management Intranet and business to business applications are based B2C Applications B2B Applications Content Management Web 3 Intranet Services p rtf T 1 Zend Engine I amp II Figure 2 Zend Platform and the PHP enabled Enterprise Zend Platform consists of two deployed components the Central Server consists of a Server Node and the Node component Zend s Central Server is a central management component for governing node configurations and script performance information The Central Server can be deployed as a standalone Zend Platform environment for a single server and for this reason contains fully functioning node components However the prominent application for Zend Platform is multiple server cluster based environments Zend Central provides a single point of access and con
28. be aggregated at the time of the occurrence and for information integrity purposes will not be retroactively aggregated If events occurred on individual servers before they were grouped they will be reported as un aggregated events 67 Zend Platform i5 OS User Guide Event List The Event List is a filterable table that displays Events that occurred within a user definable period of time Information displayed in the Event List can be displayed as follows e Events can be filtered by the following categories Events From Event Type Virtual Host Event Severity Status and Time Filter e Events can be located in this screen by the event s ID e Columns in the Event List table can also be customized Use Change Table Fields Specialized filters can be created and saved using the Manage Filters option Filtering by Virtual Host Several servers can be added to a user defined group and used to filter the display to show Events that occurred on a specific selection of servers To define a virtual Host name that will be added to the list in the filter go to the Virtual Host filter field and choose Selected This option opens the Change Virtual Host screen The Manage Filters section allows users to save user defined filter definitions To save user defined filter definitions 1 Define the filter settings in the Filter By section Select Manage Filters to expand the filter management options Enter a user defined name fo
29. been added to manually add Virtual Hosts This option allows users to create the actual virtual host list for any given server Virtual hosts can be added or deleted from this tab Virtual hosts are added per server However virtual hosts can be deleted in one of two ways 1 Per virtual host name do not select a specific server name before adding or deleting the virtual host 2 Per virtual host for a specific server select a specific server name before adding or deleting the virtual host When deleting a virtual host all the events related to that virtual host are permanently deleted from the event database 14 Configuring Zend Platform Restrict Access to Virtual Hosts Defining Virtual Hosts provides a way to prevent certain users from gaining access to information regarding certain Virtual Hosts This provides an additional level of authorization that is more precise then granting permissions per server To restrict user permissions by virtual host 1 Go to Zend Central Console User Management 2 Select the server on which you want to restrict permissions and click the edit button The Edit User Wizard opens see Adding and Editing Users for complete instructions on the Edit User Wizard In step 2 make sure the check box next to No Server Restriction is left unchecked Select the check box next to the virtual hosts that should be granted for access This will grant access to the selected virtual hosts
30. compressed Settinas Download Server On Settings Run Performance Test Run Compression Test Run Download Test Figure 12 Performance Tab Console Initially the Console shows the installation defaults regarding which feature is enabled On or Off Once changes are applied the console will be automatically updated with the new configuration settings In some most changes are applied by restarting the Web Server 33 Zend Platform i5 OS User Guide The following table lists the details and options available from the Console tab Component Overall Performance Gain Code Acceleration Dynamic Content Caching File Compression Download Server Console Details Shows the last performance test results Shows the Code Acceleration component s status On Off and basic code acceleration statistics Shows the Content Caching component s status On Off and basic Content Caching statistics Shows the Compression component s status On Off and file compression settings Shows the Download Server s status On Off Actions Update leads to Performance Testing Analyze Site From this Tab site analysis tests can be run and results can be viewed Get Latest Detailed Performance Gain leads to Performance Testing Analyze Site with the last performance test results expanded on the screen Reset Clears the Code Accelerator memory Settings Leads to the Code Acceleration section of the Setti
31. evaluate the mode of action required to optimize the Web application s performance At this point it is recommended to perform a Site Analysis to benchmark the Web application The Benchmark information provides an initial indication of the Web application s current performance before applying the additional performance tools This will provide a point of comparison to view improvements that occur after subsequent optimization is done with Zend Platform After the Site analysis the PHP code can be optimized Optimization is obtained by implementing performance tools to areas in the PHP that exceed the Site Baseline settings still generate events There are four possible choices for adding performance features to PHP code 1 Full page caching 2 Partial page caching 3 Compression 4 Blacklist files or directories Completing optimization of the Site Baseline brings us to the Optimized Baseline Optimized Baseline The Optimized Baseline represents the stage where the Web application is optimized and Zend Platform is calibrated with the Web application From this stable stage all that is left to do is to let Zend Platform perform regular Production Monitoring When the Web application is re deployed or changes are made this process should be repeated from the Site Baseline stage in order to reestablish the Optimized Baseline Now that we have established what the performance lifecycle does and the tools it comprises The next step is to
32. for servers that were added to Zend Platform using Zend Platforms Node installation script Only servers that have been installed with the Zend Platform Node installation will appear in the Manage Server tab To add a server to Zend Platform so that it appears in the Manage Servers tab 1 Run the Zend Platform Node Installation Process Please see the Zend Platform Installation Guide for details on Node installation 2 Zend Platform automatically identifies registered servers and displays them in the Manage Servers tab 3 The installation script sets the Server Name Now the new server s settings can be defined Server settings are defined from Zend Central Console Configuration and Management Tools Manage Cluster The Server management settings are as follows e Server Address The actual hosts address not editable e Server Name The server s name for identification and all references to the server from Zend Platform e Group Designate a server to an existing group new groups are added to the list from the Manage Groups tab e GUI Directory States the location of the server s GUI Installation e SSL Check the box if the server uses SSL e Port Specifies the port with which the specific server works e Remove Removes the server from the database unregistered and deletes all events related to the removed server These settings should only be changed if changes that may affect these settings
33. id GetQuery sqgl 3600 S airports arr unserialize S airports str Sout P Departing Airport SELECT NAME N depart airport V foreach airports arr as Sairport Sout SEI Some eg EII WD UE ar porne E Yael AJA SU Sieruiceyexenere Macs Wl oe Ye see ge Ws exelwo cone This function is more general purpose meant to be used with output cache fetch it performs an SQL query and returns the results as a serialized string function GetQuery sql query 142 Tutorials Sresult mysql query sql query res arr mysql fetch array result MYSQL ASSOC Sras sir serial dize Ses mu return res str 2 Usage Notes You can use output cache fetch to cache non string types e g arrays and objects of PHP variables by using PHP s serialize and un serialize to convert them to strings and vice versa output cache fetch requires the code which generates the cache data to be wrapped in a function This allows the cache routine to skip the execution of this code if the data is already cached output cache put and output cache get provide a direct way to store and retrieve data from the cache Prototype void output cache put string key mixed data void output cache get string key int lifetime output cache put takes two arguments 1 The key value with which this data will be cached 2 The data to be cached sca
34. in the Event Details screen e See the event internal data in Event Details Allows users belonging to group to view the event internal data variables included files from the Event Details screen e See the event source code in Event Details Allows users to view the event source code in the Event Details s embedded viewer e Use the Zend Studio Diagnostics in the Event Details Allows users to view profile and debug event source code in Zend Studio e Changing Zend Platform Settings in the Preferences Allows users to change preferences in Zend Central Preferences e Configure and change the Event Actions Allows users to configure and change Event Actions from the Event Actions screen e Configure and change the Action Rules Allows users to configure and change Action Rules from the Define Action Types Rules screen e Manage Server Allows users to manage servers from the Manage Cluster screen e Manage Groups Allows users to add and change group settings from the Manage Clusters screen e Cloning configuration between servers Allows users to clone server configuration to additional servers from the Clone Wizard e Update Servers Data Allows users to update server data from the Update Servers Data screen 57 Zend Platform i5 OS User Guide e Use Support Tool Allows users belonging to the group to access the Support Tool from the Support Tool link e Configure and change the Event Triggers Allo
35. multiple user 54 N N A Test Results 90 New Group 57 New SS 55 Node Installation nos 12 NONE cis lb 45 NOTICE MMC 22 O Only Cached Eiles sese 45 lee ER OS Eu TEE 107 OS Verna aa a 107 OUEDUE SE ee as 66 P parameters riinan E ERa 21 Partial Page Content Caching 41 Pass WO euro agence dar ted nes Cete in Mn 55 dauela 35 90 performance configurations 35 Performance Lifecycle suse 16 Performance Monitoring Event 21 23 24 Performance Test 90 Performance Test results 90 Permission Group 54 Dermlsslons nnn 55 57 Permissions See 55 alc Em 66 PHP EN EE 22 PHP events os rer eoe nr ind 66 Malen e de 23 PO Cuida ei rolas 12 Preserve Event 72 Preserve Gelected sse 68 Previous Test Results 90 PEOCESSOS EET 21 27 Production ect tes EE IER RENE RA 22 wq e e 72 Profile URL ies idad as 72 Q p EP ERICH 22 Query Execution sss 26 R Refresh ics rw ai E TRU OR 107 Relative nen 21 24 Relative Events 24 26 Moul UE 12 54 REOPEN EVEN Ecco ci ii 72 Reopen daaa tees tees 68 REQUEST ctra etarata tata 41 Requested URL 72 e UE EN resolving events 72 Restante gees dek 107 Restore Detauhte eet eeeeeeenees 35 rule based notification eee 29 A E 16 29 S SOV I ane EN 35 dde dale 24 28 Send a report via e Mail eee 29 sending the Information 29 SOME m 41 66 Server by aa 66 Se
36. of report is typically preferred by users who need to be notified of an event but do not require the content of the report to be available for further use e XML Report a structured XML report which is not only informative but which can be made available for further use For example the xml event data could be used as input for a monitoring script The structure of the xml report follows the structure shown below teach attribute exists if it exists in the Event Details screen egizu versions OY m lt event type event_id timestamp time severity gt IO ILS cue COS lt error type gt error text lt error gt lt stats triggered_value avg load_average gt if there is a source file lt source file line gt lt script name host uri gt lt vardata type name value gt lt script gt if there is a function lt function name gt lt args gt lt arg num value gt lt args gt lt function gt 30 Configuring Zend Platform if there are included files lt included_files gt lt file name gt lt included_files gt if there is a backtrace for this event lt backtrace gt lt call depth function file line gt lt backtrace gt lt event gt Define Action Rules The Define Action Rules screen is accessed from Zend Central Console This screen ties together the elements of the rule based notification system monitoring and reporting by creating a logical rule that can be understood as follows
37. one of the following options 1 Apply Caching to a single file 2 Apply Caching to an entire directory Specific caching settings given to files and directories override the main settings defined in Performance Settings Caching with the Performance Test Reports Performance Test Reports provide site analysis information in terms of performance gain and popularity The information included in these reports provides a strong basis for evaluating if a file should be cached 96 Performance Site Analysis Report Performance Test For http gou OO 23 Jan 06 17 07 Performance Popularity Edit Script Path Gain Rank tdt E home rooUsite zde_pofiler_bug php Not Improved 98 01 2608 hits Edit E home root site ZendPlatform 2 1 2 infra gu styles php x3 26 0 41 11 hits Edt fhome root site ZendPiatform_2_1_2 zps run php x25 75 0 19 5 hits Edit E home root ZendModules ZendPlatformGUl zps run php x3 00 0 19 5 hits Edit E home root ZendModules ZendPlatformGUI zps site stats php x3 99 0 15 4 hits t n E home root site ZendPlatform 2 1 2 zps gu zps styles php x1 94 0 15 4 hits Edit H home roct site ZendPlatform 2 1 2 zps site stats php x23 41 0 15 4 hits Edit E home root ZendModules ZendrlstformGUl zps tabs php x1 62 0 08 2 hits Edit E fhome root ZendModules ZendPtatformGU1 zps uritest php Not Improved 0 08 2 hits Edit E home rootsite ZendPlatform 2 1 2 zps urltest php x23 36 0 08 2 hits Average improve
38. only 5 Press finish to close the Edit User Wizard and return to the User Management Screen 15 Zend Platform i5 OS User Guide Configure Event Triggers Event triggers can be customized to suit your working environment Zend Platform comes ready with default configurations However a person with an understanding of the environment s settings and performance standards should construct the Event Triggers to suit each unique environment Event Triggers define the conditions under which an event will be captured by the monitoring system PHP Intelligence To Configure Event Triggers go to PHP Intelligence Event Triggers or use the Shortcut from the Zend Central Console Users are prompted to select a node before entering the Event configuration screen as all configurations are made to a selected node The top bars of screens display the name of the node no name means the user is working directly on the Central Server For example the image below displays the following text Server name Fireforge This means that the user is no longer working on the Central Server but working directly on the node in our case a node who s alias is Fireforge 16 Configuring Zend Platform Zend Platform Zend Central PHP Intelligence Performance Studio Server Session Clustering Java Bridge P Logout System Health Event List Event Triggers Graphs Define Event Tri ers m Save Rules Clone Event Triggers Ga Refresh He
39. performance issues can be easily reused in a multitude of applications Examples of this use include sending SMS messages containing event details or triggering a mailing system to send a promotional gift to a customer who encountered a performance problem Done by extracting customer ID information provided to you in the Event Details screen cookies Event Details screens are delivered as XML by defining the relevant action Submit Report to the Specified URL for an event The report information is submitted as XML data to the specified URL Submission is done using the POST method and the data is supplied through a variable named event_data This variable is accessible in PHP through POST event data XML reports are structured as follows Each attribute is included if it exists in the Event Details screen ege version Vil ZU PS lt event typ vent_id class timestamp time severity gt If there is an error lt error type gt error text lt error gt lt stats triggered_value avg load_average gt If there is a source file lt source file line gt lt script name host uri gt lt vardata type name value gt sf exeuciljone If there is a function lt function name gt lt args gt lt arg num value gt lt args gt lt function gt If there are included files lt included_files gt lt file name gt lt included_files gt 132 Tutorials If there is a backtrace for this event lt backtrac
40. provides a fast and efficient means to reproduce and resolve problems while maintaining a complete audit trail of the occurrence s details PHP Intelligence proactively alerts you to problematic occurrences in your application This means that if you are a Developer or System Administrator you will not need to monitor the Zend Platform console at all times instead the information comes to you An event containing the audit trail of an occurrence can be made known to you through an Email Notification If you require full event details available outside of the Zend Platform console an Event Details screen can be published to a URL in XML format Both Event Details screens contain aggregated information relevant to the occurrence of an event or in other words Full Problem Context Event type Event ID Timestamp Severity number of occurrences etc Full Problem Context provides valuable information for the entire PHP application lifecycle development production and deployment Exposing the source of an occurrence along with the ability to drill down and investigate details pertaining to an event s location time and context provides in depth insight to the reasons why the event occurred and a basis for resolving the issue PHP Intelligence includes the following Event Details screen Types Slow Script Execution PHP Errors Function Errors Memory Usage Database Errors Query Execution Output Sizes Load Averages and more Each
41. request based on its full URL ALLGET You can condition the settings to be more general or more specific as desired To change default caching conditions Go to Performance Settings and go to the Dynamic Content Caching section of the settings screen Select Change Default Conditions to open the Define Default Caching Conditions dialog Define Default Cac hing Conditions Cache Lifetime 360 Seconds Default Dynamic Caching Conditions Taal TZ Condition GEY KI yyy None e Add Condition Discard Changes Save Cancel Figure 18 Define Caching Conditions Dialog The default caching condition is ALLGET which means that the entire GET string is used to identify a cached item The GET string includes everything that appears after the question mark in a URL The ALLGET variables can be found in the _GET PHP array as well The following actions and conditions can be applied to the Default Caching settings e To limit the ALLGET condition select Except from the restrictions drop down list to exclude a specific GET variable from the ALLGET e To change the ALLGET condition select a new condition from the drop down list e To add another condition press Add Condition and select another condition type from the list Type the variables in the new condition row and restrict if necessary The same condition can be used several times each time with a different restriction e To remove any condition
42. will be sent and there can be many classes of custom events However if the URL action is used a script can be used to identify the event s class and different behaviors can be implemented according to class 28 Configuring Zend Platform Define Event Actions Once Event Triggers are configured the next logical step is to determine the actions and action rules that will be applied to Events generated by the PHP Intelligence module All Events are immediately reported inside Zend Platform s PHP Intelligence module Events can be viewed from PHP Intelligence Event List However Events and the information included in the Event Details screen can also be sent via E mail or to a URL by configuring Event Triggers Actions are applied to generated Events All Events are immediately reported inside Zend Platform s PHP Intelligence module Events can be viewed from PHP Intelligence Event List Event Actions enable sending Event details via E mail or to a URL To configure Event Actions go to Zend Central Console and select Event Actions There are two steps to defining event actions The first is to define Actions and the second is to define Action Rules e Actions determine the details of by specifying an e mail address or a URL e Actions Rules determine which events by specific criteria will be sent according to one of the Actions Define Actions Clicking the Event Actions URL opens the Actions dialog This d
43. ACHING CODE ACCELERATION CODE COMPRESSION ZEND OPTIMIZER ZEND DOWNLOAD SERVER ZDS The Zend Performance module provides a collection of comprehensive tools for enhancing PHP Web applications and Server performance in Enterprises Using Performance Provides e Increased server throughput with less hardware e Improved user experience with faster response time and download time e Reduced stress on production database servers and http servers e Reduced costs on new hardware purchases and IT maintenance operations e Better utilization of existing hardware resources and capacity Overview The Zend Performance module consists of several components for providing server performance optimization e Code Acceleration e Code Optimization e Dynamic Content Caching e File Compression e Download Server e Performance Tests Code Acceleration Code Acceleration begins from the first moment Zend Platform is installed The Zend acceleration component performs a pre compilation of your PHP scripts eliminating the lag time and interpreter time involved in script parsing During compilation the code is also Zend Platform i5 OS User Guide optimized resulting in even faster execution time How it works Server side pre compilation generates persistent bytecode Modified scripts are automatically detected Compiled scripts are optimized using advanced code optimization methods Code Optimization Code optimization begins from t
44. ALSE if no handler we registered under the given name e Parameters string handler name the name you registered with the handler you now wish to un register ZDS Zend Download Server zend send file bool zend send file string filename string mime type e Description Send a file using ZDS e Return Value FALSE if sending file failed does not return otherwise e Parameters filename path to the file mime type MIME type of the file if omitted taken from configured MIME types file The ZDS is not currently supported in Windows 122 APIs and Directives Zend Platform Directives Accelerator Directives zend_accelerator max_wasted_percentage Description Max percentage of wasted memory until restart is scheduled zend_accelerator max_warmup_hits Description How many hits are considered warmup for statistics zend accelerator consistency checks Description Check cache s checksum each N requests zend accelerator force restart timeout Description Time to wait for cache being unused when restart is scheduled seconds zend accelerator perform timings Description Collect performance statistics zend accelerator validate timestamps Description Check file timestamps zend accelerator max cached filesize Description Max cached size for content cache Kbytes zend accelerator revalidate freq Description How often to check file timestamps on Windows seconds zend accelerator min free di
45. B of memory In order to capture this event PHP mustbe compiled with memory limit support F Excess Memory Usage Relative Script memory consumption varied by o 95 from avg Script memory consumption varied by 9 from avg 2 Database error This event occurs when a database related function fails El Slow Query Execution This event occurs when a database related function performs above the threshold E Script output size varied by o Jo from avg 2 Inconsistent Output Size v W Script output size varied by o Jo from avg E Average number of active processes waiting for CPU time exceeds o 2 Load Average W average number of active processes waiting for CPU time exceeds o 2 Custom Event This event occurs when the API function monitor_oustom_event is called from a PHP script Figure 8 Define Event Triggers The Event Triggers screen is used for defining and modifying Event Triggers to monitor events on a specific node The table is used to define the conditions under which an event will be captured by the monitoring system The possible actions on this screen are e Configure Event Triggers for a specific server e View Event Triggers currently defined for the node e Filter the view of events displayed in the Define Event Triggers table 17 Zend Platform i5 OS User Guide e Clone Events To configure Event Triggers 1 Click Event Triggers in the Configuration and Management Tools list of sh
46. Click Add or Apply a Pressing Add adds the new Action Rule to the list of Action Rules defined in the system b Pressing Apply applies the changes to a rule that you have edited Read more about how your organization can leverage information generated by events in the Tutorial Integrating Existing and Legacy Applications 32 Configuring Zend Platform Configuring Performance Customizing performance is a way to benefit from the Zend Platform advance performance features Setting initial defaults enable the use of basic performance features Additional configurations can be applied to customize performance to correspond with organization specific requirements These configurations are addressed in the Chapter Performance Lifecycle Performance Tab Zend Platform s Performance settings are configured and viewed from Performance Console The Console section of the Performance tab is a main performance management screen through which basic details and commonly used Performance actions can be viewed as follows gt nein Console 06 Feb 2005 17 54 02 Logged in es Admin Server name Gollum Overall Performance Gain 1 12 Update Valid for 23 Jan 06 17 07 Code Acceleration On Reset 126 files accelerated Settings 7 96 of 32MB used Dynamic Content Caching On Reset Default Cache Lifetime 360 Settings Default Dynamic Caching Conditions GET yyy 1 file cached Add Remove File Compression off No files are being
47. Configure Event Triggers customize the Event Triggers to suit your working environment The Zend Platform installation comes ready with default configurations however it is recommended that a person with an understanding of the environments settings and performance standards configure Event Triggers accordingly e Configure Event Actions once Event Triggers are configured the next logical step is to determine the actions and action rules that can be applied to Events generated according to Event Triggers e Configure Performance adjusting performance requirements is a way to benefit from the Zend Platform advance performance features e Clone Settings once all initial settings have been configured the Clone Settings feature can be used to apply settings to other nodes in one single step e Configuring Users and User Permissions Roles granting different levels of permissions to different users provides a means for controlling actions performed in the environment and for enforcing work procedures This is the last step to customizing Zend Platform to your working environment Manage Clusters Zend Platform manages clusters to make them available and manageable from a single 11 Zend Platform i5 OS User Guide location the Central Server Clusters are identified as a single unit for monitoring and management purposes However each node in the cluster can be individually accessed from the Central Server Events originat
48. Custom events for generating a User Defined event that is not based on specific PHP Intelligence Event Triggers e Event Callbacks for adding user defined information to Event Details e Aggregation API for setting different events to be aggregated with other events Custom Events Custom events are a unique type of event that is provided for Zend Platform users in order to initiate events in their scripts This type of event is different than other event types in that it allows controlling event generation as opposed to the other events that are triggered by a certain occurrence Custom events are used to generate an event whenever the API function monitor_custom_event is called from the PHP script Description This event type enables the generation of an event on occurrences that are not necessarily built in Zend Platform events error and performance issues Custom events are used whenever you decide that it is significant to generate an event in a certain situation Each event type is given a name for easy identification type Function Usage void monitor custom event string class string text integer severe mixed user_data Parameters e class helps to define several types of custom events This description will be showed in the Event List and in the Event Details e text error text used to describe the reason for the event This text will appear in the Event Details e Ssevere the severity leve
49. GE TECHNOLOGY OPERATING AND CONFIGURING ZEND PLATFORM S J AVA BRIDGE THE J AVA BRIDGE USER INTERFACE USABILITY ISSUES COMMON TASKS The Zend Platform PHP J ava Bridge is a PHP module that connects the PHP object system with the Java object system It can be used to access Java based applications running in a Java application server Platform s Java Bridge offers significant performance and scalability advantages Specifically the memory consumption in the Platform PHP J ava Bridge is constant regardless of the number of PHP sessions unlike the equivalent solution for example in PHP 5 The PHP Java Bridge feature should interest three types of enterprises e Companies that have investments in J 2EE application servers can take advantage of PHP s Web enablement capabilities while preserving the utility of their Java investment e PHP centric companies that want to take advantage of J 2EE services that are not present in scripting languages specifically PHP e Companies that are not highly invested in J 2EE and legacy systems can take advantage of Platform s PHP Java Bridge to interact with plain J ava objects 103 Zend Platform i5 OS User Guide About Zend s J ava Bridge Technology Zend s Java Middleware module J avaMW provides PHP connectivity to Java The API is analogous to the standard PHP Java API http www zend com manual ref java php however the implementation is different JavaMW uses a stand alone Java se
50. HP Intelligence Implementing the Problem Resolution Lifecycle The Problem Resolution Lifecycle is a process of defining PHP Intelligence Event Triggers according to acceptable run time performance parameters PHP Intelligence enforces Event Triggers and issues Event information in an Event Details screen according to the Event Trigger definitions When an Event occurs PHP Intelligence compiles a complete profile of the Event s occurrence and its precise details An Event Details screen includes comprehensive details in order to enable developers and testers to recreate the Event ina way that mirrors the conditions of the original occurrence This information can then be used to diagnose problems by fine tuning Event Triggers to accommodate normal occurrences or resolve actual run time problems and errors With Zend Studio Diagnostics problems and errors can be easily diagnosed using the Event Details screen functions Test URL and Profile URL and further information can be analyzed using Debug URL and Show Source Code In addition problems in code can be immediately resolved using the Zend Studio Editor which allows changes to be immediately made and deployed not only to a single server but also to all nodes belonging to the same Group Events can be preserved to leave an indicator of these occurrences if necessary Furthermore user permissions can define who is permitted to perform actions inside an Event Details screen enforcing a structu
51. HP Processes or More Java Bridge 7 WebServer ESE mud 4 Zend dr Internet Platform Java Bridge JAVA PHP Figure 44 Zend Platform s Java Bridge Implementation 115 Zend Platform i5 OS User Guide While the single JVM constitutes a single point of failure the fact is Zend s PHP Java connection is the most robust on the market Failures in systems of this type generally tend to occur when the Java Server is overloaded rather than as a result of glitches in the applications Zend Platform s system architecture insures performance by diminishing overhead However in the event of failure the Java Bridge GUI supports a Restart feature that makes monitoring the status of the Java Server and restarting quick and simple One last point if the failure was caused by a glitch in the application the same thing would most likely occur in each of the JVMs in the non Zend system Example 3 Case Study in Management Integration A company called FlowerPwr com sells flowers over the Internet They are a successful East coast based firm that has an aggressive management profile They are currently in the process of acquiring a West coast competitor let s call it Yourflowers com that provides a similar service FlowerPwr com has its own website and its various enterprise applications were written in PHP Yourflowers com has its own Website however all its applications are Java based and were developed for J 2EE They hav
52. N or COOKIE variables Add the User Name and Password to test URLs that are restricted by HTTP Authentication 3 To delete any variable from the list click next the variable To add specific SESSION variables to the test make sure that your PHP is configured correctly to work with sessions For example if you use files as your session save handler confirm that the session save path is a valid path If you use user as your session save handler you must prepend the file containing the user level session storage functions 4 To determine the Duration of test specify the time in seconds per script in the Duration of test box 5 Press Run Test Results The Test Results screen depicts the Dynamic Content Caching Results the Code Acceleration Results and the File Compression Results The Dynamic Content Caching Results compares between the Base script and the script after it has been cached and calculates the total performance improvement accomplished due to caching The Code Acceleration Results displays the performance gain If the script is cached acceleration does not improve performance acceleration is therefore not necessary The File Compression Results compares between the original file size and the compressed file size and calculates the savings in bytes and the improvement in percentage When running the Analyze Site test you can choose to run the Performance test separately from the Compression test 90 Per
53. O 11 Manage CIUSters arica a id bia ea raia 11 Manage CV or adas 13 Manage GAUETAN 14 Manage VHOSTS nri iana dai dadas 14 Restrict Access to Virtual baaa 15 Configure Event TDI soii Lanna e A Zek RAA 16 Why Configure Event Trtogers cece ee He em men enses enn nnne 18 Filtering Event Trigger 18 Define Event Triogers isses mense rr rr eese ne esses sen e nennen 20 Slow Script Execution BARU 21 Slow Script Execution Relative assez 21 BEER et 22 Stee giel gr EEN 22 Watched Functions File Guda AL 23 Slow Function EXGCULION MEET 23 Excess Memory Usage Absolute and Relative cccccccceceeeeeeeeeeeeeeeeeeeeeeeteateseeeseeeenneenes 24 Database Errores lec dereen 25 S Ee dca 26 Inconsistent AURA corran ieren II meses enne nens enne ne ense nnn 26 LOA EET 27 ido EAE DEE agra ELT 28 Define daude aA 29 Breed cn 29 Define Action ORAN 31 Configuring P erformatice EE 33 Performance Tab EE ER EEN GE ER Tree AGN EE EE 36 Tree View Virtual HostsUst seat eme ee eene nnn 36 BRI Ren 38 Define Caching SettinOS eer EES euena ENEE dE SN NR GENEE ENEE EE ENEE las 38 Modify File qub lt a 39 Riezu lee dala eau 39 Define filesto le ANNA 40 Dynamic Content Caching EA 41 Full Page Content Caching iiss tests scat eed lia id LA 41 File Salda 45 ET TEE 47 Configuring the Zend Download Server ZDS sss meme enn 48 Manual
54. Script execution cell Relative Events event definitions are based on relative values i e percentage Relative values are set according to warm up settings default value of 500 requests If necessary the default value can be modified manually by changing the zend monitor warmup requests directive in the zend ini 21 Zend Platform i5 OS User Guide PHP Error PHP Errors are used to identify all types of PHP errors such as e Hard errors that cause stops in page execution e Warnings that interrupt the end user experience e Notices that could lead to larger problems This type of event is useful in QA processes to identify problems that may have slipped through the cracks during production Description Used to generate severe or moderate events on selected PHP errors when they occur and identify real time failures for given users To select a PHP Error Level scroll through the selection and use CTRL for multiple selections The trigger types lists are the same therefore severe event selection takes priority over moderate event selection Additional Rules Event reporting for PHP errors can be changed by setting error reporting to O or using the silence operator There are three options for activating Additional Rules 1 Always Report Errors Ignore the error reporting setting and the silence operator and report all PHP errors 2 Report errors that match the error reporting criteria Ignore all PHP err
55. Server e Zend Java Bridge e Zend Optimizer e Zend Debugger Nodes have to be registered with the Central Server in order to enable communication between the Node and the Central Server There are two ways to register a Node to the Central Server the installation process or through manually registering the Node Zend Platform Nodes consist of several components that report information to the Central Server and provide debug capabilities for PHP scripts residing on a node e A Collector Component for transferring event information to the central e Debug Infrastructure for debugging live pages directly from a node This option is supported by Zend Studio and Zend Core The following illustration is a representation of Zend Platform Node components Zend Platform Node www server Apache PHP Apache Process Apache Process Apache Process Collector Component Apache Process Node Process Debugger Figure 4 Zend Platform Node Components Introduction to Zend Platform The Collector component listens to the running processes and collects event information For more on Events go to Configuring Events to be reported to the Central Server over a regular TCP IP connection using SSL However only if the node has the appropriate certificate indicating that it is par of the cluster will the Central Server agree to receive event information from a node s collector The type of information the Collector listens to an
56. UNCTIONS MONITOR FUNCTIONS ZDS ZEND DOWNLOAD SERVER ZEND PLATFORM DIRECTIVES ACCELERATOR DIRECTIVES MONITOR DIRECTIVES GUI DIRECTIVES COLLECTOR CENTER DIRECTIVES DEBUGGER DIRECTIVES ZDS DIRECTIVES This chapter is a reference chapter for Zend Platform APIs and directives Zend Platform APIs Accelerator Functions accelerator set status void accelerator set status bool status e Description Disable enable the Code Acceleration functionality at run time e Return Values none e Parameters status if false Acceleration is disabled if true enabled Output Cache Functions output cache disable e Description Disables output caching for currently running scripts e Return Values none e Parameters none output_cache_disable_compression e Description Does not allow the cache to perform compression on the output of the current page This output will not be compressed even if the global settings would normally allow compression on files of this type e Return Values none e Parameters none output cache fetch string output cache fetch string key string function int lifetime e Description Gets the code s return value from the cache if it is there if not run function and cache the value 119 Zend Platform i5 OS User Guide e Return Values function s return e Parameters key cache key function PHP expression lifetime data lifetime in cache seconds output cache output string ou
57. User Guide Profiling PHP Code With Zend Studio Running the Zend Studio Profiler on PHP code provides time related snapshot of the Code s overall performance Profiling uses the Zend Studio IDE tools to analyze PHP code When profiling the event s information is transferred from Zend Platform to Zend Studio This information includes all the information necessary to precisely recreate of the actual occurrence that generated the event The Zend Studio Profiler is so accurate that this process is paramount to running the profiler when the event originally occurred Profiler information is generated by placing timers within the code and running them over and over The profiling tool is able to build a profile of how fast or slow specific areas of the application will run The Profiler is activated through Event Details from the Zend Studio Diagnostics section by selecting the option Profile URL Zend Studio Diagnostics F Test URL E Debug URL Jj Profile URL EI Show Source Code Figure 36 Event Details Zend Studio Diagnostics Profile URL The Profiling process takes place in the Zend Studio IDE and automatically opens the profiler results Zend Studio has to be installed and running to profile code Understanding Profiler Results Based on the information provided with the profiler developers can identify the cause for the performance problem and implement changes to the code accordingly The Profiler user interface
58. a Bridge 106 E A 107 Java Status Pira a eraen er atea Eee rentzat 107 Configuring the EAEAN 109 Usability ISSUCS a e LEE 110 Chain Functions SANE 110 EXCEPTIONS mm 110 Jav Array Hashtable Objects acacia a 112 A cT 112 Common TASKS tad A a a Aaaa aa Saa ua Gn ENE 113 zia Bada 113 ACUIVITIOS cs once nates KREE E bead noses ends 113 Chapter 6 APIs and BL UEN 119 Z pdrsnuEld MI 119 Accelerator FUNCIONS ose erit ola tette utet a unte aar etaeta 119 Output Cache eea 119 Monitor St edel 121 ZDS Zend Download Server 122 Zend Platform Dire NAE 123 Accelerator Directives i oie RR indias 123 Monitor Directv cimas toria aida 124 Zend Monitor Event AEA 127 GUI KI e dE 127 Collector Center Bada AAA 128 Debugger d dea Au 128 ZDS IDI dad 129 Chapter 7 AU AUEN 131 Integrating Existing and Legacy Alea EAN 131 Calling an EJ B on Websphere from PHP 135 Partial and Preemptive Page Coaching 137 Partial Page Caching APSS arianna ENEA a a SEENEN 137 Action Based Partial Page Coaching 144 Chapter 8 AEA IAE 147 Zend Platform i5 OS User Guide Appendix A Configuration Check Let 148 Appendix B Performance Lifecycle Check List 149 Appendix C Event Aggregation BAIA 150 Appendix D Zend Platform Support 153 Zend Plattor SUPPONE ERE 153 Zend Support SE 153 Appendix E zend ini Configuration Settings sss 154 Accelerator Directives een nent nennen nnns 154 Monitor Klee
59. able that will be viewed in the Event Details screen in Event Context gt Variables gt User Defined This forms the stored Event Context similar to the information obtained in a PHP error event register event handler boolean register event handler event handler func handler register name event type mask e Description Allow you to register a user function as an event handler When a monitor event is triggered all the user event handler are called and the return value from the 121 Zend Platform i5 OS User Guide handler is saved in an array keyed by the name the event handler was registered under The event handlers results array is saved in the event_extra_data table e Return Value TRUE on success and FALSE if an error occurs e Parameters The first argument is a callback function that will be call when the event is triggered object methods may also be invoked statically using this function by passing array objectname methodname to the function parameter The second optional argument is name this function is registered under if none is supplied the function will be registered under it s own name The third optional parameter is a mask of event types that the handler should be called on by default it s set to MONITOR_EVENT_ALL unregister_event_handler boolean unregister_event_handler string handler_name e Description Allow you to un register an event handler e Return Value TRUE on success and F
60. above which severe event is produced K zend monitor max load severe Description Load above which severe event is produced zend monitor max time dev Description Deviation from average script runtime above which event is produced 96 zend monitor max output dev Description Deviation from average output size above which event is produced 96 zend monitor max mem dev Description Deviation from average memory usage above which event is produced 96 zend monitor max time dev severe Description Deviation from average script time above which severe event is produced 96 zend monitor max output dev severe Description Deviation from average output size above which severe event is produced 96 zend monitor max mem dev severe Description Deviation from average memory usage above which severe event is produced 96 zend monitor mem threshold Description If memory usage below this value no deviation events are produced zend monitor time threshold Description If script runtime below this value no deviation events are produced zend monitor output threshold Description If output size below this value no deviation events are produced zend monitor event overload threshold Description If more then 1000 events happen in this time seconds extra events will be dropped zend monitor disable script runtime after function runtime Description Disable script slow event after function slow event happened ze
61. al Host Selection dialog box All Selected or predefined user selections Severity Filters Event information according to severity The values are All Moderate Severe Status Filters information displayed in the Event List according to the Event s handling status The values are All Opened Closed Ignored Time Filter Filters information displayed in the Event List according to a user defined time frame The values are All Past Hour Past Day Past Week Past Month Find Event by ID Finds and displays an event with a specific ID number By entering an event id and pressing Find The values are Sequential numbers that were assigned to Event Details 3 Click Go to display filtered events in the Event List table 69 Zend Platform i5 OS User Guide Event List f Change tabla Fields E Rafresh F pek 06 Feb 2006 m Filter By v Delete Selected Ignore Selected Chose Selected Proserve Selected Events From All Severity All v Status Al N a tw o Logged in as Admin Event Types All wl Time filter Ail m Sort By Last Occurence v ei Descending order Manage Filters Y Load Filter Select Filter v Find Event by Id Events 1 5 of 61 r next de Event Id Type E PHP Error 61 PHP Error Excess Memory Usage Absolute Inconsistent Output Size Excess Memory Usage Relative O select Al Find Count N
62. aming factory These properties were set in the script that started the Java Bridge Ssystem new Java java lang System SproviderUrl system getProperty java naming provider url SnamingFactory system getProperty java naming factory initial Senvt array Javax naming Context PROVIDER_URL gt SproviderUrl javax naming Context INITIAL CONTEXT FACTORY gt SnamingFactory Get the Initial Context Sctx new Java javax naming InitialContext Senvt find the EJB SORO ctx gt lookup WSsamples BasicCalculator Get the Home for the EJB Srmi new Java javax rmi PortableRemoteObject Shome rmi gt narrow Sobj new Java com ibm websphere samples technologysamples ejb stateless basiccalcula torejb BasicCalculatorHome qo ii Create the Object calc Shome gt create Call the EJB Snum S calc gt makeSum 1 3 prime Gas d 4d 3 paun lt a gt This tutorial detailed how developers can use EJ B on WebSphere from PHP using the J ava Bridge The two steps are to create a script file to start the JavaMW server and to write a PHP client which uses the J ava Bridge functionality to call the EJB running on WebSphere 136 Tutorials Partial and Preemptive Page Caching This tutorial will review one of Zend Platform s most powerful features Partial Page Caching Partial Page Caching is used in cases where
63. are viewed in several ways The regular way of viewing events is from Zend Platform Events can be configured to be sent by e mail recipients or to a URL in XML format However Event Details always include the same information regardless of the viewed output Regular Event Details XML or e mail poo emdon 1 Event Details I Report for PHP Error 264 A Severe Event Requested URL http kuzya my_test pho SEH usr local apache ss 29 htdocs my_test php zw In file usr local apache ssi 29 htdocs my test php on line 3 PHP Error of type E ERROR error Call to undefined function sdds Event Occurrences Info Occurred twice the first on 18 Jan 2006 01 16 36 and the last on 18 Jan 2006 01 16 39 First occurrence was on virtual host kuzya on server kuzya Zend Studio Diagnostics F testuri E Debug URL J Profile URL E Show Source Code Event Context Data b Function Data e Vanables E Backtrace Fu Show Sowrce Code Li Preserve event this event will not be deleted during database cleanups Delate Event Ignore Event Chose Event Figure 29 A PHP Event Details Screen Event Details include five sections 1 General Information 2 Event Occurrence Info 3 Zend Studio Diagnostics 4 Event Context i Function Data 72 PHP Intelligence ii Variables iii Backtrace iv Included Files V Show Source Code 5 Event Administration
64. arent auto loading mechanism that is built into the Zend Optimizer To change zend_optimizer enable_loader settings Go to Zend Central Console Configure PHP Settings and choose from the list of directives Zend Optimizer 100 Performance Test Download The Zend Download Server ZDS is a transparent process that runs in the background to service large downloads The performance gain obtained by using the ZDS is measured with the Test Download option The Test Download option checks the efficiency of the Download Server Test Download simulates multiple requests for a specified URL with and without the ZDS thereby creating its own benchmark for comparison This feature is currently not applicable for Windows Operating Systems To Run a Download Test Go to Performance Testing and choose the Test Download tab 1 Enter the URL for Testing The default is a proprietary Zend PHP script which uses zend_send_file to send a file Testing very large files will take a very long time 2 Enter the bandwidth limit you want to simulate for the clients For a faster test select a higher bandwidth Do not select full bandwidth doing so will saturate your network card that will make the test irrelevant The test tries to simulate a typical Internet server that has clients connected either by ISDN or DSL 3 Enter the Max Clients value defined for your server Insert the accurate value by checking the MaxClients direct
65. as follows 1 The code example is written in PHP and forms part of a PHP Web application 2 The PHP code creates the Java object java lang System which is the PHP proxy 3 The purpose of the PHP code is to print the date and system information however it does so through the Java object Example 2 A Case Study J ava Bridge Performance The Forever Times newspaper maintains a PHP based website let s call it ForeverOnline com The newspaper has been searching for a real time Stock Ticker application to add to their already successful and heavily visited website The Forever Times Newspaper feels that real time financial information is the one thing their web site is lacking Forever Times believes they have found exactly the Stock Ticker application they need The application provides up to date quotations from all the major markets currency rates and even links to some of the local exchanges However the application is written in Java and uses existing J ava libraries Forever Times realizes that a PHP based Web implementation that handles Java requests a Java Bridge is their best bet At the same time they are concerned that the performance of their Website remains optimal To Forever Times horror in testing the new application they found that loading the site with user requests for the stock ticker slows down the performance of the whole Website The following code example illustrates how Platform s Java Bridge app
66. at suits acceptable variance in percents from output to output of scripts Relative Events Event definitions are based on relative values i e percentage Relative values are set according to warm up settings default value of 500 requests If necessary the default value can be modified manually by changing the zend_monitor warmup_ requests directive in the zend ini 26 Configuring Zend Platform Load Average Load Average events are used to monitor the overall health of processes running on the server This event is used in production to highlight critical situations that might require analysis during high traffic situations Description Generates an event when the number or active processes waiting for CPU time is higher than the number defined in the rule Default definitions are set to 0 for moderate and 0 for severe events To start generating events these values need to be given a logical value based on the server s capabilities 27 Zend Platform i5 OS User Guide Custom Events Custom events are a unique type of event that is provided for Zend Platform users in order to initiate events from their scripts This type of event is different than other event types in that it allows controlling event generation as opposed to the other events that are triggered by a certain occurrence Custom events are used to generate an event whenever the API function monitor_custom_event is called from the PHP scrip
67. ate events by their Event ID e Zend Central Console Configuration and Management Tools Event Actions for sending events of a certain type to e mail or URL according to predefined rules This provides a proactive means for sharing information either with parties that need to be informed when certain events occur e mail or for integrating event information to other applications URL For example a manager may only want to know about Severe PHP errors that indicate some or all of the Web application is not working Setting an Event Action to send event information by e mail means that this manager is immediately informed of the event as long as the e mail account is accessible Read more about how your organization can leverage information generated by events in the Tutorial Integrating Existing and Legacy Applications 65 Zend Platform i5 OS User Guide System Health The most comprehensive way to view and manage events is through the System Health screen The System Health sub screen provides an up to date snapshot of events monitored by Zend Platform Events are displayed in a filterable table which is updated by manually refreshing the browser pressing fa Refresh or by setting automatic refresh Zend Central Preferences The System Health table includes events categorized by location server group and event type end Plattorm AH Intelligence iss Studio Server Session C System Health Event List
68. ated into a PHP native array hashtable type This means that if you want to work with a Java array hash from PHP you cannot preserve it as a Java object Of course the contents are preserved but the object identity is lost In such a case when an array hash is returned you will lose the ability to use Java methods since the array hash loses the object identity and becomes a regular PHP array There are several ways to handle Java arrays and hashtable descendants The following example shows a possible scenario of how Java arrays and hashtable descendants can be converted into PHP arrays by splitting the class pattern method and returning an array of strings which is then converted into a PHP array as follows Se Sexp new Java java util regex Pattern Sp Sexp gt compile Create new patten object Sacre So gt spliwe Mag ebizen gizena Use petis eo sold skiing Jee array princin Rare SE To deal with Array Hashtable objects originating in J ava Implement the code dealing with the array in Java and then call it from PHP or encapsulate the object in a different class Iterators Iterators are not handled by the Java Bridge in any special way and they are treated like any other Java object 112 Java Bridge Common Tasks This section describes some of the common uses for the Zend Platform Java Bridge The usage scenarios and examples discussed here provide a framework for the Java Bridge s uses ra
69. b directories under it 3 Click on the relevant icon in the toolbar Fine Tune Caching Conditions Caching conditions can be changed per file or group of files To modify Caching Conditions 1 Check the box next to the directory or cached file s 2 Click Define Cache to open the Define Caching Conditions Dialog Alternately click on a Cached file i e a file with the Cached indicator ll next to it 3 Apply Caching settings and press Save to save and close the dialog ndow 3 wei Define Caching Conditions Cache Lifetime 360 Seconds Dynamic Caching Conditions name Exist w Condition SESSION COOKIE REQUEST x Set to default condtitions Lee Caching conditions will be set for test php Figure 16 Define Caching Conditions Modified settings will be displayed in the File View Tab next to the selected file s The Web server should be restarted in order to activate the new caching conditions The restart server message will remain on the screen until the server is restarted The Define Caching Conditions dialog includes three buttons e Restore Defaults Returns to the default caching settings e Save The new settings are saved and are reflected on the screen but the changes will take effect only after restarting the server e Cancel Cancels the new changes and returns to the previous settings Caching conditions may also apply to Variables stored in an Array 39 Z
70. bases nn naco narrar narra 25 Deactivate compression ssssssse 45 Debug URL ondaa iaa 72 Debugger rei d 72 Default Cache Lifetime assa 41 default confiourations eee eee 16 Define Action Types assez 29 Define Alert Rules 16 Define Cache 35 Define Caching Gettings assa raaa 35 159 Zend Platform i5 OS User Guide Delete OUA 72 Delete Gelected eee eeee eee eeen eas 68 let Le 72 Disable an Action Rule 29 Do not Cache 35 document root 35 Download 101 IUa laa 101 Download gal 101 Download Test 101 ET le 41 Dynamic Caching Enabled 41 Dynamic Content Caching 41 45 E m E 54 Editing a User 55 Editing Groups iier e 57 Editing Users esses 55 url 29 72 Email Report 29 End US arga oc esed eee mete ee Eee da 66 Emviropnment sss nnns 107 Error Description 72 error reporting crlterla srssssrsrsssrssaa 22 ENON RETE 22 Event 21 22 23 24 26 27 Event Dala ici depara 72 Event SE rta ooo 68 Event NM Bicis ic ds a 66 Event Occurrence Info 72 Event Report ccoo e 29 72 Event Reports eee 29 72 Event Summary 66 Event Summary table 66 Event AA eese ore eren te 16 68 Event TYPOS creek ettet t acier 16 events eios ort es 25 27 66 68 82 Events FrOm erret nenne 16 68 Excess Memory esee t rese aries 24 Excess Memory Usage esses 24 F File Compresslon e
71. ch functions zend monitor watch results zend monitor collector host zend monitor collector port zend monitor log dir zend monitor server key zend monitor server cert zend monitor collector cert zend monitor enable zend monitor error level zend monitor error level severe zend monitor silence level zend monitor max script runtime load cutoff Reload YES YES YES YES YES NO NO NO NO NO NO NO NO YES YES YES YES YES Appendixes 155 Zend Platform i5 OS User Guide zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor zend monitor report variables data max script runtime max function runtime max memory usage max load max script runtime severe max function runtime severe max memory usage severe max load severe max time dev max output dev max mem dev max time dev severe max output dev severe max mem dev severe mem threshold zend monitor time threshold zend monitor output threshold zend monitor event overload threshold zend monitor disable script runtime after function runtime zend monitor tmp dir zend monitor longscript enable zend monitor longscript enable zen
72. che at the end of its lifetime 137 Zend Platform i5 OS User Guide Invalidate Cache Function Action output_cache_remove_key string key Respectively remove items from the cache according to their type Key URL or File The partial caching functions are divided into two groups output caching and data caching This document will explain each of the two groups and give practical examples of each function call Output Caching The first groups of functions are the output caching functions These functions capture the output from a function or block of PHP code and cache it These functions are output_cache_output output cache exists output cache stop Output caching functions allow programmers to remove the execution of blocks of code with static output such as looping over and printing the day s news headlines This output changes infrequently so instead of reprocessing it for every user caching allows PHP to skip execution and print the results Prototype void output cache output string key string code int lifetime The first time output cache output is called it will execute the function defined in argument two and store any output in the cache under the retrieval key specified in argument one Each subsequent call to output cache output with the same value as argument one will result in the output of this cached data instead of the execution of the function in argument two until the cache lifetime in argu
73. ched data with the key specified The other two functions output_cache_exists and output_cache_stop are used in tandem to simplify the task of caching output from a given section of code Prototype boolean output_cache_exists string key int lifetime void output_cache_stop output_cache_exists is called from a conditional statement The conditional statement should wrap the section of code producing the output you are intending to cache output_cache_exists takes two arguments 1 The key value with which this output will be cached 2 The cache lifetime in seconds output_cache_exists returns a boolean TRUE is the key exists FALSE if it doesn t output_cache_stop takes no arguments output_cache_stop has no return value Usage Example SB if output_cache_exists Some_Key2 3 echo time output cache _sicoja p Sem Eeler o qo 139 Zend Platform i5 OS User Guide Data Caching In cases where caching the output from a script isn t possible we offer a set of functions for caching data These functions are output_cache_fetch output_cache_put and output_cache_get Data caching allows programmers to skip execution of repetitive database calls increasing script performance and reducing overhead on the database Typical uses of data caching include caching user preferences caching product pricing or any SQL call which changes infrequently Prototype string output_cache_fetch s
74. click the delete icon next to the condition you wish to cancel e To change the Cache Lifetime s duration type the new number in seconds When all configurations are completed press Save to save and close the dialog Modified settings will be immediately displayed in the Settings tab Click Apply Changes and restart the Web server to activate the new caching conditions The message will remain on the screen until the server is actually restarted Caching conditions may also apply to Variables stored in an Array 43 Zend Platform i5 OS User Guide Default Dynamic Caching Condition Parameters The following lists and describes each of the applicable parameters e GET Indicates that you have selected certain GET variables For example consider the URL http www mysite com myscript php color blue amp size L When set to ALL GET a new request for myscript php color blue amp size M will not be taken from the cache and will be regenerated If however the setting is changed to GET with the value color then the two URL requests would both be taken from the same cache content regardless of the order of the variables in the request string The GET variables can be found in the GET PHP array as well e COOKIE The Cookie variable is the variable given in the HTTP cookie It can be found in PHP COOKIE array as well By selecting a cookie variable it will also be considered a determining factor for cache hits
75. collector_port Description Port to listen zend_monitor server_key_dir Description Dir to store node keys zend_monitor events_db Description Event DB URI zend_monitor pull_freq Description How often to pull node data seconds zend_monitor ping_freq Description How often to check node availability seconds zend monitor log dir Description Dir to store logs zend monitor gui dir Description Dir where GUI files reside zend monitor event lifetime Description How long until event is considered too old seconds zend monitor cleanup freq How often to clean up old events event count Debugger Directives zend debugger allow hosts Description Hosts allowed to connect hostmask list zend debugger deny hosts Description Hosts denied to connect hostmask list zend debugger allow tunnel Description Hosts allowed to use tunnel process hostmask list zend debugger expose remotely 128 APIs and Directives Description Which client can know debugger is installed zend debugger max msg size Description Maximum message size accepted by Debugger zend debugger httpd uid Description UID for the httpd process ZDS Directives zds enable Enable Description ZDS file serving zds mime types file Description Location of the MIME types file zds log_ file Description Log file zds min file size Description Minimal file size to serve via ZDS process smaller files served via Apache zds di
76. contains 3 tabs e Profiler Information provides general information on the profiling duration and date number of files constructing the requested URL and more In addition it displays a Time Division Pie Chart for the files in the URL e Function Statistics provides you with the list of files constructing the URL and detailed information on functions in the files e Call Trace provides a hierarchical display of functions according to process order enabling you to jump to the function view the function call function declaration details and more Additional information about the Studio Profiler can be found in the Zend Studio Online Help To perform in depth examinations of slow code or functions the Zend Studio Debugger can be used to debug information in the occurrence s relevant context The Debugger is also activated through Event Details from the Zend Studio Diagnostics section by selecting the option Debug URL 94 Performance Zend Studio Diagnostics F test urt E Debug URL i Profile URL Show Source Code Figure 37 Event Details Zend Studio Diagnostics Profile URL This completes the description of the investigation and diagnostics tools that can be used to identify performance bottlenecks in the code The next step is to see what performance tools can be applied to optimize the Web application s performance Performance Optimization Tools Performance optimization tools are used once it is a
77. covers crashes whether they occur in PHP itself the database software or your own application The integrated suite of monitoring detection and recovery features allows users to drill down to critical issues and optimizations quickly and easily PHP J ava Integration The Platform PHP J ava Bridge module provides PHP centric companies with a well rounded environment making sure that the organization benefits from the best of both worlds Be it existing investments in J 2EE application servers that require this solution or to provide a means for organizations if they choose to bridge language limitations by use of Java applications The Java Bridge is not limited to interactions strictly with J2EE and legacy systems the Platform PHP Java Bridge also provides the ability to interact with plain Java objects Zend Platform i5 OS User Guide Environments A typical environment for running any Web application consists of three basic components Web servers for running the Web application a load balancer to handle traffic and a firewall to protect form unauthorized entry into the hosting network Zend Platform once introduced to this kind of an environment becomes a control environment for web server activity In an environment where a single web server manages activity Zend Platform resides on the web server to provide system health and analysis information Moreover environments that include several web servers be they a cl
78. covers the event aggregation mechanism in the Central Server It will try to answer the fundamental question When are two events are considered to be of the same origin or cause and therefore reported as one Event properties To answer this question we first have to define the different properties or attributes that define an event Here is a list of the attributes that are used for aggregation along with a short definition e Event type the type of the error that triggered the event PHP error Function error etc Perhaps the most important property since it also determines which other properties will be compared e Source file Line number the name of the PHP file and the line that contains the code that triggered the event This file may not be the file that the user requested Not all events have code location e g slow script events and other events related to the whole script do not e Function name the name of the function that contains the code that triggered the event If the event happened in the global scope it s reported in the main function e Location one of two either the server id of the server that triggered the event or the group id if the server belonging to an aggregated group e Aggregation Hint this is a string that is supplied by the user to differentiate between pages that have the same URL but different parameters If the user did not supply a hint the default hint is an empty string The li
79. crotime get current timestamp including microseconds ise Susee Hess explode E ES mco PS Brine thes weal current tine 24 preine SC limes Site Sess Susecs a y Scached_string output cache fetch Example Fetch get_content time sec SUSCC Uy 310 f Call tae power Jet via the ouiome_ cache Torea s If the content key exists and the lifetime hasn t expired the function execution will be skipped and the cached data will be returned via the cache API geli data unserialize cached_string unserialize the data Prine the cached time PESO HS V a giarra et guer ease Ua agertzeaz Use Ae e print lt p gt lt b gt Refresh to see caching in action lt b gt lt p gt The strength of output_cache_fetch is that it allows the developer to offload repetitious database calls by wrapping these calls in a function The following example illustrates how this would work lt php Note that this code is kept as simple as possible with no return type checks etc in order to focus on the caching features Display greetings and read user info from database this part must remain dynamic Suser 1id SESSION user ditio result mysql_query SELECT name country airport FROM users WHERE id user_id list name country id mysql fetch array result MYSQL ASSOC echo W lt Psijeuloome rana De
80. cs my test php 3 Ex Figure 33 Event Details Event Context Function Data Function Data is only added to function related Event Details This addition shows the function s name and parameters at the time the event occurred The function always appears as a link This link directs to the function s description in the online PHP manual at http www zend com manual The link to the PHP manual also appears for user defined functions These functions naturally will not be found in the PHP manual however it is a good indication as to which functions are PHP functions and which are user defined Variables The information included in the Variables section includes all variables data saved when the event occurred such as GET POST COOKIE SERVER etc The GET POST COOKIE and SERVER sections will always be displayed even if they are empty This indicates that there was no available data at the time the event occurred Users may choose to change the type of information collected and displayed in an event Change Event Details Backtrace Backtrace only appears in function related events The listed functions are the functions that lead to the actual function occurrence that triggered the error Functions are listed in chronological order from the most recent to the first function that was called There are two options for viewing Backtraced functions in a pop up screen or in Zend Studio e EL Shows the function cal
81. d collects is event information that is determined by Event Rules that are configured on the Central Server Event information is sent to the Central server where it is aggregated according to event type more about event aggregation can be found in Appendix D Event Aggregation Mechanism Different Rules can be applied to different nodes in a cluster environment or specific settings can be applied to more than one node in a cluster by using the Clone Server feature The Debugger Infrastructure is enabled via the Zend Studio Zend Core Communication Tunnel that is geared to work in development and production environments With the appropriate configuration the Debugger Infrastructure can work through Firewalls or NAT devices that may be positioned between the Node and Zend Studio The Debugger Infrastructure provides full lifecycle support for editing debugging profiling and deploying code by enabling to view and edit Event source code in the Zend Studio development environment This provides Zend Studio users with access the remote debugger via the same communication tunnel that routs full duplex traffic over HTTP The Debugger Infrastructure utilizes the Communication Tunnel ensuring that multiple servers can be debugged through the same Communication Tunnel at once Zend Platform Node www server Apache PHP Apache Process Apache Process Apache Process Collector Component Apache Process Node Process Debugger Debug
82. d monitor longfunction enable zend monitor zenderror enable 156 YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES zend_monitor devscript enable zend monitor funcerror enable zend monitor devmem enable zend monitor outsize enable zend monitor memsize enable zend monitor load enable zend monitor custom enable Debugger Directives Directive zend debugger allow hosts zend debugger deny hosts zend debugger allow tunnel zend debugger expose remotely zend debugger network trace zend debugger max msg size zend debugger httpd uid Reload YES YES YES YES NO YES NO YES YES YES YES YES YES YES Appendixes 157 Zend Platform i5 OS User Guide ZDS Directives Directive Reload zds enable YES zds mime types file NO zds log file NO zds min file size YES zds disable byterange YES zds mmap chunk NO zds nice NO zds allow assert NO zds child max NO zds poll delay NO zds uid NO Not reloaded now maybe in future versions 158 Chapter 9 Index A Absolute civic is ENNEN ea accelerated A lee dazala Acceleration Blacklist Acceleration Blacklist Files O san Ra Rada e ct a Action Rule parameters Action Aal Actions Rule add ser
83. dE 155 Debugger BEES Ae da daa 157 ZDS DROGEN TEE 158 Chapter 9 EM NANO 159 vi Preface Zend Platform is an extremely diverse runtime environment management platform As such a greater understanding of the underlining concepts is required to fully benefit from the Zend Platform capabilities and features This User Guide has been designed to reflect these concepts by providing a workflow driven description of Zend Platform s features The first chapter is an introduction describing the background and architectural design of Zend Platform along with who should read this guide and how to maximize the benefits of deploying Zend Platform in your environment The chapters that follow are each dedicated to a different facet of working with Zend Platform starting with initial configuration actions The next chapters highlight the different Zend Platform features and how then can be employed in a working environment The functionality of each screen is further elaborated in the online Help that is included with Zend Platform to provide detailed instructions on how to work with Zend Platform Workflow related processes also addressed in the last chapter dedicated to tutorials that include detailed descriptions and instruction on how to perform each process vii Audience Zend Platform is responsible for providing solutions to the challenges faced by different stakeholders in the organization therefore it is recommended that Managers Syst
84. date the Virtual Host list 1 Go to Performance File View and select Update Virtual Hosts List from the options at the top of the screen This will open the Update Virtual Hosts List screen 2 Specify the virtual host s details and provide an alias for the Virtual Host under Vhost Name 3 Press Add to save the new Virtual Host and add it to the Virtual Hosts list 37 Zend Platform i5 OS User Guide File View The File View displays files in a table which can be sorted by column The sorting options are Status File Name Lifetime and Conditions File View Dynamic Content Caching Once all the Virtual Hosts have been established and the default Caching Conditions have been set Specific Content Caching settings can be applied to selected files or directories Content Caching activities include the following in chronological order 1 Define default caching settings 2 Modify file settings 3 Fine tune caching conditions 4 Define files to blacklist Define Caching Settings The File View screen lists all the directories and files in the default Document Root as well as any Document Roots listed in the Vhost List Any cached file that has not been explicitly defined automatically inherits the default cache settings To open the File View screen go to Performance File View inne a File View CR roles D I mee 1 Jan 2006 20 46 55 Logged in as Admin Server name kuzya Po AEREO OTE ii ii
85. defined limits e Slow Query Execution generates an event whenever database related functions exceed the threshold defined in the event e Slow Function Execution Generates an event when a specified PHP function s execution time exceeds the threshold defined in the event e Excess Memory Usage Absolute and Relative Generates an event when memory use for PHP script execution is above or below average These event types are performance related indicators Each one of these events should be configured to generate an Event according to your environments performance requirements Events generated following calibration indicate that certain areas of the application are not performing according to your requirements and need further investigation Investigating Performance Related Events Performance related events are investigated when events continue to occur after initial calibration The contents of Event Details provide in depth diagnostic information and tools for investigating the occurrence A generated event does not necessarily indicate a problem with the PHP Code it can also indicate that the Event Trigger settings need to be adjusted or the PHP code should be reevaluated The most effective performance diagnostic tool is the Zend Studio Profiler The Zend Studio Profiler is a Zend Studio component that can be employed on Event Detail information through Zend Platform s integration with Zend Studio 93 Zend Platform i5 OS
86. e 2 The File View on the right lists files and their status and also includes the different caching acceleration and compression options that can be applied to selected files or to entire directories biao IFI File View CH An 20 46 55 Logged in as Admin Server name kuzya N i A Vhosts List i ib EA qi 5 E Li Show directories containing i j Cache Dont Define Blacklist Clean ir H Cache Cache Files All Files iv j B Cached Acceleration Blacklist usr local apache ssl 29 htdocs 1 a Jap Baccelerated Compression Blacklist EO Document Roots i i File Name Lifetime Conditions 18 C3 http kuzyo 80 i i S d e S 7 branch ii ii JH testjava php E LA manual E 5 03 ZendPlatform ii 39 test php 360 GET C ZendPlattormout 2 12 Pi 8 sc test ohp LI http dollytest 30 pi 18 2 hetpst pecksys_debian22 443 11 OH rcv phe i JN phpinfo php Figure 13 File View Tree View and File View Sections Status changes made in the File View screen are immediately reflected on the screen However the actual changes take affect only after manually restarting the HTTP Server A reminder to restart Apache will appear on screen after changes are made and disappears only after restarting the server Clone Settings To configure multiple servers or a server group with the same file settings 1 configure a selected server and 2 then use the Quick Clone button to propagate settings from that server to othe
87. e Event Triggers and select Configure Event Triggers In the Define Event Triggers Table the Check box in the Active Column indicates if an Event Type is monitored or not To prevent a selected Event from being monitored disable the Rule by unmarking the Check Box This will deactivate and stop collecting event related information 63 Zend Platform i5 OS User Guide List Entry of Watched Functions Zend Platform allows you to monitor a list of functions by referencing a text file that includes the functions you wish to monitor Users who must monitor large numbers of functions will find this method of defining watched functions a convenient alternative to editing the php ini file line by line Use the following PHP functions to reference a text file containing the list of functions to monitor The following function is typically used to create a list of functions to watch It forms part of the php ini file zend_monitor watch_functions mysql_ connect mysql_ query The following function refers zend_monitor watch_functions to a text file at a specific location This file contains the list of functions to monitor Umi zend_monitor watch_functions usr local Zend lib watch_funcs txt zend_monitor watch_results usr local Zend lib watch_res txt Windows zend_monitor watch_functions C Progra Files Zend ZendPlatform 2 2 0Beta lib watch_funcs txt zend_monitor watch_results C Program Files Zend ZendPlatform
88. e an optimal performance boost to business critical Web applications Deploying Zend Platform in organizations will improve the overall performance of Web applications by e Enhancing code and download performance e Employing full and partial page caching capabilities e Preserving memory consumption through file compression The use of Zend Platform Performance tools in development and production environments provides a means for testing and maintaining Web application performance The following illustration displays the three stages of the Performance Lifecycle Zend Platform Performance Lifecycle Zend Baseline gt gt Site Baseline gt gt d Optimize PHP Establish Web Optimized Web Code Application Application Gather Monitoring performance Calibrated Zend Information information Platform Calibrate Zend Actions Platform to the Actions None runs on Web application Production default settings Monitoring Actions regular Run Site Analysis adjustments to Calibrate Alert Optimized Rules baseline Analyze Events Optimize PHP Code Figure 35 Performance Lifecycle The Zend Platform Performance Lifecycle is an iterative cycle for analyzing Web application performance The purpose of this cycle is to identify areas that require Zend Platform calibration and areas that require PHP code optimization The Performance Lifecycle Baselines stages are as follows Zend Baseline The first Baseline is the Zend
89. e are events that require the location in the script for diagnosing the reason behind the event occurring For example Global Events require the application that generated the event Adding the Hint API can assist in the identification process 82 PHP Intelligence Event Aggregation Rules Event aggregation rules determine which events are aggregated into a single Event Detail There are four types of checks depending on the event type 1 Database Error 2 Zend Error PHP Error 3 Function Error 4 Query Error The Collector checks to see if these events occurred in the same source file based on the Line Function and Hint This is why it is important to used Hints if this level of separation is necessary To read more about the event aggregation mechanism go to Appendix D Event Aggregation Mechanism 83 Zend Platform i5 OS User Guide Database Maintenance Once the cause of the event has been fixed we can decide what to do with the event Preserve Ignore or Delete If no actions are done to an event it will be automatically deleted from the database Apart from closing events other additional advantages can be obtained by customizing user permissions Granting different users separate authorizations by configuring different user permissions can facilitate different organizational requirements such as enforcing responsibilities and work structures For example by providing Read Only authorizati
90. e exists false otherwise e Parameters key cache key lifetime cache validity time seconds output_cache_ exists bool output_cache_exists string key int lifetime e Description If data for assigned key exists this function outputs it and returns a value of true If not it starts capturing the output To be used in pair with output_cache_stop 120 APIs and Directives e Return Values true if cached data exists e Parameters key cache key lifetime cache data validity time seconds output_cache_ stop e Description If output was captured by output cache exists this function stops the output capture and stores the data under the key that was given to output_cache_exists Monitor Functions monitor_pass_error void monitor_pass_error integer errno string errstr string errfile integer errline e Description Should be called from a custom error handler to pass the error to the monitor The user function needs to accept two parameters the error code and a string describing the error Then there are two optional parameters that may be supplied the filename in which the error occurred and the line number in which the error occurred monitor set aggregation hint void monitor set aggregation hint string hint e Description Limited in the database to 255 chars this API is a global variable that can be set anywhere and in any hierarchy The purpose of this API is to incorporate locations of occurrences in the scrip
91. e gt lt call depth function file line gt lt backtrace gt lt event gt By viewing the XML tagged file as fielded text the fielding makes it possible to break Event Details screens down to their component parts to any degree of granularity for storage in a database Once in the database the data can be utilized by another application The following example shows how Event Details data can be extracted from an XML file and inserted into a database for use in a different system could be any system based on a database such as Bug Tracking CRM management or any other application SELLE Seven sm cera isseic S IOS even cera 1 28 20S Levene else saul p if event xml data no Event Context arrvied die xml simplexml_load_string event_xml_data Implement different behaviors according to Class Sevent_type string xml type 1f this event is a Custom Event we may implement different behaviors according to the Custom Event s class if Sevent_type custom Scustom_class string xml class switch Scustom_class different behaviors according to the class get the new event id Seven ale ime Szal TU erretz acl insert a new event with its genreal info type and timestamp to the db insert_new_event_into_db event_id Sevent_type int xml timestamp parse the function parameters of the function where the event occured f
92. e list of Permissions Groups that are currently defined in the system Click Next to go to the second step In the Edit User wizard 2 screen select the servers that you wish to allow the User to access Click Finish The changes will be applied to the User settings and saved in the database Configuring Zend Platform Adding and Editing Groups Add Edit a Group Zend Platform allows Administrator level users to create new groups and define user access permissions To create a New Group 1 Click the Add a New Group button in the lower left corner of the User Management workspace to open the Add a New Group dialog 2 In the Add New Group dialog select the preferences and permissions to assign to the New Group from the table 3 Enter a name for the New Group Remember to click Save to save changes or create a Group in the database and register its settings The following is a list of group preferences and their definitions e Group Name Enter a name for the New Group e Delete an event Enables the Delete Event option for deleting events in the Event Details screen and the Event Window e gnore an event Enables the Ignore Event option for ignoring events in the Event Details screen and the Event List Window e Close an event Enables the Close Event option for closing events in the Event Details screen and the Event List Window e Reopen an event Enables the Reopen Event option for reopening events
93. e their own J 2EE application server FlowerPwr com needs to begin operating as an integrated commercial entity as soon as possible in a way that conceals the fact that the companies have merged Platform s Java Bridge offers a solution Using Zend Platform FlowerPwr com can create a common portal in PHP The company can leave Java up and running and take full advantage of their acquisition s existing Java services FlowerPwr com can do this over an existing portal using PHP The following code example illustrates how Platform s Java Bridge can apply to this business scenario and others like it Se EJB configuration for JBoss Other servers may need other settings Note that CLASSPATH should contain these classes Senvt array Java naming factory initial gt org jnp interfaces NamingContextFactory java naming factory url pkgs gt org jboss naming org jnp interfaces java naming provider url jnp yourflowers com 1099 ctx new Java javax naming InitialContext Senvt Try to find the object obj ctx gt lookup YourflowersBean here we find an object no error handling in this example Srmi new Java javax rmi PortableRemoteObject Shome Srmi gt narrow obj new Java com yourflowers StoreHome hw is our bean object Sstor Shome gt create add an order to the bean Ssttonea Solace_omelsic S_Ginw elisa suel S Ger item icii print
94. e your server s MaxClients Keep this value updated to the actual number of max clients of your server e Log File The name and location of the log file where the ZDS reports completed downloads Default lt install_dir gt logs Make sure the directory exists and that the user who starts the Web server usually root has write permission The MaxClients setting depends on your server hardware To achieve accurate test results the server should be set between 50 150 MaxClients The MaxClients value must be the same in the Download Server Settings and the Web server s configuration file These settings are applied to downloads handled in one of the two handling modes Manual and Transparent Testing the ZDS Once the ZDS has been configured a test can be run to check and analyze the overall efficiency e The default ZDS test uses the Manual mode of operation to invoke a PHP script which sends a file of approximately 300KB e The same test tool can be used to check the Transparent mode Make sure that you correctly map the file type you are checking in your Web server s configuration file according to the configuration instructions The test simulates multiple requests for a specified URL with and without ZDS There are three sets of tests each test is performed twice once with the ZDS disabled and once with the ZDS enabled These tests differ in the number of concurrent clients that simultaneously perform requests to the serv
95. ee eaene ees 45 WUER og laa EE 35 Fil Vie Wicca 35 NU Le EA 66 68 Filtering Alert OR 16 Filtering Table Data 66 Fine Tune Caching Conditions 35 Full Page Content Caching 41 funca RICO 26 Sita IR L eri rent cera tenias 72 160 function dauala 22 25 Function Execution sss 23 Function Usage 28 le ee 22 G General database function errors 25 E 41 Global Events 82 global variable ccceeceeeeeee teeter tees 82 GROUP TEE 54 66 Group Name E 54 GOUDSE exuere pi esie inccr un Fac e Ee 12 GUI Directory aeree tt ria 12 Ebene See 45 H Handle Groups assa 54 Hard errors mitin nuria 22 health iet e red 27 ale D EE 66 HTTP SerVer i e a tad 35 l lgnore Event ace rh eie 72 Ignore Gelected 68 Incl ded Files renes 72 Inconsistent Output Size 26 Integration 72 Jauzia La 72 J Java Cut e EE 107 Java Emvironment sss 107 WAVES HOME iii rer dean tnmen 107 JAVA Status ius csi rne rein ortae P E teense 107 IESUS 107 Java Version 107 L Last Download eset eee eaeee 101 Haizia dia 27 Logged IN AS aise Adee a 54 ej KEE 54 M Manage Servers Groups 0ooocccnconcnnncnnonnnnns 12 A dees 54 Max Clients siete e aki eb 101 Maximum Cache Gize 41 Maximum Cached File Size 41 AZALA 24 Minimum Free Disk space 41 MOE ON Si cas iaa dia 16 27 monitor set aggregation hint 82
96. em Administrators and Developers read this manual Managers will learn how to utilize this solution to support PHP lifecycle management by streamlining the PHP application lifecycle across development and production This kind of development method is responsible for shortening release cycles by integrating the working environment Managers can benefit from knowing how to utilize Zend Platform with their testing staff to obtain a means for detecting and pinpointing run time problems throughout the production lifecycle while having the safety of knowing that when run time problems are located testing staff will have a complete audit trail to help resolve the issue From the usability aspect delivering a product on time is only part of the equation Find out how to improve user experience and increase performance up time and customer satisfaction through using Zend Platform From the PHP aspect know why Zend Platform considerably improves PHP execution while Maintaining and synchronizing PHP configurations From an organizational standpoint find out how to leverage existing investments in Java applications as well as reducing costs on hardware System Administrators will be able to understand how to detect problems with PHP Intelligence to pinpoint run time problems with detailed information Learn how to control configuration by synchronizing configuration of ini files accurately across PHP servers and improve performance by getting more ou
97. end Platform i5 OS User Guide Go to Default Dynamic Caching Condition Parameters for a complete list of applicable conditions The zend_cache ini file contains the list of all the files and directories assigned for Dynamic Content Caching including all the Conditions as follows Use the File View to define the files and directories to be cached Do not edit this file manually zend cache lifetime 360 zend cache depends ALLGET zend_cache path usr local apache htdocs hello php zend cache lifetime 360 zend cache depends COOKIE my cookie A large cache ini file can possibly result in slow performance Therefore it is recommended to un cache in the File View any file deleted from the server Define files to Blacklist The Blacklist separates acceleration and compression settings for files With the blacklist users can prevent files from being accelerated or compressed Configuring Zend Platform Dynamic Content Caching The concept behind Dynamic Content Caching is to store results of a first execution of a dynamically generated Web page In this way further requests made to the same page will go to the Cache Consequently avoiding the overhead incurred by executing an application that renders output that does not change Zend Platform offers two ways to Content Cache files e Full Page Content Caching For cases where it is possible to cache an entire output e Partial Page Content Caching for case
98. endor OS Name OS Version Class Path and Java Home e Bridge Statistics Bridge Statistics information includes the Number of connections and Requests Locating an Existing J ava Version Zend Platform assumes that your existing J ava is installed in the standard location QOpenSys usr bin java If this is not the case to use the Java Bridge you must relocate your J ava to QOpenSys usr bin java Working with the J ava Bridge User Interface To view the J ava Status Page for a selected server View Tree By Servers in Alphabetic Order iv Ba All O test O 2 dolly3 O m DollyFive O E fosd O m fireforge O BS Gollum Figure 41 Select Server to Configure 1 Go to the Java Bridge Tab and the Select Server to Configure dialog opens 2 Select a server from the list of servers in the Server Tree and click OK The Java Status Page opens for the selected server 107 Zend Platform i5 OS User Guide la 5 Java Status Page al Refresh Z neie 06 Feb 2006 13 53 10 Logged in as Admin Server name Gollum Java Bridge server control B Stop M Restart Java Environment Field Value Java Version 1 5 0_05 Java Vendor Sun Microsystems Inc OS Name Linux OS Version 2 6 11 1 14_FC3 Class Path usr local Zend bin javamw jar Java Home usr local ZOE re Bridge Statistics Field Value Number of connections 3 Number of requests 28 Figure 42 Java Status Page Statistical information is gathered on the
99. entral Server s URL is specified to the Nodes as a central control unit and from that point onwards access and read write permissions to nodes can be established from the Central Server 10 Chapter 2 Configuring Zend Platform INSIDE CONFIGURING ZEND PLATFORM MANAGING CLUSTERS CONFIGURE EVENT TRIGGERS DEFINE EVENT TRIGGERS TABLE CONFIGURE EVENT ACTIONS RULES CONFIGURE PERFORMANCE CONFIGURING THE ZDS ZEND DOWNLOAD SERVER CONFIGURING PHP SETTINGS CLONE SETTINGS CONFIGURING USERS AND USER PERMISSIONS ROLES The Zend Platform installation produces an out of the box fully functioning version of Zend Platform This installation includes basic default settings for monitoring events and code acceleration At this stage Zend Platform already generates events and improves code generation However to benefit from Full Power Cluster Management Audit Trails and much more it is necessary to tune Zend Platform s performance settings to suit your individual work environment In this chapter each configuration task is detailed in a chronological order beginning from the initial configuration tasks to configurations that may rely on other settings The configuration actions addressed in this chapter are listed below e Manage Clusters add the servers that you want Zend Platform to control Each server should be added and then grouped to create a cluster environment to be treated as a single entity in terms of event collection e
100. epends on the amount of memory available for allocation to the Accelerator When the Zend Accelerator is disabled only cached scripts are tested To enable the Zend Accelerator set the zend accelerator enabled directive in the php ini file to On To change Accelerator memory allocation 1 Go to Performance File View 2 In the Code Acceleration section a Increase the Accelerator Memory b Increase the Maximum Accelerated Files default 2000 If the memory fills up quickly especially if there is only a small amount of Accelerated files Increase the memory allocation or blacklist the file Files exceeding allocated memory or quantity will not be accelerated 98 Performance Accelerator Duplicate Functions Fix Some PHP code produces different opcodes for different situations function defined or not This causes a discrepancy for the accelerator in situations where the accelerator caches one version and then a different situation occurs that requires a different function If not addressed the script would just cease to work and raise a duplicate functions error To maintain proper performance in situations like these the zend_accelerator dups_fix parameter should be activated This parameter shuts down the Zend Accelerator s duplicate function check so that the errors will not occur This parameter belongs to The Zend Accelerator settings in the PHP Settings screen Zend Central Console Configure PHP Settings
101. er 50 Configuring Zend Platform It is extremely hard to artificially test ZDS The main reason is that testing iton a LAN can easily saturate your local network and if your MaxClients is very high Apache Benchmark ab may have difficulty handling the concurrency For this reason it is recommended to test ZDS with a relatively low MaxClients setting e g 50 150 so that you don t reach any of these limits The ZDS includes a version of ab which was modified to support bandwidth throttling which is used by the testing tool During a test your Web server will be fully loaded A test can take several minutes so you should run it ona development machine or on an offline production machine To Test the ZDS Go to Performance Testing and go to the Test Download tab Testing ES Email amp Print F Help 05 Feb 2006 17 03 12 Logged in as Admin Server name Gollum Test URL Analyze Site Test Download Enter URL for testing http gollum 80 ZendPlatform_2_1_2 2px zend_zend Clients Bandwidth Or ISON 128 Kbit s 9 DSL 0 5 Mbit s Number of Max Clients on the Server g NOTE Please make sure that the value for the Max Clients is the actual MaxClients value of the server it can be found in your Apache httpd conf file EI Show Last Download Test Resort Figure 22 Performance Testing Test Download Tab The Test Download Tab consists of two sections The test options are on the upper section and the te
102. erver the server whose configuration settings you wish to distribute to other servers in the network from the list of servers in the tree display 4 Click Next to open the Configuration Selection screen The Configuration Selection screen is a collapsible list of configuration parameters to be taken from the source server that was selected Only selected parameters are cloned By default all configuration parameters are de selected 5 Select the PHP configuration Zend products settings or entire Configuration file of the Zend products for the source server with the settings you wish to clone Select additional configuration parameters you wish to clone Click Next to select the destination server or servers In View Tree By field select the tree view you wish to use to find the destination server quickly 9 Select the Destination Server s i e the server s with the configuration settings that you wish to change to match parameters selected from the source server from the list of servers in the tree display 10 Click Clone The Clone Wizard distributes the selected parameters from the source server to the destination server s A Broadcast Summary screen appears indicating that the configuration settings have been cloned to the selected destination servers 53 Zend Platform i5 OS User Guide User Management Granting different levels of permissions to different users provides a means for controlling actio
103. es PHP and event collection The following illustration is a representation of Zend Platform Server components Zend Platform Central Central Server Zend Central Collector Database GUI Figure 3 Zend Platform Server Components The Central Server is dedicated to controlling the nodes to this server the Zend Platform Central server is installed The installation includes three main components 1 Zend Central that includes information collection and functionality Zend Performance PHP Intelligence and the Java Bridge 2 The Database is the main repository for event information collected from all registered nodes 3 One of the main components of Zend Central is the Collector Through this component information from nodes in the cluster is collected aggregated and displayed in the Zend Platform PHP Intelligence module The collector collects and aggregates information according to rule configurations that can be applied to a single server or to several servers Zend Platform i5 OS User Guide Nodes The Nodes are the web servers that run PHP Nodes are the individual servers that service a Web application and a collection of nodes also referred to as a cluster The central server governs clusters The following components need to be on each Node e Basic e A Supported operating system Linux Unix etc e A Supported Web Server Apache e PHP e PHP version 4 or 5 e Zend Products e Zend Platform e Zend Download
104. essing files twice and rendering them unusable Zend Platform i5 OS User Guide e Setting compression to cached files only should be done when there is a large quantity of cached files and the rest of the files do not require compression e Blacklist selectively disable compression for files do not require compression such as pictures that are already compressed or small files that do not require compression e When using PHP s compression feature zlib Setting Code Compression To change File Compression settings 1 Go to Performance File View 2 Select the appropriate Setting a None disables Compression b Only Cached Files applies compression to cached files only c All Files collectively applies compression to all files The list of files can be viewed in Performance File View Zend Optimizer The Zend Optimizer is a passive performance component that runs within the Zend Platform Framework and automatically optimizes scripts Zend Optimizer is also designed to detect and load files encoded with the Zend Encoder The Zend Optimizer s default setting is On which means the Optimizer will start to run as soon as Zend Platform is installed The Optimizer component does not require any additional configurations If you do not plan to use the Zend Optimizer to load encoded files you can slightly improve the Optimizer s performance by adding the zend_optimizer enable_loader 0 This disables the transp
105. et http www zend com manual function java last exception get php java last exception clear http www zend com manual function java last exception clear php PHP 5 has a concept of exceptions and therefore can handle Java exceptions and translate them into PHP exceptions The following examples display the different exception scenarios and what they look like How Exceptions Work In this example exceptions are inherited from an exception class e try stack new Java java util Stack stack gt push 1 Sresult stack gt pop print W sse her Sresult stack gt pop 110 Java Bridge catch Exception Sex prime toeerst ien im pop p print ex gt getCause gt toString Ein hel 2 gt Caught Exceptions This example shows what an exception looks like when a Java Code exception is caught This is an example of a typical exception that will appear instead of the expected PHP output when specified in the code i e using print_r exception or var_dump exception JavaException Object message protected gt Java Exception java util EmptyStackException java util EmptyStackException at java util Stack peek Stack java 79 ait Java Wii Stack cer Sie s javas Gl string private gt code protected gt 0 file protected gt vector php line protected gt 7 trace private gt Array 0 gt Array f
106. event occurred 70 PHP Intelligence e Status Status of the event e Severity Severity of the event The following actions can be performed on the events in the Events Table To apply one of these actions to an event events select the event by checking the check box next to the events e Delete Selected Deletes the Events form the database e gnore Selected A new Event Details screen will not be created for this specific occurrence Additional occurrences of this event will be added to the original Event s details e Close Selected Changes the status of the event to closed and preserves the Event in the Database If the same event occurs again a new Event Details screen will be created e Preserve Selected Saves the Event in the Database until the next scheduled cleanup e Reopen Selected Changes the status of ignored or closed events to open The default value for database cleanup is 7 days Depending on the operating system database cleanup settings can be changed in usr local Zend etc php embed ini or lt install_dir gt etc php embed ini by setting a different value for the parameter zend monitor event lifetime 71 Zend Platform i5 OS User Guide Event Details Understanding Event Details Event Details are generated in accordance to Event Triggers Event Details are a diagnostic tool that provides a complete audit trail and options for investigating and resolving events Event Details
107. formance Test results indicate the average improvement achieved by Code Acceleration Content Caching and the average overall improvement achieved Compression Test results present the improvement accomplished due to the File Compression Performance To Analyze a Site Go to Performance Testing and select the Analyze Site tab The following options are presented in the tab Run Performance Test Run Compression Test Display Previous Test Results Performance Test 1 Select the number of scripts to test and press Next 2 The following screen lists the scripts selected To change the number of the scripts to be tested press Previous To continue press Next 3 The Site Analysis Report appears indicating the Performance Gain and Popularity Rank of the scripts N A Test Results N A test results can be caused by various reasons To check the cause of a N A test result Place the cursor on top of the N A and the cause of the problem appears in a Tooltip N A can be caused when a script cannot be accessed or if the access time to the script is greater than the test duration 3 sec If this is the case test the script separately using the Test URL option After analyzing the test results you may wish to modify the caching status of the scripts and re run the test To re run the test Press Edit next to the script you wish to modify change the caching conditions and save the new settings If the message appears
108. hat are served over the HTTP Protocol and consume bandwidth Downloads include Video Files Binary Products such as exe and msi files and other large files which are served over the HTTP protocol and can potentially limit the performance of your website The ZDS provides two options 1 Configure ZDS Settings 2 Test ZDS ZDS functions in two modes e Manual Mode Calling the API function zend_send_file from PHP scripts e Transparent Mode mapping file extensions to zend mime types ini Either mode can be run separately or in conjunction Read on to find out how to configure the ZDS to run in either mode Manual Mode In Manual mode downloads are initiated by a PHP script that uses one all purpose PHP function call ZDS includes the PHP function zend send file filename Calling zend send file immediately starts the file download and terminates your PHP script s execution This effectively frees up the Apache process to handle the next incoming request The zend send file function can also serve files that are not under the Web server s document root Furthermore it can be used to run logical functions such as access restriction checks before downloads are started Usability Example If a download function is called my send file filename you should integrate the zend send file call in the following way in your source code if function exists zend send file zend send file Sfilename 48 Config
109. he first moment Zend Platform is installed The Zend optimization component performs several passes each pass searches for specific points in the PHP code that are know to have a negative affect on performance and changes them for faster execution Dynamic Content Caching Dynamic Content Caching dramatically reduces the number of times your server must run complex scripts execute resource intensive database queries or call external web services How it works Server side caching eliminates the need to return to databases duplicate processes or re build a web page for each page access Cached versions of any URL can be maintained for any amount of time that you determine Fully configurable parameters determine what to cache and based on which conditions No code level modifications are required Moreover you can use the PHP API for partial and conditional caching of parts of script functionality File Compression File Compression increases the end user download speed and decreases the workload on your http server Better than any other compression option due to integration with Dynamic Content Caching eliminating the time it takes to run the compression How it works Specific browser capabilities are auto detected If browser supports gzip format the results are compressed prior to returning to the user Both the original and the compressed version are cached and reused depending on browser capability and cache lifetime Download Ser
110. hould be considered when applying optimization tools 95 Zend Platform i5 OS User Guide Content Caching Dynamic Dynamic Content Caching is the process of running code once and saving the output on the server for reuse in a set time frame Cache Lifetime Each time the code is requested performance is improved by using the already run output instead of generating the same output each time When Should Files be Cached Files should be cached when their content is stable and does not require frequent changes When Not to Cache Files Caching is not recommended for files that have constantly changing output For example clocks timers and database queries See Caching Alternatives to find out how to Partial Page Cache How to Cache Files Caching by default is enabled set to ON In order to view change the setting 1 Click the Performance tab 2 Pick a server to configure 3 Click the Settings tab The dynamic caching enabled settings status will be displayed Next define the default caching settings These settings are applied to all cached files To prevent unnecessary memory use caching has to be actively applied to either a selected file or directory The performance module provides two options for caching files e Through the File view e Through the Performance Test Report Caching with the File View Caching can be applied to single files or do entire directories Go to Performance File View and choose
111. ialog allows you to define or remove Actions for the entire cluster kJ Help Event Actions Feb 2006 7 Action Rules Actions Add a new action Action Select action v Current Actions Send data to Remove Email to amit g zend com with subject Zend Platform Alert R Der Send XML data to http1 gollum test php R nemove Send XML data to http gollum zend office var dump php R Nemove Send XML data to http gollum zend office ZendCanaveral 2ps zend sen R Memove OK Cancel Apply erdi Figure 10 Event Actions 29 Zend Platform i5 OS User Guide From the Actions screen you can e Add remove global Action Types from a central administrative station e View Action Types currently defined in the system To add an Action 1 Select one of the options from the Action Type drop down list 2 Depending on the selection e mail or URL the action type details will change 3 Enter the information according to the selected Action Type e Target URL for the action type Submit a report to the specified URL e Recipient Address and Subject for the Action Type Send a report via e mail 4 Press Add to add the new Action Type to the Current Action Types list These Action Types can now be associated with Action Rules see below You can also change or remove the Action Type settings at any time Zend Platform supports two types of reports e E mail Report sends a text report to an e mail recipient This type
112. ifetime and conditions settings in the Settings tab are default values These settings can be modified per file or per directory in the File View workspace Dynamic Content Caching Settings are as follows e Dynamic Caching Enabled On The Dynamic Content Caching is active and working Off The Dynamic Content Caching is not in use e Maximum Cache Size The maximum size allocated for cache Occasionally and for short periods of time this value may be exceeded but only until the next time that the Cache Cleaner deletes the files that expired Set to 0 for an unlimited cache size e Minimum Free Disk space The minimal reserved free disk space required Reaching this value will end any further caching The caching will resume as soon as the space is greater than this value e Maximum Cached File Size The maximum allowed output cache file size An output cache file that exceeds this value will not be cached Set to 0 for an unlimited cache size e Default Cache Lifetime The lifetime in seconds of cached data The data will be re generated if the cached version is older than the expiration time The Cache Cleaner is directly related to the directive zend_accelerator cache_cleaner_freq that can be defined in the Configure PHP Settings screen This directive defines when expired cache files are removed from the cache 42 Configuring Zend Platform Default Caching Conditions By default Dynamic Content Caching caches each
113. ile gt vector php line gt 7 function gt pop class gt java util Stack tygel gt gt args gt Array javaException gt java util EmptyStackException Object Uncaught Exceptions Uncaught exceptions are also reported but because they lack an immediate relation to a specific exception class they are less detailed and can only indicate basic details regarding the occurrence of an exception This type of exception typically appears in your error log or wherever you have defined your php ini to store errors Zend Platform i5 OS User Guide Please refer to the PHP manual for more information regarding the php ini eror reporting definitions Fatal error Uncaught exception JavaException with message Java Exception java util EmptyStackException java util EmptyStackException at java util Stack peek Stack java 79 at JAVA WELL Stack joes gire javas Gl Valin vector jamas EE EE 0 vector php 7 java util Stack gt pop 1 main thrown in vector php on line 7 Java Array Hashtable Objects In PHP arrays and hashtables are used interchangeably This is because in PHP hashtables are indexed by integers or strings not by objects In Java the key and value must be objects to be associated so primitive types have to be converted to objects first before parsing In Zend Platform s J ava interface if a method returns array hashtable it is immediately transl
114. imes the event occurred and in case of Groups the information is expanded to include the servers on which the event occurred and the number of occurrences Event Occurrence Info Occurred twice the first on 18 Jan 2006 01 16 36 and the last on 18 Jan 2006 01 16 39 First occurrence was on virtual host kuzya on server kuzya Figure 31 Event Details Event Occurrence Info The Event Occurrence Info section shows the total number of occurrences the time and date of the first and last occurrence and the first server and vhost on which the event occurred In cases where an event occurred on several servers belonging to the same group an additional expandable list is added This list displays occurrences per server i e the server s name and total number of times the event occurred on the server Zend Studio Diagnostics The Zend Studio Diagnostics section shows the advanced diagnostic options that can be performed on the event s data These diagnostic options reconstruct the precise conditions that generated the event by recreating the request with the same parameters that were in the original request Information such as GET POST COOKIE etc The recreation process will not create an additional event 74 PHP Intelligence Zend Studio Diagnostics F Test URL IE Debug URL lg Profile URL EI Show Source Code Figure 32 Event Details Event Occurrence Info The diagnostic options that can be app
115. in turn on the script code The important differences are e Java is a programming language Java applications created in Java for the enterprise are not bound to a specific framework Therefore it is possible and perhaps preferable for an enterprise to relocate code libraries to a Zend Platform node e J2EE is a structured framework for application scripts developed for J2EE It is preferable that J 2EE servers be left intact See the Zend Platform System Diagram above Example 1 Typical Code The code sample below is a functional example you can run it The example demonstrates the interaction between the PHP application and Java objects that occurs in the Java Bridge implementation create Java object Sformatter new Java java text SimpleDateFormat WE EEE elo wayyy cue Jonge a muera e Print date through the object print formatter gt format new Java java util Date n You can also access Java system classes Ssystem new Java java lang System print S system n will use toString in PHP5 113 Zend Platform i5 OS User Guide print Java version system getProperty java version lt br gt n print Java vendor system getProperty java vendor lt p gt n n print OS system getProperty os name system getProperty os version on system getProperty os arch lt br gt n 2 gt The example code can be understood
116. ing from different servers are aggregated however they include an identifier for each node on which the Event occurred Servers are added to Zend Platform via the installation process Once a server is added server settings can be applied The cluster setting options available from Zend Central Console Manage Cluster are e Manage Servers Configure delete and define servers e Manage Groups Group servers together for event reporting and configuration purposes e Manage VHosts Virtual Hosts Manually delete and define Virtual Hosts Zend Platform Manage Cluster Microsoft Inter et Explorer close window X Hel Manage Cluster P Help 12 Jan 2006 17 30 27 Manage Servers Manage Groups Manage VHosts Server Address Server Name Group GUI Directory Port Remove gollum Gollum agg_cluster_1 ZendPlatform X Remove fireforge fireforge amitg ZendPlatform X Remove 10 1 3 104 fbsd Ungrouped ZendPlatform D Remove dolly5 zend office DollyFive Ungrouped ZendPlatform D Remove dolly3 zend office dolly3 Ungrouped ZendPlatform X Remove nowhere com Debbie test Ungrouped XXX X Remove Figure 7 Manage Clusters Dialog Once servers have been configured and grouped Event Triggers can be defined 12 Configuring Zend Platform Manage Servers The Manage Servers tab provides options for configuring and defining settings
117. irm the Password Permissions Group Select the Permissions Group to which the New User will be assigned from the list of Permissions Groups that are currently defined in the system Click Next to go to the second step In the Add New User wizard 2 Select the servers that you wish to allow the New User to access Click Finish The new user will be created in the database with the defined permissions Added Edited users can only view and edit events for the servers the User has permission to access Conversely servers denied to the User will not appear in the server tree when the User logs in to the system 55 Zend Platform i5 OS User Guide Editing a User Zend Platform allows administrator level users to edit the preferences for any User currently defined in the system Non administrator users can use this option to modify their password To edit user preferences 1 56 Click the Edit button to the right of the user whose preferences you wish to edit The Edit User Wizard opens with the user s name appearing in the User Name field In Edit User wizard Step 1 define the following General User Settings Password Enter a Password only if you wish to change the Password for that User otherwise leave the Password field empty Confirm Password Confirm the Password only if you are changing the Password for the User Permissions Group Select the Permissions Group to which the User will be assigned from th
118. it is impractical or impossible to cache the entire output such as when sections of the script are fully dynamic or when the conditions for caching the script are too numerous An example of this type of usage is when some of the output is a form that has credit card numbers addresses and all kinds of information that for security reasons should not be cached The following tutorial is a step by step guide to mastering Partial Page Caching Inside this tutorial you will find several ways to cache you output e Partial Page Caching APIs a general overview of the Caching APIs with usage examples e Action Based Partial Page Caching Cache using buttons and conditions Partial Page Caching APIs Partial Page Caching can also be achieved using the following functions for almost all situations Output Caching Functions Function Action output_cache_fetch Gets the code s return value from the cache if it is there output_cache_output Calls a function and checks if the function exists in the cache Yes PrintNo Puts function output in cache and prints output_cache_exists Checks if the key exists in the cache Yes Print No Runs code output in cache and prints until it reaches the stop command output_cache_stop output_cache_stop Indicates the end of a block of code Data Caching Functions Function Action output_cache_put Enters a single variable into the cache output_cache_get Gets the Variable from the ca
119. it or remove entirely e Edit Remove Allows you to edit or remove entirely the settings for a specific User of a specific Group e Add a New User A shortcut to the Add a New User Wizard e Add a New Group A shortcut to the Add a New Group Wizard Press here to see how to use user permissions to restrict access to virtual hosts 54 Configuring Zend Platform Adding and Editing Users Zend Platform allows you to Add Edit Zend Platform users However two conditions must be met 1 The master user adding new users must have administrative level permissions in the system New users must be added to an existing group Users are defined as belonging to a particular group not as independent entities Adding a User Zend Platform allows Administrator level users to create new users To add a new user 1 Click the Add a New User button in the lower left corner of the User Management workspace The Add a New User wizard opens In the Add New User wizard define the following General User Settings User Name Enter a User Name that the User will use when logging in to Platform Password Enter a Password that the User will use when logging in to Platform Platform GUI Passwords may contain between 4 16 characters including the following the alphanumeric characters a through z A through Z and 0 through 9 and the special characters dash _ underscore and period Confirm Password Conf
120. itoring event Absolute a customer configured hard number Relative a customer configured percentage Excess Memory Usage events are used to identify when scripts are using excess memory that can hinder the application s ability to perform This event is used mainly used in Production but QA can also benefit from monitoring by KB or percentage of memory used by a script to execute Description e Excess Memory Usage Absolute Generates an event when memory for PHP script execution uses more than a set amount of KB for moderate events and severe events e Excess Memory Usage Relative Generates an event when memory use for PHP script execution is above or below average a set percent for moderate and severe events Both Event Types are only active if the PHP is compiled with memory limit Compile the PHP with the configure switch enable memory limit The default values for both of these event types are set to 0 To generate events configure these settings to a value that suits required memory usage Relative Events Event definitions are based on relative values i e percentage Relative values are set according to warm up settings default value of 500 requests If necessary the default value can be modified manually by changing the zend_monitor warmup_ requests directive in the zend ini 24 Configuring Zend Platform Database Error Database Error Events are used to report function errors to databases
121. ity to clone servers one to one and one to many e The ability to monitor performance improvement with Code Acceleration Content Caching File Compression and the Download Server e The ability to integrate with Java system elements over Platform s fully implemented PHP J ava Bridge Zend Platform i5 OS User Guide About Zend Platform for i5 OS Zend Platform is the only robust PHP production environment that ensures your applications run smoothly at all times Designed for IT personnel and businesses that require industrial strength applications in highly reliable production environments Zend Platform offers high performance and scalability to provide your customers with the best possible Web experience and response time Zend Platform uniquely guarantees application up time and reliability through enhanced PHP monitoring and immediate problem resolution that removes the troubleshooting guesswork out of the equation and replaces it with peace of mind You spent time and money developing your state of the art PHP application now it s time to ensure it s up and running Navigation Zend Platform is a browser based application The general layout of functionality is in a tabbed view where each tab represents a unique functionality Zend Central central management functionality PHP Intelligence monitoring and event generation capabilities Performance performance enhancement tools java Bridge incorporate a Java e
122. ive in the httpd conf file The ZDS installation tries to identify your MaxClients value via the httpd conf file that is the GUI s default value but this value can be changed after the installation so it is important to verify that the value listed is correct 4 Press Run to Run the Download Test 101 Zend Platform i5 OS User Guide Viewing Download Test Results Once the tests have completed you can view the test results both statistically and graphically To view the results of the most recent Download Test From the Test Download Tab press Show Last Download Test Report The test report includes tables and graphs that display the Requests per Second and Number of Concurrent Requests for each test run The Download Test is a simulation The most meaningful test results are obtained by running ZDS on the production server and monitoring the log file to see how many concurrent jobs the ZDS is handling This completes the Performance Lifecycle chapter of the User Guide In this section we have described the Performance Lifecycle and how implement the Zend Performance tools in creating optimal performance levels in an organization s environment Please refer to Appendix C Performance Lifecycle Check List to read print the Performance Lifecycle Check List that summarizes the performance optimization tasks 102 Chapter 5 J ava Bridge IN THIS CHAPTER J AVA BRIDGE TAB ABOUT ZEND S J AVA BRID
123. l in a pop up screen el Shows the function call in Zend Studio 76 PHP Intelligence Included Files The Included Files section only appears in slow script error events The files listed are all the files that are included in the PHP script that caused the error to occur Show Source Code Shows event data in the Event details in the form of an expandable text field This option opens the file in the section of code where the event occurred To view the source code in Event Details Press Show Source Code to expand the text area Event Administration The Event Administration section includes all the actions that can be applied to an event see Controlling Information Displayed in an Event to learn how to disable these options for certain users O Preserve event this event will not be deleted during database cleanups Delete Event Ignore Event Close Event Figure 34 Event Details Event Administration Actions The applicable actions Buttons are as follows e Preserve Event Keeps the event in the database even during database cleanups e Delete Event Deletes the event e removes the event entirely from the database e gnore Event Ignores future instances of this event i e changes the event status to ignore Therefore if the same event occurs again Platform will not open a new event e Close Event Closes the event i e changes the event status to closed Therefore if this event occurs again Pla
124. l of the triggered event default value is Severe e user data adds a PHP variable that will be viewed in the Event Details in Event Context gt Variables gt User Defined This forms the stored Event Context similar to the information obtained in a PHP error event Aggregation takes place for these events when two events occur in the same place and have the same class text sever ity When viewing these events in PHP Intelligence Event List they can be filtered by the Custom Events category Event Actions defined for these events should be set to send to URL rather than sending by e mail as there is only one definition for these events and Event Details sent to a URL can be easily forwarded elsewhere This is to prevent the overloading of e mail If we use the e mail action for every custom event e mail will be sent and there can be many classes of custom events However if the URL action is used a script can be used to identify the event s class and different behaviors can be implemented according to class To find out how to leverage Event Details information sent to URLs go to Tutorial Integrating Existing and Legacy Applications 79 Zend Platform i5 OS User Guide Event Callbacks The event callback mechanism is used for viewing additional information about local variables in order to investigate what happened when an event was generated The additional information is displayed in the Event Details
125. lacklisted Files for viewing current blacklist settings To update the Blacklist 1 Select a file or files from the File View by selecting the check box next to the file names 2 Press the Update Blacklist button This will open the Update Blacklists dialog with a list containing the selected files in the dialog 3 The following options can be applied to each file e Add a file into the Acceleration Blacklist Check the Don t Accelerate box e Add a file into the Compression Blacklist Check the Don t Compress box e Remove a file from a blacklist Un check the appropriate box 47 Zend Platform i5 OS User Guide e Add all the files to a blacklist Check the appropriate box in the Select all line at the top of the files list Current Blacklisted Files This section displays a list of files that are either not accelerated or not compressed or both Files in the Compression Blacklist are not compressed whether they are cached or accelerated To see the files in a blacklist click on the Expand button Only single files not directories are added to the Blacklist Configuring the Zend Download Server ZDS This feature is currently not applicable for Windows Operating Systems The ZDS Zend Download Server is a PHP Zend Engine plug in The purpose of this plug in is to efficiently deal with serving large downloads This is done to preserve website performance levels when handling large downloads t
126. lar string or serialized data output cache put has no return value output cache get takes two arguments 1 The key value with which the data is stored 2 The lifetime that this data should be considered valid output cache put returns the cached data if it exists and is valid Otherwise it returns false Usage Example 8 if Sresult output cache get TestFunctionResult 30 false Sues alero ramas HIS Ss Cubas i timestamp E print lt br gt lt i gt Fetching Fresh Content lt i gt lt br gt Should only print this every 30 seconds when the content is fetched fresh output_cache_put TestFunctionResult Cached result print lt b gt Sresullt lt b gt lt br gt 143 Zend Platform i5 OS User Guide Usage Notes The put get routines are a simpler method for caching data than output cache fetch They are typically used for the storage and retrieval of small bits of data Action Based Partial Page Caching Action Based Partial Page Caching pertains to caching part of an output based on the occurrence of an action This type of Caching is necessary in instances where it is preferable to refresh the Cache when an action occurs rather than time based For example If we have a list of people who are Currently Online and we were to use time based caching we would have to set an extremely short time limit to make sure that the list is updated at all times We would also waste valuable
127. lied to event information are as follows e Test URL Loads the exact same URL from the event with the exact same parameters GET POST COOKIE HTTP HEADERS etc and shows the script s output in the browser The Test URL option does not require the Integration with Zend Studio e Debug URL Initiates a Debug session of this URL in the Zend Studio e Profile URL Profiles the URL using the Zend Studio Profiler with the same parameters GET POST COOKIE HTTP HEADERS etc e Show Source Code Opens the file where the event occurred in Zend Studio This option provides a means for editing files and implementing changes to multiple servers using Zend Studio Important Debug URL Profile URL and Show Source Code can be activated when the following conditions are met 1 Zend Debugger is installed on the server where the event occurred 2 Zend Studio ZDE is open 3 Zend Core is configured to allow Communication between Zend Platform and Zend Studio Event Context Event context includes relevant information available at the time of the occurrence This information varies according to the type of event generated There are four main Event context categories 1 Function Data 2 Variables 3 Backtrace 4 Included Files Zend Platform i5 OS User Guide Event Context Data E Function Data Function Name main Variables GET E POST amp COOKIE E SERVER E Backtrace main at usr local apache ssi 29 htdo
128. lient script file shipped with the Websphere Client Install bin sh opt IBM WebSphere AppClient bin setupClient sh Change the PROVIDER_URL to point to this machine or another server if S SERVERPORTNUMBER then PROVIDER_URL iiop SDEFAULTSERVERNAME SSERVERPORTNUMBER else PROVID Es R_URL iiop DEFAULTSERVERNAME de SJAVA_HOME bin java SWAS_LOGGING classpath usr local Zend bin javamw jar opt IBM WebSphere AppClient samples lib Tec hnologySamplesThinClient BasicCalculatorClientCommon jar opt IBM WebSphere AppClient samples lib TechnologySamplesThinClient BasicCalculatorThinClient jar opt IBM WebSphere AppClient samples lib TechnologySamplesThinClient Bas icCalculatorEJB jar Djava ext dirs WAS EXT DIRS Djava naming provider url PROVIDER URL Djava naming factory initial com ibm websphere naming WsnInitialContextFac COCV Dzend javamw threads 20 Dzend javamw port 10001 SERVER_ROOT SCLIENTSAS com zend javamw JavaServer 135 Zend Platform i5 OS User Guide Instructions Start the javaMW server using the script Write a PHP client which uses the J ava Bridge functionality to call the ejb running on Websphere The following is an example PHP client for calling the Basic Calculator Technology sample lt php Get the provider URL and Initial n
129. lies to this business scenario and others like it lt create Java object Sstock new Java com ticker JavaStock ZG eall the emet Snews stock get news GET ticker display results foreach news as news item print news item br n ER The example code can be understood as follows e The code example is written in PHP and forms part of a PHP Web application e The PHP code creates the Java object com ticker J avaStock which is the PHP proxy e Requests come into the PHP based Website ForeverOnline com which then references 114 Java Bridge the Stock Ticker application e Stock Ticker references a custom object get_news in the JVM library This is all in native J ava e The PHP code then outputs the results on the Website The Typical Java Bridge Implementation and the Zend Platform s Java Bridge Implementation diagrams below show how Forever Times concern about performance is addressed through the Zend Platform Java Bridge architecture The diagrams focus on how problems in scalability arise in a typical J ava Bridge Implementation 200 PHP Processes or More EO ern D web ETE m Server ETI a t Internet EM B E Em ter D mma JAVA PHP PHP JAYA Bridge Figure 43 Typical Java Bridge Implementation Zend Platform s Java Bridge Implementation diagram shows how scalability issues are addressed in the Zend Platform Java Bridge 200 P
130. llowing properties must be equal for events that are of type longfunction or longquery 1 Script id Source file Line number Function name Location mom ow qe Aggregation hint 7 Severity Custom Events The following properties must be equal for custom events 1 Type this is the first parameter user provides 2 Severity 3 Event text 4 Source file 5 Line number Additional Events The rest of the events are aggregated according to following attributes if two conditions are met 1 The event type is one of the following devmem memsize devscript outsize or longscript 2 The event has a script id attribute For these events the following attributes must be equal 1 Type 151 Zend Platform i5 OS User Guide 2 Script id 3 Location 4 Severity 152 Appendixes Appendix D Zend Platform Support Zend Platform Support Zend Platform Support provides Zend Product owners and prospective Zend Product owners with information regarding System Requirements Installation Instructions General FAQ Quick Start Guide and much more Visit http www zend com support support_platform php Zend Support Center The Zend Support Center is your online destination for information and assistance for Zend s best of breed PHP products and technologies e Knowledge Base e Support FAQ e Submit a Support Ticket Visit https www zend com support index php 153 Zend Platform i5 OS User Guide
131. lp ALAS AAA A di Mss RAN AENA 05 Sep 2005 15 59 36 Logged in as Admin Server name fireforge Filter By gt Event Type Active Rules Activate All Iv E Script runtime exceeds msec Additional rules ow Script Execution Absolute v D uppress in case a Slow Function Execution event occurs Slow Script Execution Absolute ei Os i Slow Function E ion t W Script runtime exceeds msec Suppress in case the load average is above E Script runtime varied by o Jo from avg Additional rules 2 Slow Script Execution Relative Ivi The same additional rules as the S ow Script Execution Absolute event W Script runtime varied by o from ava E PHP error occurs Triggered types Additional rules Special behavior with error_reporting 0 and operator P PHP Error v Report errors that match the error_reporting criteria v W PHP error occurs Triggered types W Failure of one of these PHP functions Zusrilocal Zend Platform lib watch res txt 2 Function Error Bei Additional rules E Function runtime exceeds msec Watch for long execution of these PHP functions E Slow Function Execution fusr local Zend Platform lib watch funcs txt Function runtime exceeds 1000 msec e In order to capture this event PHP must be compiled with memory limit support P Excess Memory Usage Absolute Script uses more than 0 KB of memory Script uses more than 0 K
132. ment for Average improvement for Average overall accelerated files pr 55 cached files 1 00 improvement 1 12 Cached l Accelerated Figure 38 Performance Test Report This screen shows if a file is cached and provides an option to cache a selected file from the list To Cache a file from the Site Analysis Report 1 Go to Performance Testing and select the Analyze Site Tab 2 Run a performance test or view the last performance test 3 Go to the test results and press Edit This will open the Define Caching Conditions dialog Caching Alternatives Web pages that contain sections that continuously change can also be cached This partial page caching solution can be accomplished through applying caching APIs to portions of code that do not change Partial Page Caching provides an intermediate solution for providing a partial performance boost that sustains the accuracy of changing content To find out more about Partial Page Caching go to Tutorial Partial and Preemptive Page Caching Dynamic Content Caching can be deactivated from Performance Settings and changing Dynamic Caching Enabled to Off This will remove all Dynamic Content Caching settings from the files on the server However Partial Page Caching will not be affected Partial Page Caching can only be disabled by removing the Caching APIs from the code 97 Zend Platform i5 OS User Guide Code Acceleration Code Acceleration is the proce
133. ment three expires output cache output is typically used to capture the output created by a function call In order to use it you would need to wrap a section of code as a function When you call output cache output it will call this function and cache it s output output cache output takes three arguments 1 The key value with which this output will be cached 2 The function call 3 The cache lifetime in seconds output cache output has no return value Usage Example lt function content time Create a function to Wrap the code that produces the outpte GE print lt p gt Cached Time time lt p gt es Mas acetal walle or rela yal les eraen 138 Tutorials only once every 30 seconds The output from the print statement will be cached and the function call will be ignored until the cache lifetime expires Stime time Get current time in seconds prine o Cure Times Stime Giel JS Prime the real curcone time 7 output cache output Current Time content time 30 l Cache all peter zor the Function comes O amel store it based on the key Current Time for 30 seconds 2 gt Usage Notes output_cache_output is used to cache the output generated from functions To utilize it wrap a section of code which generates the output you wish to cache as a function Any output statements in this new function will be captured into a buffer and stored as ca
134. mit for Aggregation hints is 255 chars longer hints will not be aggregated e Error text the error text that was attached to the event e Script id refers to the record for the script that the user requested i e derived from original request URL e Severity the severity of the event currently has two levels regular and severe Another property that is taken into account is the event status Only events that are not closed are aggregated Events are not aggregated when they are one of the following e Events of different types e Events that happened on different non aggregated servers e Events with different aggregation hints e Events with different severity Zend Error Events The following properties must be equal for events that are of type zenderror Type note this is a Zend error type like E_ WARNING not monitor error type Source file Line number Function name o rann Location 150 Appendixes 6 Aggregation hint The Error text attribute must be 75 similar To learn more about text similarity read http uk php net manual en function similar text php Function Error Events The following properties must be equal for events that are of type funcerror or dberror 1 Source file 2 Line number 3 Function name 4 Location 5 Aggregation hint If one of the events has an Error text attribute than the Error texts must be the same not similar Long Function Events The fo
135. n The place the Zend directory was installed to Studio Server zend gui language Description Language code the GUI uses for texts i e en for English zend gui language charset Description If set all the GUI files will send a Content Type header with this charset also used to send specific charset in Email should be used in the Japanese version zend gui ini modifier Description The path where the ini modifier util is zend central error logging Description If enabled the Zend Platform GUI will log errors into the file zend central error Joo that is located in the lt install dir gt logs directory zend central gui address Description The full address of the central GUI this address is used by the node to access the central GUI login process The address is in http s host port path format 127 Zend Platform i5 OS User Guide zend_central node_address Each node has this directive set with his address the same address that he gave the central during installation this is the way the central identify the server in the DB The address is ONLY the hostname IP address zds your_servers_max_clients Description Use for the ZDS tests in the GUI Performance section in Platform to know what is the value of the maxClients of the server Collector Center Directives zend_monitor collector_cert Description Certificate file for the CC zend_monitor collector_key Description Private key file for the CC zend_monitor
136. n Zenger GA 86 Download Server ii idas 86 Performance D ule aA 86 Implementing the Performance ada e 89 Benchmarking Site Analysls oi peret A euius ebd age aed 89 Analyze Site Benchmark t A A TRUE ANE dai E M re dee dd 90 Benchmark Web application NEE KENNEN EEN edere terre rh REENEN E de Per beet eae 90 esus TEM 90 Performance IR denne er gege Een E Ed NEEN NEEN E WEEN ve 91 eu el Le IR RETTEN EN Display Previous Test Results eerie id ru RED aA 92 Event Trigger Settings and Analvels mme memes 93 Calibrating Event Triggers for Performance Optimization assez 93 Table Of Contents Investigating Performance Related Event 93 Performance Optimization RL 95 When to Apply Optimization Tools enndem ena mue n erreen ENEE 95 Content Caching Dvnamic nc iaaa eem ern nnn 96 Caching With the File View cuco ee EN EEN REENEN ENEE ENEE d dane Baa eR erregek ego 96 Caching with the Performance Test Reports c cece eee memes 96 Caching Ba aaa 97 aA dedala 98 Accelerator Duplicate Functions Pis 99 Reset Accelerator aguan tan deat dent Tag a UE ia 99 Code Compre ITT 99 Setting Code COMPTESSION uisi teer ADM de a Rudi ES 100 Zend OPM AAA 100 Test Bewegung etten E e sages A 101 Viewing Download Test Results 102 Chapter 5 Java TT CET 103 About Zend s J ava Bridge daaa mH msn 104 Zend Platform Oe 104 J2EE Application EE 105 Added WEIER 106 Operating and Configuring Zend Platform s J av
137. nction This is to prevent double reporting as these events will be reported as Slow Function Execution events e Suppress in case the load average is above X Selecting this option ignores events that occur when the average number of active processes waiting for CPU time is above x active processes 3 active processes is the default value These additional rules are applied to the Absolute and Relative Slow Script Execution event types Slow Script Execution Relative This is a performance monitoring event Relative Slow Script Execution is used to generate an event when script execution is lower or higher than the average script execution time Parameters should be set to a certain percentage for moderate and severe alerts The default values for this event type are set to 0 To generate events configure these settings to a value that suits required script run time Additional Rules e Suppress in case a Slow Function Execution event occurs Selecting this option ignores Slow Script Execution events that are caused by a slow function This is to prevent double reporting as these events will be reported as Slow Function Execution events e Suppress in case the load average is above x Selecting this option ignores events that occur when the average number of active processes waiting for CPU time is above x active processes 3 active processes is the default value These additional rules are defined in the Absolute Slow
138. nd monitor tmp dir Description Directory where monitor temp files are written G GET P POST C COOKIE R RAW POST DATA E ENV V SERVER S SESSION F FILES 126 APIs and Directives Zend Monitor Event Types For each event type there is a zend_monitor lt event_type gt zend_monitor lt event_type gt can be set to off then this event type will not be reported E g zend_monitor memsize enable Off however the same settings can be easily defined from PHP Intelligence Event Triggers The following list displays the event types and the respective directive for enabling and disabling Events e Slow Script Execution Absolute zend_monitor longscript enable e Slow Script Execution Relative zend_monitor devscript enable e PHP Error zend_monitor zenderror enable e Function Database Error zend_monitor funcerror enable e Slow Function Execution Slow Query Execution zend monitor longfunction enable e Excess Memory Usage Absolute and Relative zend_monitor devmem enablezend_monitor memsize enable e inconsistent Output Size zend_monitor outsize enable e Load Average zend_monitor load enable e Custom Event zend_monitor custom enable All event types are enabled by default zend_monitor enable when turned off will disable all event reporting activity GUI Directives zps install_dir Description The place the Zend directory was installed to Platform ZPS studio install_ dir Descriptio
139. ngs Tab Reset Clears the content cache Settings Leads to the Dynamic Content Caching section of the Settings Tab Add Remove leads to Performance File View where Cache settings can be added Removed Settings Leads to the File Compression section of the Settings Tab Settings leads to the Download Server section of the Settings Tab At the bottom of the Console there are shortcuts to individual Test functions as follows e Run Performance Test runs a test that evaluates improved performance via Code Acceleration and Dynamic Content Caching e Run Compression Test runs a test that evaluates improved performance via File Compression e Run Download Test runs a test on a selected file that uses the Download Server ZDS to check the positive affect the ZDS has on performance These options lead to the appropriate option in the Testing Tab Performance Testing and will not run the test before setting the preferences 34 Configuring Zend Platform File View Most performance configurations are done in the File View screen Before describing the configuration tasks it is important to understand the screen s layout and functionality The File View screen consists of two sections 1 The Tree View on the left displays the list of directories and provides options for filtering the view by status Cached Accelerated Blacklisted and Compressed the Virtual Hosts list is also updated from her
140. ning okay this Event indicates what other outside problems i e network database web services file system etc you may have based on the PHP function s behavior This Event is also useful for catching pure PHP functions that are performing slowly Description Generates an event when function execution exceeds the setting defined in the rule The default values are 500 msec for moderate 1000 msec for severe alerts This applies to the functions selected in the additional rules section Additional Rules Generate events for specified PHP functions built in or user defined There are three ways to add functions to be monitored 1 Specify the function name object methods can also be used for example bar foo 2 Use wild cards to specify a range of function names for example mysql_ will select all functions beginning with mysgl 3 Specify the full path to a file containing a list of functions each in a new line Database related functions are directed and reported as Slow Query Execution see the Slow Query Execution event type 23 Zend Platform i5 OS User Guide When the Watched Functions file is applied to the Slow Function Execution Event Type the functions included in the file will be monitored and an Event Report will be generated when the function execution exceeds the values defined to trigger a moderate or severe event Excess Memory Usage Absolute and Relative This is a performance mon
141. ns performed in the environment and enforcing work procedures This is the last step to customizing Zend Platform to suit your working environment Zend Central s User Management tab includes Platform s multiple users functionality This feature set allows different users to login to Platform Each user has a set of permissions that are defined by the system administrator that determine e Data the user is allowed to view e Zend products the user is allowed to access e Actions the user is allowed to perform The User Management workspace displays information about the users currently defined in the system It also provides shortcuts to the User Management functions supported by Zend Platform User Management 02 Feb 2006 14 45 5 Logged in as Admin Existing Users User Name Group Name Has Server Restriction a Admin Administrators None Edit Add a New User Add a New Group Figure 24 User Management The information fields and functions that make up the User Information workspace are as follows e Logged in as Displays the name of the User who is currently logged in to Zend Platform e Current Existing Users A list of users currently defined in the system e Group Name Users are defined within the system as belonging to a particular group and not as independent entities This is the name of the Permission Group to which the User belongs e Handle Groups Selects the group whose attributes you wish to ed
142. nvironment to enrich your applications Central Control Center Zend Platform is designed as to handle clusters and not just standalone servers As such users can navigate freely between the central server and nodes Users stay on the central server as long as they are not prompted to select a server As Soon as a server is selected all subsequent actions and settings will be done on the selected server only A status bar showing the date time and login name will also display the name of the server the user is currently on When no server name appears you are on the central server Introduction to Zend Platform Zend Platform Overview Zend Platform is a central management solution and run time environment for Configuration Management Platform s architecture provides full control of the PHP application platform including performance management settings event thresholds etc allowing administrators to set up groups of multiple identical servers via e Remote server configuration e Clone configurations or parts of configurations from one server to another or from one server to an entire group of servers Performance Management Platform is equipped with four management modules for tracking and improving speed and responsiveness of Web applications These include Code Acceleration Dynamic Content Caching File Compression and the Zend Download Server PHP Intelligence Platform features new technology that detects and re
143. occurred since the node installation To add a removed server you can re register by going to the server and running lt install dir gt bin register_node sh currently not applicable for Windows Operating Systems 13 Zend Platform i5 OS User Guide Manage Groups The Manage Groups tab provides options grouping servers together for event reporting and configuration purposes Groups are created for three distinct purposes e To aggregate Events across nodes only if the nodes are running the same Web application e To enable configurations to be automatically applied to other servers belonging to the same group using the Clone Configurations feature e To facilitate handling and managing groups of servers Groups should only be aggregated when the PHP application on all servers in the group is identical To create a new group 1 Give the Group a name in the Add a new group field and press Add A new group will be added to the list below 2 If you want to aggregate all events that occur on the servers associated with the specific group select the Aggregated option Manage VHosts The Manage VHosts tab provides a way to manually define Virtual Hosts In general virtual hosts are automatically added based on Event activity However Virtual Hosts only appear in the lists after an event is generated for a specific virtual host To ensure that all Virtual Hosts can be visible an additional option has
144. ode make sure you meet the following requirements e The file extensions appear in the zend mime types ini file and the file is mapped to the correct mime type For example to serve mpeg files via the ZDS add the following line in zend mime types ini e Video mpeg mpeg e In your Apache Server s configuration file map the file type to PHP e For example to map all mpeg files to the ZDS in Apache by adding the following line to the Apache Server s configuration AddType application x httpd php mpeg Both methods manual mode and transparent mode ensure that the Web application will continue to work even if for some reason you decide to temporarily disable the ZDS as Zend Platform i5 OS User Guide long as the ZDS module was loaded To Configure the ZDS Go to Performance Settings and go to the Zend Download Server Settings section of the Settings screen PP Download Server Current Settings New Settings Minimum File Size 64 KB 64 KB Apache Server MaxClients Unknovm o Log File usr local Zend logs ZDS log usr local Zend log Figure 21 Zend Download Server Settings The settings screen provides three general ZDS configuration settings e Minimum File Size The minimum size of files that will be served by the ZDS Small files need not be served by the ZDS since performance gain is insignificant Default 32Kbytes e Server MaxClients The testing tool in the GUI uses this value to determin
145. oduce a report For example Red Script Runtime Exceeds 500 Seconds means that the system will generate a critical red event for Slow Script Execution Absolute type events if the condition gt 500 sec is met The user defines the thresholds for both the moderate and severe events Some events have only one level of severity like function error To define whether or not Zend Monitor will report a specific event enable disable the event in the Active column of the Define Event Triggers table To save the changes to Event Trigger definitions click Save Rules The changes will then be updated in the database Each event type has its own advantages and characteristics Press the link to view all the different Alert Types their descriptions and recommended usage Choosing and Defining Event Triggers Events marked as Performance Monitoring Events have a special role in optimizing web application performance Configuring Zend Platform Slow Script Execution Absolute This is a performance monitoring event Absolute Slow Script Execution is used to generate an event when executing a script exceeds defined limits This function is used to maintain performance standards Default parameters are 500 msec for moderate 2000 msec for severe alerts Additional Rules e Suppress in case a Slow Function Execution event occurs Selecting this option ignores Slow Script Execution events that are caused by a slow fu
146. on to people who only need to see event details and granting authorization to Close events only to those who should close events such as managers or team leaders we can create and maintain a structured working environment The Event List provides four options for handling events in the system Close Event Closes the event i e changes the event status to closed Therefore if this event occurs again Platform will open a new event Ignore Event Ignores future instances of this event i e changes the event status to ignore Therefore if the same event occurs again Platform will not open a new event Delete Event Deletes the event i e removes the event entirely from the database Manual Override Users can also manually change the status of an event by clicking on the event in the Event List and changing its status This method is helpful for example if you want to un ignore an ignored event and restore it to the main screen This completes the PHP Intelligence chapter of the User Guide In this section we have described the Problem Resolution Lifecycle and how it can be implemented in an organization s environment 84 Chapter 4 Performance IN THIS CHAPTER OVERVIEW CODE ACCELERATION CODE OPTIMIZATION FILE COMPRESSION DOWNLOAD SERVER PERFORMANCE LIFECYCLE BENCHMARKING SITE ANALYSIS EVENT TRIGGER SETTING AND ANALYSIS PERFORMANCE OPTIMIZATION TOOLS WHEN TO APPLY OPTIMIZATION TOOLS DYNAMIC CONTENT C
147. on which the server is listening Default is 10001 This must be the same as zend javamw port for the server e Java ints are longs converts PHP s integer to Java s java lang Long By default and if this option is off the PHP s integers are converted to java lang I nteger 109 Zend Platform i5 OS User Guide Usability Issues The Java Bridge s PHP 4 module has a number of usability issues compared to native J ava code which stem from the limitations imposed by the PHP 4 language Most of these limitations do not exist in PHP 5 and those that do will be mentioned as such Chain Functions Call In pure Java you can program the following chain function result object Methodl Method2 Method3 In this example the result of one method becomes the object for another method PHP 4 s Java module however does not allow you to write a chain function in a similar way as per example result java object Methodl gt Method2 gt Method3 This is due to the fact that PHP 4 disallows chaining method calls Instead a chain function must be expressed as follows Sresultl java object Methodl Sresult2 result1 gt Method2 ii Sresult result2 gt Methoa3 In PHP 5 you can use chaining Exceptions Since PHP 4 has no concept of exception you may not include J ava exceptions in your PHP code However you can use functions to deal with exceptions java exception g
148. onsole Event Triggers Benchmark Web application to establish a second optimization starting point Performance Testing Analyze Site Run Performance Tool Analyze Event Details to pinpoint performance issues PHP Intelligence Event List Recommended Focus on the following performance related event types Slow Script Execution Absolute and Relative Slow Query Execution Slow Function Execution Excess Memory Usage Absolute and Relative Apply Caching to boost Web application performance Define Dynamic Content Caching Performance File View or from the Site Analysis results Apply Partial Page Content Caching APIs see Tutorial Configure Acceleration to save code compilation time Acceleration Settings Performance Settings Acceleration Blacklist Performance File View Configure Compression to consume less bandwidth Compression Settings Performance Settings Compression Blacklist Performance File View Important Deactivate compression entirely if the server is set to handle compression Performance Settings File Compression Configure Optimization optimize script and detect encoded files Zend Central Console Configure PHP Settings Zend Zend Optimizer Benchmark Web application to view optimization boost Performance Testing Analyze Site Run Performance Tool 149 Zend Platform i5 OS User Guide Appendix C Event Aggregation Mechanism Introduction This appendix
149. ored to identify with precision the number of milliseconds or percentage it takes to execute a script This identification is based on parameters that you can determine as acceptable performance thresholds Filtering Event Triggers Zend Platform is equipped with 12 types of Events for monitoring performance and script execution The default Event Trigger display is a non filtered view that shows all the available Alerts A filter is provided to allow displaying a selection of events by type 18 Configuring Zend Platform To filter events 1 Press Filter By to expand the filter list 2 Use the two drop down fields to select the Events to display by e Events From The area where the event originated script database web server etc e Event Types Filter view to display Events according to their Event Type The selection changes according to the area chosen in the Events From field 3 Press Go to filter the view 19 Zend Platform i5 OS User Guide Define Event Triggers The fields that make up the Define Event Triggers table can be understood as follows e Event Type The type of event that under the rules defined will produce an alert in the monitoring system e Active When enabled for a specific event Zend Monitor node will report alerts when they occur This gives the user the right to disable an event for a particular server e Rules Defines the conditions under which an event will pr
150. ors that were silenced using either the error reporting setting or the silence operator 3 Report any errors that were not silenced with the operator Ignore the error reporting setting and only ignore errors that were silenced with the silence operator Function Error Function Errors are returned from functions and therefore offer more specific information about the root of the error that does not always arise from PHP errors This type of Event is usually used in QA and Production for identifying run time events as opposed to PHP errors that identify code related syntactical events Function Errors can prove to be invaluable to an organization as they provide a different perspective on problems view the outside problems through the eyes of PHP Despite the fact that the code may be running okay this Event indicates what other outside problems i e network database web services file system etc you may have based on the PHP function s behavior Issues like these used to be difficult to reproduce however with the complete audit trail and full problem context Function Errors can be easily reproduced to a level of accuracy that mirrors the actual time of occurrence Description Generate a severe event when an error in one of the specified PHP Functions built in or user defined fails returns a FALSE value To add a function enter the name into the field and press Add There are three ways to monitor PHP functions
151. ortcuts The Select Server to Configure screen opens 2 Select a server from the Server Tree 3 Click Select to open the Event Triggers screen for the selected server View Tree By Servers in Alphabetic Order x Ba All OM test O dolly3 O DollyFive O fosd 2 fireforge Gollum Figure 9 Select Server to Configure To configure multiple servers or a server group with the same Event Triggers 1 configure a selected server and 2 then use the Quick Clone button to propagate settings from that server to other server nodes Event Types are the specific events configured by administrators for monitoring a server node The Define Event Triggers procedure is used to define the conditions under which a server will generate an Event of a specific severity when an event of the type occurs The Event Types supported in the current version of Zend Platform are described below Why Configure Event Triggers Event Triggers are an essential tool for pinpointing bottlenecks in Web applications Events not only indicate that one of the thresholds was breached they also collect information relevant to the occurrence to provide a full audit trail for diagnostics In terms of the end product these thresholds can be directly translated into performance issues the end user may encounter Therefore the more Events resolved the better the application will run By using Event Triggers scripts can be monit
152. ovements achieved by Code Acceleration Dynamic Content Caching and File Compression and the popularity of each file e Test Download tests the efficiency of the Zend Download Server This test is addressed in a separate section at the end of this chapter titled Zend Download Server The above mentioned tests analyze an entire site s performance or monitor a single script The test results can be further used outside Zend Platform as they can be printed or sent by e mail Since testing may take a while to run it is suggested that you choose only the most recently added files You may select as many files as you wish nonetheless this will increase the duration of the test Prior to running the Compression Test and in order to ensure accurate results you may want to add query strings to the script path entries When running Performance Tests query strings can only be added to cached scripts to check for performance gain 89 Zend Platform i5 OS User Guide Analyze Site Benchmark Benchmark Web applications To Benchmark Web applications Go to Performance Testing and select the Test URL Tab To test a script follow these steps 1 Click Test URL and type the full path of the script To select a previously tested URL click Show History By default URLs are tested using GET variables defined in the query string 2 Press Add variables to URL to add the variable Name and Value to test URLs using specific SESSIO
153. pparent the code is performing as it should and the Event Triggers are calibrated From this stage on the performance optimization tools can be applied to further enhance Web application performance There are several levels of performance optimization that can be applied to files Caching full page Acceleration and Compression Applying these three settings to your PHP code provides optimal performance boost Optimization Tools Caching Acceleration and Compression The default settings for these optimization tools are as follows e Caching Default setting Off Description Runs code and saves the output on the server e Acceleration Default setting On Description Compiles the Code and saves the compiled code on the server e Compression Default setting Off Description Saves a compressed version of the code on the server To apply these optimization tools to all of the PHP files on the server caching and compression must be activated To activate disable Caching Compression or Acceleration go to Performance Settings and activate the enabling options When to Apply Optimization Tools Now that we have established how to apply the optimization tools to All Files it is important to state that there are different circumstances that require disabling one or more of these features for select directories or files and in some cases altogether The following section describes the possible optimization alternatives that s
154. r PEE CTS a Mere Jo 141 Zend Platform i5 OS User Guide Note that the code to be cached should be wrapped as a single function call see argument 2 in above example this is to improve readability and code reuse the code we want to cache is usually longer en cas lime Display list of destination countries sql SELECT id name FROM countries echo lt P gt Destinations Sdestination_str output_cache_fetch destinations GetQuery sql 3600 Sdestination_arr unserialize destination_str Sout lt P gt Destination Airport lt SELECT NAME destination_airport gt foreach destination arr as destination Sout lt OPTION VALUE Soesti net omn Yall a US US Sdestination name OPTION Sout lt SELECI gt lt P gt echo SO echo lt P gt In the first caching exampl above we cache th list of destinations This is the same for every user and so the cache id is a simple string In the second exampl below the list of airports depends on the user s country So the country_id is added in the ID string This will create a different cache copy for each continent Display list of airports in the user s home country Ssql SELECT id name FROM airports WHERE country Scountry_id Sairports str output cache fetch airports country
155. r s Find section e Severity Level An additional notification is added to severe events e Event Status The Status of the event is indicated for all statuses except Opened e Requested URL The requested URL e Main Filename The URL s main file e Source Info The path to the Source File and line in the code that triggered the event Zend Platform i5 OS User Guide Especially with code related errors this information can provide an immediate indication to the source of the error in the code Trigger Value The script s trigger value runtime output size memory consumption etc e CPU Load The CPU load when the event occurred e Zend Error Error Description Shows the event s error text for code related errors and the type of Custom Events e Aggregate Hint Shows the Aggregate Hint for this event e Associate Zend Error Event Adds a link to an associated Zend error event Event Occurrence Info To prevent an event from being continually reported for the same or similar event PHP Intelligence enforces Aggregation Rules These rules are based on a set of predetermined algorithms that determine which events are identical or are similar to the extent they can be reported as a single Event Aggregation Rules are also aware of events that occur on nodes belonging to a cluster Groups and not just occurrences on a single server node Aggregation information is displayed in event details to identify the number of t
156. r server nodes 35 Zend Platform i5 OS User Guide Tree View The Tree View on the left displays the directories available under a selected document root All the directories are listed by default The list includes filtering options to display directories by file type To filter the list select the file type from the drop down list The filtering options are All Files Cached Files Acceleration Blacklist Files and Compression Blacklist Files To refresh the list of files displayed on the right click a directory s name Tree View Virtual Hosts List The Tree View lists all the directories and files in the default Document Root as well as any Document Root listed in the Vhost List Displaying all the directories and files enables to view files included in the Document Root directly from Zend Platform and select files for Dynamic Content Caching Upon initial setup it is important to verify that all the applicable Virtual Hosts are included in the Virtual Hosts List for two distinct purposes 1 To Benchmark test cached files The Zend Benchmark Performance Testing tests URLs per Virtual Host 2 To update the File View option to reflect all Virtual Host s Document Roots The Tree View option maps all the Server s Document Roots providing a single view for displaying all the available directories and their contained files Adding and deleting a Virtual host should reflect the actual Document Root activity on the
157. r the filter and press Save to add the new filter Use Load Filter each time you want to use a user defined filter eS 28 e Use Remove Filter to delete filters from the Load Filter List The filter section of this screen also includes a search field for searching for a specific Event by ID Zend Platform also allows you to change the table fields displayed on screen Press The Change Table Fields button and select the fields you want to view from the list 68 PHP Intelligence Working with the Event List To view the Event List 1 Go to PHP Intelligence Event List 2 Select the Filter By option you wish to apply to the table e Filter operations appear as follows Events From Filter Events according to grouping definitions These definitions list events according to where they were generated in the PHP Database or what type of event slow response error The values are All Bandwidth Other Web server Other PHP Slow Response PHP Error PHP Other Database Slow Response Database Error Event Types Filter Events displayed in the table according to event type The values are All Slow Script Execution absolute Slow Script Execution relative PHP Error Function Error Slow Function Execution Excess Memory Usage Database Error CPU Load Inconsistent Output Size Custom Events Virtual Hosts View Event information for either All hosts or selected hosts Click Selected to open the Change Virtu
158. raries When a PHP application calls a Java object over the Java Bridge a proxy for that object is created in PHP In the diagram the Java object is represented as a dark square the proxy for that object in PHP is shown as a light square 104 Java Bridge J 2EE Application Server The J 2EE Application Server in its more advanced configuration allows you to create a PHP Java Bridge between a Zend Platform Node and an external J 2EE Application Server This type of configuration is typical of companies that have existing Java based infrastructure The J2EE Application Server operates as follow 1 A PHP application can call a J ava object from a Java library external to Zend Platform 2 TheJava side Bridge component communicates with the J2EE Server It finds objects in the J2EE Server for example an EJB The entire process is Java based 3 The PHP application then calls the J ava object over the J ava Bridge created between the two Platform bridging components 4 A proxy for that object is created in PHP In the diagram the Java object is represented as a dark square the proxy for that object in PHP is shown as a light square The complete integration of Java and PHP is described in the following diagram Legacy J2EE Biz Logic Server PHP ea JB al ZPS ZDS d H Java Bridge Zend Monitor E Ly Java Bridge Java Runtime 4 p gem Internet Co nfigurat ion Settings and Even
159. rates the button triggered Partial Page Caching technique lt form action clean_cache php gt lt input type submit value Clear Cache gt lt form gt The action attribute points to the clean_cache php script Therefore when the user submits the form clean_cache php is executed 144 Tutorials The clean_cache php file is the same as the one that we put in the Cron Job example see next chapter it clears the cache with output_cache_remove and then builds it again With fopen http So we get a real cache refresh This tutorial details Action Based Partial Page Caching with conditional or button oriented options 145 Chapter 8 Appendixes Zend Platform i5 OS User Guide Appendix A Configuration Check List This Check List details all the Zend Platform configuration tasks in chronological order This list can be printed and used as an extra aid for setting up Zend Platform d 148 Configure Clusters and Groups when working in a cluster environment to enable event aggregation over multiple servers Zend Central Server Status Manage Cluster or use the Zend Central Shortcut Zend Central Console Manage Cluster Event Triggers to modify default settings to suit the new environment PHP Intelligence Event Triggers Or use the shortcut Zend Central Console Event Triggers Configure Action Rules to send Event Details data by e mail or to a URL Zend Central Console Config
160. re that encourages communication between the different teams Creating Events Event generation is an out of the box feature Directly after installation Zend Platform s PHP Intelligence will begin to monitor events according to Default Settings To further enhance the effectiveness of PHP Intelligence events thresholds can be customized In a similar manner thresholds can be gradually modified to not only reflect improvements in performance but also to verify that problematic issues have been resolved Configuring Events Events can be configured according to each environment s specific requirements The main configuration changes that should be done are to do with tuning Event Trigger values and defining a list of Functions and PHP errors to be monitored To Configure Event Triggers go to PHP Intelligence Event Triggers and change the default settings according to your requirements A help button appears next to each Event Type Pressing this button will display a description of the selected Event and the Event s parameters Alternately go to Choosing and Defining Event Triggers Disabling Events Triggers In some cases there may be Events that are either not applicable to your system or unnecessary Events are disabled from the PHP Intelligence module When an event is disabled the event will not be monitored and no event information will be stored Disable Event Triggers To disable Event Triggers go to PHP Intelligenc
161. roblem Resolution Lifecycle Using Zend Platform in your working environment ensures that pertinent and focused information reaches the right person at the right time The enhanced information exchange results in major improvements in quality of code time to production and overall performance and stability The subsequent benefit is more resources dedicated to activities focused on improving and expanding the current application and less time spent on locating information necessary for recreating and resolving code and performance issues In the Problem Resolution Lifecycle PHP Intelligence assists the efforts of the development testing and IT teams to quickly pinpoint analyze and resolve issues such as PHP Slow Script Execution Function Errors Database Errors etc Zend Platform Problem Resolution Lifecycle Pinpoint Analyze Resolve Action Rules Event Reports 0 gt Zend Studio Zend Central Full Problem Context Integration Time Encapsulation Debug Profile Deploy Figure 26 Problem Resolution Workflow Zend Platform s PHP Intelligence functionality is enhanced by e Implementing customized Event Rules to areas prone to problems in your unique environment facilitating focused and efficient problem resolution e Analyzing Full Problem Context grants a detailed insight of problematic occurrences e Integrating with Zend Studio to resolve problems with state of the art development and debugging tools 62 P
162. rver Name 66 dda 12 SESSION iia daunted Gegen eeh 41 GAZA aA EO 22 REENEN eege aide Eeen 68 Severity Level 72 Show Source Code 72 silence operator cece eee ee eee e eee eae 22 JE EE 22 SIMULATION ui a 101 Site Analysis ice eege e reen graman 90 Site Analysis Report 90 slow function sssssen mn 21 Slow Function Execution ssssssseess 23 Slow Ouerm nmm nn nn 26 Slow Query Execution sssssses 23 26 Slow Script Execution sess 21 source Code 72 Source Info crecer ete a ed Re eas 72 lte ee 12 e a 107 Statistics 107 Status c ee ruta dro 68 72 107 SLOP ands tata ima Du RARO ETUR daba ets EX eins ERR ER 107 Submit a report to a Specified URL 29 supported databases a asssssssrsrsrereresraa 26 SUPP ESS Lm 21 T tal ore 66 TEST EE 101 Test Download 101 Test Report ausweisen ht ehe 101 Test Results 90 101 161 Zend Platform i5 OS User Guide TESEUR WEE 72 TeStif19 ici le 90 101 Tirne FilEer 11 eiii cines 68 Uri EMT Tr T 72 Tree VieW nerien TE 35 U Undo it fe ans este olle 35 Ungrouped tede aaa 66 Jazeera 45 Update EU Ele A eaten 35 Update the BISG eee enes 47 UL mr 29 101 III Bm 54 User Management 54 57 User Name zeegt ie deg bra 55 US Sut ER 55 V Variables i ihn ERAS 41 72 ala ne nene nnne nnn 72 162 View Tree By feld 53 Virtual Hoer 68 Virtual ala 35 Virtual Hosts Ust 35 W Emacs 22 Watched Functions
163. rver process which allows it to efficiently process Java requests It adds stability and reliability to the PHP J ava connection Unlike a standard PHP J ava connector it uses a single J ava virtual machine for all the requests which makes memory and processor requirements significantly more modest while improving scalability The diagram below illustrates Zend Platform s Java Bridge technology Zend Platform Node J2EE Application Server ET EEE as Java Based Communication Business Logic AAA Legacy etc Proxy for Java Object Java Object Figure 39 Java Bridge Process Level The J ava Bridge Process Level diagram illustrates the following Zend Platform Node Zend Platform Nodes include two bridging components the PHP side Bridge and the Java side Bridge Zend Platform Nodes operate as follows 1 AJVM Java Virtual Machine is installed first before installing the Platform Node on the machine that is to be set up with Zend Platform For the Java Bridge to function you must install a compatible version of JVM Platform will find the compatible version automatically Supported versions are SUN J2SE 1 4 or SUN J2SE1 5 J2SE 5 2 Zend Platform then installs the two components required the PHP side and the Java side to create the Java Bridge 3 A PHP application can call a Java object from any Java library that resides on the Node For example JVM can be downloaded with all its component lib
164. s where it is impractical or impossible to cache the entire output A separate tutorial has been included at the end of this guide to present Partial Page Content Caching functions and concepts Please refer to the Tutorial Partial and Preemptive Page Caching There are two caching conditions that can be applied to files e Default Full Page Content Caching settings can be applied to all files marked as cached in Performance Settings and going to the Dynamic Content Caching section of the settings screen e Specific Full Page Content Caching configurations can be applied to specific files by going to Performance File View Full Page Content Caching Default Full Page Content Caching settings are applied to all files marked as cached in Performance Settings and go to the Dynamic Content Caching section of the Settings screen The content caching options are as follows e Dynamic Content Settings e Default Caching Conditions e Default Dynamic Caching Condition Parameters Dynamic Content Caching Current Settings New Settings Oynamic Caching Enabled On On O on Maximum Cache Size 671 MB 671 M8 Minimum Free Diskspace 2133 MB 2133 ma Maximum Cached File Size 300 KB 500 al KR Default Cache Lifetime 360 Seconds 350 Seconds Default Dynamic Caching Conditions GET yyy Change Default Conditions Figure 17 Dynamic Content Caching Settings 41 Zend Platform i5 OS User Guide Dynamic Content Settings The l
165. sable byterange Description Disable handling byte range requests all requests would return entire file Zds mmap chunk Memory chunk to map when serving file in K Bigger chunks imply higher memory usage by ZDS zds nice Description Priority of ZDS server process Higher number means lower priority zds child max Description Maximum number of ZDS sub processes zds poll_ delay Description Delay between poll invocations in order to enable other processes to run better zds uid UID of the ZDS file server 129 Chapter 7 Tutorials IN THIS CHAPTER INTEGRATING EXISTING AND LEGACY APPLICATIONS CALLING AN EJ B ON WEBSPHERE FROM PHP PARTIAL AND PREEMPTIVE PAGE CACHING This section of the User Guide is dedicated to tutorials on different subjects Tutorial Feedback Please send us your opinion and suggestions for new tutorials by e mail to documentation zend com Integrating Existing and Legacy Applications This tutorial details the integration of Zend Platform s Event Details screens with other legacy applications Reproducing and resolving bugs one of the most problematic challenges of development is often time consuming and in most cases almost impossible when information is not collected at the time of the occurrence PHP Intelligence is an event driven system that provides real time analysis of PHP applications By enabling you to obtain immediate insight into your PHP applications PHP Intelligence
166. see how to implement the performance lifecycle At the end of this guide you will find a Performance Lifecycle Check List that details the steps to establishing an Optimized Baseline for Web applications The next chapter Implementing the Performance Lifecycle details each of these steps 88 Performance Implementing the Performance Lifecycle The following section provides a detailed instructional overview of performance optimization features and components for implementing the Performance Lifecycle Benchmarking Site Analysis Site Analysis enables to obtain insight into the overall performance of Web applications Benchmark information provides an initial indication of the Web application s current performance This information can be used as a starting point for observing the performance boost gained applying the performance tools Benchmarking measures Web server performance and durability In Zend Platform Benchmarking is achieved through the Testing screen Performance Testing This screen includes three options e lest URL tests a single script running Performance and Compression tests at the same time The test results indicate the script improvements achieved by Code Acceleration Dynamic Content Caching and File Compression e Analyze Site tests performance for the entire Web application running the Performance test separate from the Compression test The test results indicate the overall script impr
167. server l e if you add remove a document root from the server you should add remove its respective Virtual Host from the list The initial installation process creates a default Virtual Host list however this may not include all the required virtual hosts and some may need to be added removed Updating the Virtual Hosts List In order for Platform Performance to display files residing in a particular Document Root you must add the Virtual Host to the list The Virtual Host list in the File View reflects the current Virtual Host list as defined in Manage Cluster You can update the list directly from the File View 36 Configuring Zend Platform To Add or Remove a Document Root Go to Performance Settings and select Update Virtual Hosts to open the Virtual Hosts list i 5 Add Remove Virtual Hosts 2 Mele Add or Remove Virtual Hosts that are recognized by Zend Platform HTTP HTTPS Vhost Name Port Virtual Host Address sl BD Document Root Path Add Vhost Document Root http d gollum 80 home root site Lg Figure 14 Update Virtual Hosts List This screen includes two sections e Update Virtual Hosts List add a Virtual Host e Current Settings Remove a Virtual Host and view current virtual hosts on the server Make sure that all the necessary Virtual Hosts are displayed in this list if not use Update Virtual Host to modify the list as necessary To up
168. several ways 46 Deactivate compression entirely should be done if the server is set to handle compression to prevent compressing files twice and rendering them unusable or when using PHP s compression feature zlib Setting compression to cached files only should be done when there is a large quantity of cached files and the rest of the files do not require compression Blacklist selectively disable compression for files do not require compression such as pictures that are already compressed or small files that do not require compression Files under 1k are not compresses at all Configuring Zend Platform Blacklists The Blacklist separates acceleration and compression settings for files With the blacklist users can prevent files from being accelerated or compressed The blacklist is accessed from Performance File View and pressing the Update Blacklist Files button Update Blacklists LE Welw Update the Blacklists Don t Don t File N e Accelerate Compress Select all O O O O zde_add_description_bug php O O O O zde bug bad replace count php var dump php Current Blacklists Files Files which are Not Accelerated fhome root site zde bugs php Files which are Not Compressed home root site zde pofiler bug php Close Figure 20 Update Blacklists Dialog This dialog has two distinct sections 1 Update the Blacklist for defining blacklist criteria for selected files 2 Current B
169. sk Description Min disk space to leave free for content cache in M or 96 zend accelerator php extensions Description List of extensions to consider for content cache when directory is configured zend accelerator user blacklist filename Description Path for a file that contains a list of files not to accelerate zend accelerator compress blacklist filename Description Path for a file that contains a list of files not to compress zend accelerator compression Description Enable compression for content cached files zend accelerator compress all Description Enable compression for accelerated files zend accelerator enabled Description Enable acceleration zend accelerator output cache enabled Description Enable content caching zend accelerator max accelerated files 123 Zend Platform i5 OS User Guide Description Maximum number of keys scripts in accelerator hash table zend accelerator mmap base file Description Windows location of map address file zend_accelerator httpd_uid Description UID of the httpd process zend_accelerator memory_consumption Description Accelerator shared memory block size Mbytes zend_accelerator allow_noshm Description Allow running in no shared memory mode CGI CLI zend_accelerator output_cache_config Description Content cache configuration file zend accelerator output cache dir Description Content cache storage directory zend accelerator use cwd
170. ss of gaining a performance boost by eliminating the code compilation time Once PHP code is compiled for the first time it is saved in the server s memory Each time the code is called the pre compiled version is used instead of incurring a compilation lag each time the code is used Acceleration should not be confused with Caching Acceleration saves the compiled script in the server s memory whereas Caching saves the script s output in the server s memory When Should Files be Accelerated The general recommendation is to always use Code Acceleration to boost Web application performance Therefore the default setting for Acceleration is set to On When Not to Accelerate Blacklist There are some instances where it is preferable to disable acceleration for select files Acceleration is disabled by means of a Blacklist Files should be added to the blacklist under the following conditions e Directories containing files that are larger than the Accelerators memory allocation or containing more files than the allocated quantity of files e Large files that have high memory consumption e Files that have long execution time makes the compilation save irrelevant Increasing Accelerator Memory Allocation The alternative to blacklisting files is to increase the Accelerator memory allocation The accelerator settings can be changed to increase allocated memory and the maximum quantity of files that can be accelerated This alternative d
171. st results appear below after running a test or displaying the last test results Running a Test 1 Type in the URL you want to test The default test is a PHP script which uses zend_send_file to send a 300K zip file Testing very large files will take a very long time 2 Choose the bandwidth limit you want to simulate for the clients For a faster test select a higher bandwidth You cannot choose full bandwidth because your network card will be saturated making the test irrelevant The test tries to simulate a typical Internet server that has clients connected either by ISDN or DSL Zend Platform i5 OS User Guide 3 Enter the number of maximum clients that your server can handle Use the precise value by checking the value of the MaxClients directive in your server s configuration file The ZDS tries to identify your MaxClients value in the installation process via the httpd conf file which is the GUI s default value However this value can be changed after the installation and should be double checked Using an inaccurate MaxClients value may not present accurate results 4 Click Run Understanding Test Results Once the tests have completed you will see two tables and graphs with results that show Requests per Second and Average Time per Request for each test run al Show Lert Download Test Report Test Results For http zea4d t om zns zend Zend Download Server Test Report URL size Clients
172. such as Connection errors Database selection errors General database function errors These events do not require any additional configurations to the database They can be used in production to delineate between a PHP problem and a database problem Database Errors can prove to be invaluable to an organization as they provide insight into the Database reliability along with a different perspective on problems view outside problems through the eyes of PHP Issues like these used to be difficult to reproduce however with the complete audit trail and full problem context Database Errors can be easily reproduced to a level of accuracy that mirrors the actual time of occurrence Description Generates an event whenever a database related function fails This event is directly associated to the Function Error event and is activated and defined in correlation with this event type Database functions that should be reported are defined or deleted from the Function Error functions list To view supported databases see the database related function prefixes listed in lt install_dir gt lib db_functions txt or in windows lt install_dir gt lib db_ functions txt 25 Zend Platform i5 OS User Guide Slow Query Execution Slow Query Execution events are used to identify slow queries that are related to database performance that can directly impact the Web server s performance Slow queries if not pinpointed can bring
173. system resources every time we refresh the cache Instead we can adopt a more efficient approach refreshing the cache based on an action for instance every time a member goes online or logs out How do we do this There are two Partial Page Cache options based on an action 1 Conditional Partial Page Caching 2 Button Based Partial Page Caching Conditional Partial Page Caching Se option we predetermine conditions for caching and invalidating If X occurs then o Y For example we can cache our list of people who are Currently Online based on their log on action Whenever someone logs on his or her name will be added to the cache Subsequently when the same person logs off we could set another condition will remove the name from the cache The following code example demonstrates how to empty the cache when a certain action occurs if check some condition output cache remove key Button Based Partial Page Caching With this option we set a specific button to initiate refreshing the Cache Pressing button X does Y For example we can cache our list of people who are Currently Online based on a specific button that the person logging in will press such as login next go etc Whenever someone presses the button his or her name will be added to the cache Subsequently when the same person presses a different button his or her name will be removed from the cache The following example demonst
174. t Description This event type enables the generation of an event on occurrences that are not necessarily built in Zend Platform events error and performance issues Custom events are used whenever you decide that it is significant to generate an event in a certain situation Each event type is given a name for easy identification type Function Usage monitor_custom_event string class string text integer severe mixed user_data Parameters e class helps to define several types of custom events This description will be showed in the Event List and in the Event Details e text error text used to describe the reason for the event This text will appear in the Event Details e Ssevere the severity level of the triggered event default value is Severe e user data adds a PHP variable that will be viewed in the Event Details in Event Context gt Variables gt User Defined This forms the stored event data similar to the information obtained in a PHP error event Aggregation takes place for these events when two events occur in the same place and have the same class text sever ity Action Rules defined for these events should be set to send to URL rather than sending by e mail as there is only one definition for these events and event reports sent to a URL can be easily forwarded elsewhere This is to prevent the overloading of e mail If we use the e mail action for every custom event e mail
175. t This API is used when there are events that require the location in the script for diagnosing the reason behind the event occurring For example Global Events require the application that generated the event Adding the Hint API can assist in the identification process This string that is supplied by the user to differentiate between pages that have the same URL but different parameters e Return Values If the user did not supply a hint the default hint is an empty string e Parameters hint monitor_custom_ event void monitor_custom_event string class string text integer severe mixed user_data e Description Custom Events are used to generate an event whenever the API function monitor_custom_event is called from the PHP script This event type enables the generation of an event on occurrences that are not necessarily built in Zend Platform events error and performance issues Custom Events are used whenever you decide that it is significant to generate an event in a certain situation Each event type is given a name for easy identification type e Parameters class helps to define several types of custom events This description will be showed in the PHP Intelligence Event List and in the Event Details report text error text used to describe the reason for the event This text will appear in the Event Details severe the severity level of the triggered event default value is Severe user_data adds a PHP vari
176. t Details a 231 Gees Kees Ge y Load Balancing Administrator Web Browser rre ATE 4 Pl Server Zend Central E Platform Node E EE Platform Nodes Figure 40 Java Bridge System Level The Java Bridge System Level diagram illustrates the following about the network architecture e Zend Platform Nodes In order for a Zend Platform Node to function as a J ava Bridge it must have a properly functioning J ava installation Once J ava is installed Platform installation installs the required components for the Java Bridge some of which are implemented in J ava e 2EE Server The Java based enterprise that adds Zend Platform will have its own application servers A J2EE Server is shown in the diagram as part of the Front Office It can communicate with any of the Platform Nodes that have J ava installed on them and 105 Zend Platform i5 OS User Guide which are defined in Java as legitimate accounts Added Value Zend Platform s Java Bridge supports a PHP J ava integration that benefits enterprises on both the business and technical level Business Level Benefits e Companies with J2EE application servers can begin to realize the advantages PHP offers over other Web enablement languages including shortened development time shortened time to market lower TCO Total Cost of Ownership etc e PHP centric companies can take advantage of J 2EE services that are not present in scripting languages
177. t of each PHP server less servers doing the same job Developers can learn how to integrate with Zend Studio to improve quality by quickly identifying problems and reducing the testing cycle They can also benefit from the PHP J ava Integration Bridge to reuse code by utilizing existing code Chapter 1 Introduction to Zend Platform IN THIS CHAPTER ZEND PLATFORM OVERVIEW ENVIRONMENTS ARCHITECTURE CENTRAL SERVER NODES CENTRAL NODE COMMUNICATION SINGLE POINT OF ACCESS GUI Zend Platform is a complete runtime environment for managing and maintaining mission critical and enterprise PHP applications from a single centralized location This environment consists of cluster management performance management monitoring detection and recovery and J ava integration Zend Platform improves both the end user experience and IT productivity by combining cluster and performance management automated monitoring and detection capabilities and powerful Java Integration capabilities into one integrated environment Zend Platform provides the PHP enabled enterprise with the following benefits e The ability to manage every aspect of PHP from a single Web based interface e The ability to quickly drill down to critical issues to resolve and optimize e The ability to create user defined thresholds and error values e The ability to configure servers from a remote management station and to perform controls at a click of a button e The abil
178. tform will open a new event e Reopen Event Changes the event s status from closed to open 77 Zend Platform i5 OS User Guide Controlling Information Displayed in an Event Zend Platform s User Management settings Zend Central User Management can be utilized to set restrictions per User Group These restrictions can control permissions to view event information and prevent certain User Groups from changing Event Details status The following restrictions can be applied to Event Details information e Delete an event e Ignore an event e Close an event e Reopen an event e See the event internal data in the Event Details e See the event source code in the Event Details e Use the Zend Studio Diagnostics in the Event Details These limitations can prove to be especially useful for the organization For example when working in collaboration with external organizations that should not be permitted to view information such as the source code Another example of the Event Details restrictions is seen when implementing development lifecycle processes that require that certain groups be limited to the actions that they can do with an event such as closing or reopening To find out how to create a User Group go to Configuring Users and User Permissions 78 PHP Intelligence Customizing Events Zend Platform provides several ways for customizing events in order to facilitate different requirements e
179. the server down by e Causing excess web server processes Apache e Hang up queries in the database causing slower responses in the database These events do not require any additional configurations to the database They are used in production to pinpoint performance bottlenecks in the database Description Generates an event whenever database related function execution raises above the given threshold This event is directly associated to the Slow Function Execution event and is activated and defined in correlation with this event type Database functions that should be reported are defined in the Slow Function Execution function list in additional rules To view supported databases see the database related function prefixes listed in lt install_dir gt lib db_functions txt or in windows lt install_dir gt lib db_ functions txt Inconsistent Output Size Inconsistent Output Size events are used to verify that the page is rendering the same output to the client each time If a page is not rendered the same each time this means that some clients are seeing different output than others and some error has occurred This event is used mainly in production to indicate possible usability issues Description Generates an event whenever the output size is below or above the average output that is normally produced The default values for this event type are set to 0 To generate events configure these settings to a value th
180. the test results are incorrect since the changes you made did not take effect In this case restart the server and simulate a typical user session to get valid results Compression T est The Compression test analyzes download time improvement of the popular scripts as the result of Compression 1 Press Run Compression Test 2 Choose the number of scripts to test and press Next 3 To ensure accurate results for the scripts add query strings in the Script Path entries For example site example php varl valuel amp var2 value2 4 Press Run to run the test The Site Analysis Report screen details the results for the Compression test The report shows the Original script size along with the Compressed size and the Compression Improvement rate and the actual compression functionality is not affected 91 Zend Platform i5 OS User Guide If one or more scripts failed the test an indicative message appears on the screen The Compression Test failed since Platform Performance cannot resolve the URL from some script paths or the URL cannot be accessed Note that scripts defined on a virtual host or a symbolic link can cause the test to fail Display Previous Test Results The last Test Results summary is displayed in the Testing environment To display last Test Reports click the Show Last Performance Test Report or Show Last Compression Test Report button The displayed Test Report will be updated as soon as you run another test
181. ther than a complete picture Real world experience indicates that companies are finding more and more applications for the Java Bridge beyond what was initially anticipated Usage Scenarios There are two usage scenarios that describe the most common applications for Zend Platform s PHP ava Bridge e Integration with Existing Java Infrastructure PHP is a fully featured scripting language engineered to cover virtually all of an enterprise s requirements At the same time many enterprises have a long history of application development in Java Platform s Java Bridge enables enterprises to keep on using their Java infrastructure applications databases business logic and various Java servers WebLogic JBoss Oracle Application Server etc e Accessing Java Language and Architecture Some enterprises require the full set of PHP s capabilities yet have a specific need for select Java based applications SIP signaling in the communications industry or J DBC for creating connectivity to SQL databases are two examples of impressive industry specific products Platform s Java Bridge enables enterprises to adopt a PHP standard and to use their preferred Java based applications Activities This section describes two sample activities that indicate some of what you can do with Platform s PHP J ava Bridge In the sample activities it is important to differentiate between Java and J2EE The difference will impact on architecture and
182. to be a user defined function Built in functions will not work with this API This function can get as a parameter the event type by which it was called If there is a PHP function register error handler in the JavaScript events will not be reported To report events call the function monitor pass events in the error handler Global Events should not be changed under any circumstances as they may produce unpredictable results 80 PHP Intelligence Un register Event Handler The un register event handler allows you to un register an event handler The API returns false if it cannot find a handler registered under the supplied name unregister_event_handler register_event_handler Do not add the unregister_event_handler function to the end of scripts if you need to generate memory and script execution Events These event types generate the event only after the script is executed and if unregister_event_handler is added it will stop the event from being generated The event types that should not include unregister_event_handler are as follows e Slow Script Execution Absolute e Slow Script Execution Relative e Inconsistent Output Size 81 Zend Platform i5 OS User Guide Aggregate Hints monitor_set_aggregation_hint page name This API is a global variable that can be set anywhere and in any hierarchy The purpose of this API is to incorporate locations of occurrences in the script This API is used when ther
183. tput cache output string key string function int lifetime e Description If they cache for the key exists output it otherwise capture expression output cache and pass it out e Return Values expression output e Parameters key cache key function PHP expression lifetime data lifetime in cache seconds output cache remove bool output cache remover string filename e Description Removes all the cache data for the given filename e Return Values true if OK false if something went wrong e Parameters filename full script path on local file system output cache remove url bool output cache remove url string url e Description Remove cache data for the script with given URL all dependent data is removed e Return Values true if OK e Parameters url the local url for the script output cache remove key bool output cache remove key string key e Description Remove item from PHP API cache by key e Return Values true if OK e Parameters key cache key as given to output_cache_get output_cache_put output_cache_ put bool output_cache_put string key mixed data e Description Puts data in cache according to the assigned key e Return Values true if OK e Parameters key cache key data cached data must not contain objects or resources output_cache_ get mixed output_cache_get string key int lifetime e Description Gets cached data according to the assigned key e Return Values cached data if cach
184. tring key string code int lifetime output_cache_fetch works in a similar manner to the output caching function output_cache_output The major difference is that instead of caching the output from the function it caches the return value as a string output_cache_fetch receives 3 arguments 1 Unique identifier string for the data string 2 PHP code to be cached string 3 Cache lifetime in seconds integer output_cache_fetch returns a string containing the return value of the cached code section as defined in argument 2 The ID defined in argument 1 serves to differentiate the code section and give it a name Lifetime defined in argument 3 is handled in the same way the Zend Performance module handles cache lifetimes for all cached files cached copies older than the lifetime will be refreshed when the function is called Unlike normal caching only the return value of the given PHP code is cached Usage Example S Function ger content Seine SeSe PU SCC I define an arbitrary function which returns data Sdata array Sdata time Stime Sdata sec sec lau a Pases Susecr E Ezetz em EI ES Siro plas beitia This is where you would generate the data you wish to cache such as making database calls y ser data serialize data 140 Tutorials serialize the array for return return ser_data Stime time get current timestamp Smicro mi
185. trol for multiple nodes Nodes are web servers that run with Apache and service a PHP application The Zend Platform components are installed on the node to report script database and system activity to the Central Server Each node installation also includes a debugger that is integrated with Zend Studio extended code management features such as profiling debugging and correcting code directly on a node In essence similar components are installed on the Central Server and the Nodes since the Central Server also performs as a node However the Central Server and the Node Components employ different modules for their overall activity Introduction to Zend Platform Central Server The Central Server provides the necessary functionality for handling event information node management and performance monitoring No matter how many nodes are registered in the cluster from the users point of view Zend Central provides an efficient and useful single point of entrance Zend Central resides on the Central Server and is in charge of displaying the GUI for the Central Server and Node configuration Zend Central is the main communication component for collecting storing configuring and receiving information from the nodes Communication is carried out via regular TCP IP communication and event information is stored in a dedicated database Zend Central governs the PHP application performance and monitoring features including configurations for nod
186. unction parameters array foreach xml gt function gt args gt arg as Sarg function parameters int arg num string Sarg value insert the function data function name and parameters where th event occured to the db update_event_function_data Sevent_id string xml gt function name Sfunction parameters 133 Zend Platform i5 OS User Guide insert a new event with some genreal info to the db iparam int Sid id of the new event in the ZendPlatform events database param string Stype th vent typ param int timestamp the unix timestamp when the event occured b function insert new event into db S id type timestamp update a specific event function data in the database param int id the event id we want to update param string S function name name of the function where the event occured param array function params array of the function parameters num gt value Vd function update event function data S id S function name function params qu The first part of the example uses a PHP 5 Simple XML extension to parse XML to PHP objects that can be processed with normal property selectors and array iterators The second part extracted data from the event XML data and inserted it into a database As this tutorial demonstrates XML Event Details generated by the PHP Intelligence component of Zend Platform provides Developers and
187. ure Acton Rules Configure Performance to define initial performance settings for Code Acceleration Dynamic Content Caching File Compression and Download optimization Performance Settings Configure Virtual Hosts and fine tune performance setting per file Performance File View Setup integration with Zend Studio Server in Zend Core Establish a persistent connection with Zend Studio for Debugging Profiling and Editing code in Zend Core Configure PHP settings to customize the php ini and zend ini to your environment Use the Zend Central Shortcut Zend Central Console Configure PHP Settings Use the Clone Wizard to apply configurations from one node to other nodes Zend Central Console Clone Wizard Alternatively use the Quick Clone buttons to apply specific performance and PHP Intelligence settings Define User and Group permissions Zend Central User Management Appendixes Appendix B Performance Lifecycle Check List This Check List details all the Zend Platform performance Lifecycle tasks in chronological order This list can be printed and used as an extra aid for calibrating Zend Platform 1 Benchmark Web application to establish optimization starting point Performance Testing Analyze Site Run Performance Tool Calibrate Event rules to configure PHP Intelligence events to the Web application s performance parameters PHP Intelligence Event Triggers Or use the shortcut Zend Central C
188. uring Zend Platform else my_send_file filename Alternate Method zend_send_file can also be set to accept a second argument the mime type of the file This will override the default mime type setting The parameters are zend_send_file string filename string mime_type and it would be called in the following way in your source code if function_exists zend_send_file zend send file path to file wma video my wma type else my_send_file filename If the mime_type is not specified or empty the first mime type mechanism is used Manual Mode Usability Notes Do not create any output in Manual mode before calling zend_send_file neither headers nor body as this will interfere with the HTTP download Once you call zend send file the script terminates so make sure all of your business logic runs before you Call this function Sometimes files that are not under the same document root need to be served Therefore It is recommended to use the full path name to the file you want to serve This will guarantee your script will work even if you move it from your Web server s document root Transparent Mode In Transparent mode the file types that should be downloaded via ZDS are preconfigured by mapping these files in the configuration file of your Web server Files greater than the min_file_size directive will be automatically served by the ZDS To run ZDS in Transparent m
189. uster servicing a single Web application or a collection of clusters servicing different Web applications Zend Platform serves as a single control center for system health information cluster management and runtime process optimization The Zend Platform system diagram below demonstrates where Zend Platform components typically reside in the PHP enabled enterprise Server PHP ZPS ZDS Zend Monitor IV Java Bridge Configuration Settings and Event Details EI PP tb Kass ade Ca A z y dr Internet Aue Y Load Balancing Administrator rie Standalone K I5 i Ew gt sc A A Web Browser Cluster le Server Zend Central B Platform Node EE Platform Nodes Figure 1 Zend Platform System Diagram The system diagram illustrates the following points e Zend Platform s Standalone Cluster Server is installed on a Web server e The System Administrator controls all Platform Central functions Providing the ability to work with Platform from a single workstation using a standard Web Browser e Nodes host resident PHP based services that fill requests from the Web e Load Balancing directs requests to available servers in the web farm Introduction to Zend Platform Platform Server and the Platform nodes are separate entities therefore it is important that firewall and security devices be configured to allow communication between the nodes and the Platform Server Identify which ports
190. ver The Zend Download Server is a PHP Zend Engine plug in which efficiently deals with serving large downloads such as videos e g mpeg files binary products such as exe and msi files and any other large files which are served over the HTTP protocol How it works The Zend Download Server supports two modes of operation both of which can be used together or separately according to your needs e Manual mode The download is initiated by a PHP script using one simple PHP API function call Not only does it allow you to serve files which aren t under your web server s document root but also it allows you to run logic such as access restriction checks before the download is started e Transparent mode In your web server s configuration file you map the files you want to be sent through the efficient downloading mechanism to PHP and the Zend Download Server will jump into action automatically and serve them The Download Server is currently not applicable for Windows Operating Systems Performance Lifecycle Maintaining Web applications at optimal performance levels is a necessary requirement for ensuring customer satisfaction and organizational efficiency Zend Platform s Performance module provides tools for optimizing Web application performance by employing a detailed 86 Performance performance enhancement method the Performance Lifecycle The Performance Lifecycle is a process of calibrating Zend Platform to provid
191. ver key Description Filename for local SSL key zend monitor server cert Description Filename for local SSL certificate zend monitor collector cert Description Filename for central SSL certificate zend monitor enable Description Monitoring is enabled zend monitor error level Description Errors reported as events zend monitor error level severe Description Errors reported as severe events zend monitor silence level Description If 1 does not report errors when error reporting is 0 If 2 doesn t report errors only if is used zend monitor max script runtime load cutoff Description Load value which would suppress time related events zend monitor report variables data Description Which variables to report zend monitor max script runtime Description Script runtime above which event is produced ms zend monitor max function runtime Description Function runtime above which event is produced ms zend monitor max memory usage Description Memory usage above which event is produced K zend monitor max load Description Load above which event is produced 125 Zend Platform i5 OS User Guide zend monitor max script runtime severe Description Script runtime above which severe event is produced ms zend monitor max function runtime severe Description Function runtime above which severe event is produced ms zend monitor max memory usage severe Description Memory usage
192. vers cocccccncnnnnnnonnnnnn nan nrn rr nn Add Edit Users eee eee Adding a Server ccecce Additional Rule 21 aggregate Events Aggregate Hint sss Aggregate Hints Aggregate serverg ssrrrrrrrrrrrrrrrrrrrrre Aggregation assez Aggregation Rules assez Alert Ua Alert WINdOW nmm Alea ias SUE SEAN All66 AMES ua GA Ba gane AEE Always Report Errors ssssss Analyze Gite O mas tx bU un CACHING E lays 41 caching conditions 35 41 Sie WEE 35 Central Genver ee eeeeneeneeaeeaes 12 ET REN 35 aA 53 Clone galaia aiala E 12 53 Clone Gettings esse eee eeea teeta ees 53 Clone Wizard 00 cee ececeeee eee eee eee eeeeaeeateaeeaes 53 Close Event 72 Close Gelected ee eeeeaeeeeaeas 68 CUSCO dera EZ SGAE EEE NEE EEEa EE 12 compressed EA 35 45 eela 35 45 47 Compression Blackltet teens 47 Compression Blacklist Files 35 Compression Test 90 Compression Test results 90 concurrent Jobs 101 Concurrent RequUeStS ceea 101 alau galdea 35 Configure Alert Rules assez 16 Confirm Password 55 Connection gua 25 CONTE finders a lia 41 Cool aaa 41 SARA 21 CPU LO AG Less caa diodes 72 create a New Group 57 edale balada 27 Current Blacklisted SU 47 Current Existing Users eens eee 54 Custom events 28 72 D daemon ANE 107 Database cose REO ge NEEN 26 66 database deanup 68 Database Error 25 database function errore suus 25 Database selection errors 25 data
193. will be transferred un zipped To Define Compression Settings Go to Performance Settings and go to the File Compression section of the settings screen Select the file compression option that reflects your requirements 2 File Compression Current Settings New Settings Compress Files None None O Only cached files O All files Figure 19 File Compression Settings File Compression Options are as follows e None File outputs are sent to the browser as is e Only Cached Files Only the cached files are transferred to the browser in a gzip format if the browser supports the format If not the data will be transferred un zipped e All Files Both accelerated and cached files are transferred to the browser in a gzip format if the browser supports the format If not the data will be transferred un zipped Recommended The recommended compression option is Only Cached Files since the compression capabilities make use of the Dynamic Content Caching and there is no extra overhead for generating the compressed file except for the very first time the URL is accessed Compressing accelerated files may cause some overhead and affect the overall performance Use All Files if your main concern is improving the download time for the user There are some instances where it is preferable to deactivate compression for select files 45 Zend Platform i5 OS User Guide Compression can be deactivated in
194. ws users to configure and change Event Triggers from the Event Triggers screen e Configure and change the PHP settings Allows users to configure and change PHP settings from the Configure PHP Settings screen e Go into the Performance section of nodes Allows users to access the Performance Tab for nodes e Go in the Java Bridge section of nodes Allows users to access the Java Bridge Tab for nodes 58 Configuring Zend Platform User Settings User settings are retained in the system in several ways e User Group settings that are stored in the configuration database e Zend Central User Management Tab remembers each user s last settings The user s last settings automatically populate the component fields when opening any of the sub screens and dialog boxes that make up the User Management Tab This completes the Configuration chapter of the User Guide In this section we have described the different configuration tasks that can be done In the next chapter we will describe how to implement Zend Platform in the working environment by using PHP Intelligence to create a Problem Resolution lifecycle Please refer to Appendix B Configuration Check List to read print the Zend Platform Configuration Check List that summarizes the configuration tasks 59 Chapter 3 PHP Intelligence IN THIS CHAPTER THE PROBLEM RESOLUTION LIFECYCLE CREATING EVENTS FINDING EVENTS THAT INTEREST YOU UNDERSTANDING EVENT DETAILS
Download Pdf Manuals
Related Search
Related Contents
Internet and Data Connectivity Using Optical Fiber and RF Signal SWITCH 100 BLACK RAPIDTM ETHERNET RÁPIDA DE 5 PORTAS Marmitek SC9000 Fujitsu Bay Projector CPE BitStorm 6210-A1 Guia do Usuario Magnavox 17MD255V Flat Panel Television User Manual Montageanleitung ECOSOL USER MANUAL E200BT AOC m2460Phu Copyright © All rights reserved.
Failed to retrieve file