IBM is shipping Zend Server with V7.1. For you, that means enhancements in configuration, performance, code-tracing, and more.
If you've been keeping up with the evolution of PHP on the IBM i, you may have heard rumors about a new PHP server from Zend. If you've really been staying current, you may have already downloaded and installed a beta version (I did!). If not, you're in for a real treat. Included with release 7.1 of IBM i is the new Zend Server 5 for IBM i. This updated product has many advantages over Zend Core and Platform, not the least of which is the fact that Zend has taken two licensed products and combined them into a single licensed product. But I'm getting ahead of myself.
What's the Big Deal?
When I heard about the development of Zend Server, my first thought was "What's the big deal?" Zend Core is working just fine for me, so why mess with a good thing? Boy, was I wrong!
To begin with, Zend Core (and Platform) had some configuration challenges. If you were not an expert on Apache configuration before you started using Zend Core, you probably became one in relatively short order. With Zend Core, you had to deal with not one but two Apache servers. One of the first things that turned me into a Zend Server evangelist was the fact that the Zend and IBM development team got rid of the need for the Apache server in PASE. The IBM developers created the FastCGI, which made all this possible. All future releases of Zend Server for IBM i will be leveraging the FastCGI interface. So now Zend Server only uses the IBM HTTP Server powered by Apache, and now you have only one server to configure and maintain. Just between you and me, if this had been the only change they made, it still would have been worth making the switch.
Figure 1: Zend Server uses the IBM HTTP Server powered by Apache.
Fortunately, Zend and IBM were more ambitious than that. They also implemented a new administration control interface that is now consistent across all platforms. This is a big plus for IBM i folks because now your Zend Server skill set is transferrable to Linux and Windows. The new administration display includes a Restart PHP button, which resolves the issue of needing to jump back to green-screen mode to stop and start Zend Core when you're using the GUI interface for configuration.
Speaking of getting started, did I mention that Zend Server can be installed right alongside your existing Zend Core? Yep, it sure can. The default setting for Zend Server is to listen on port 10088. This will allow you to load and test Zend Server without disturbing any existing applications you're running using Zend Core. The only drawback is that it is not recommended that you run both Zend Core and Zend Server at the same time. The results can be a bit unpredictable. So you can load Zend Server and test your current applications, and when you're satisfied that everything is working correctly in the new environment, you can switch to using Zend Server just by changing it to use port 80.
But there are lots more improvements, so let's move on.
What About Performance?
One of the more interesting improvements is in the area of performance. Just the "basic PHP" performance enhancements included in Zend Server are providing between 30 percent and 600 percent better performance, depending on your application. In my own testing of Zend Server, I was getting about 40 percent faster response times on average and nearly 100 percent faster response in my Zend Framework applications. These performance enhancements (known as Optimizer+) are bundled in the Community Edition of Zend Server, so everyone can use them.
Additional performance improvements in the subscription version include data caching and page caching. The data caching feature provides access to a set of API functions for caching data. This allows you, as the developer, to cache query results to a shared memory area to improve performance on repeated access. The page caching feature allows you to cache entire pages in cases where the content doesn't change often. All the page caching is set up in the Zend Server administration interface; you don't have to change any code. It's a rules-based setup that will allow you to use a regular expression to determine which pages are cached. This is one of the areas where you can see some of the higher-end performance improvement up in the 400 percent to 600 percent range.
For Developers Only
The monitoring feature available in Zend Platform has been enhanced and included in Zend Server. It still has all of the original functionality (e.g., monitoring for PHP errors, failing DB queries, high memory consumption, failing functions, slow request executions, etc.). However, the UI has been modified to be more user-friendly. Most of the changes here were based on user feedback regarding the Platform version.
Figure 2: The new monitoring dashboard is so much more user-friendly! (Click image to enlarge.)
A feature new to Zend Server is code-tracing. As an IBM i developer, you're probably very used to code-tracing because it's been on IBM i for a long time. This is much the same but with some really helpful enhancements. Using code-tracing can eliminate the need to reproduce a problem. By setting up the code trace to start executing when a specific event takes place, you can capture the information you need to be able to debug an issue as it happens! Code-tracing captures the entire execution flow, including all of the following:
- Output and header generation
- Function argument and return parameters
- Execution tree, including function calls and include files
- Execution time and memory usage for each node
- Location of errors, exceptions, and Zend Monitor events
As all of us know, reproducing an error that occurs in a production environment can be particularly difficult. Properly used, code trace can make it unnecessary. Am I the only one who thinks that's awesome?
By opening a trace file, you have the ability to "play back" the sequence of events that led to an error. You have two views available to assist you in doing this. The first is the tree perspective, which allows you to view function-execution flow and examine events leading up to an error. The second view is the statistics perspective. In this display, you can review the execution time, memory consumption, and total number of calls for the functions in your application. You can view the execution time in an aggregated fashion for the entire application or view the details, broken down by each function execution. The same goes for the memory consumption; you can view overall or by function execution. It's easy to see how this could really speed up problem diagnosis and correction time.
If you ask longtime IBM i developers what the one thing is that separates IBM i job-handling from that of Linux or Windows, odds are you'll get the same answer from all of them: job queues. Frankly, I don't understand how Windows and Linux get by without job queues…but that's another story. Well, now with Zend Server, you have access to that same functionality for your PHP scripts. You can schedule jobs to be run at a certain time, similar to the IBM i job scheduler. Also, from within a PHP process, you can use an API to spawn another process that will execute in a separate execution queue and therefore not delay the execution of the current script. This process does not use the job queues on your IBM i; it uses job queues within Zend Server. You can still call a PHP process via the IBM i job queues, but by using the new job queue functionality in Zend Server, you get the ability to use the event-logging and code-tracing functions to determine whether the PHP script completed or threw an error. Again, good information to have if something goes awry. Other capabilities included in the job queue feature include the following:
- Managing job priorities
- Handling job dependencies
- Checking job status and queue statistics
- Suspending/resuming recurring jobs and queues (e.g., hold a job and release it)
- Managing failure-handling and retry control
- Querying for jobs
- Passing custom HTTP headers
- Managing and balancing loads (not really applicable to IBM i environment)
Other Differences from Zend Core/Platform
A few other differences between Zend Server and Zend Core/Platform are definitely worth mentioning.
The Java Bridge, which was available previously only in the "for charge" version of Platform is now available in the free Community Edition of Zend Server. I am always happy to get more free stuff.
The version of MySQL available to be installed with Zend Server supports the DB2 Storage Engine. If you are unfamiliar with the MySQL database support for DB2, you can find more information at the MySQL Web site. I've seen the DB2 storage engine in action, and it's pretty exciting. If you haven't looked into this, I encourage you to take a few minutes to do so.
Lastly, Zend has also included phpMyAdmin in the Zend Server installation to help you administer your MySQL tables. I have been using phpMyAdmin for years (GoDaddy.com provides it as a way for their domain host accounts to administer MySQL tables) and look forward to using it on IBM i.
So How Is Zend Server Different for IBM i?
The IBM i is a different sort of beast compared to a Linux or Windows server. For this reason, there are some omissions in the version of Zend Server for IBM i:
- Clustering—Clustering is not supported on IBM i. This decision was made because IBM i shops scale vertically. Clustering is meant to allow Intel-based solutions to scale horizontally.
- Server Replicating—Again, since IBM i shops scale vertically, this feature is unnecessary.
- Download Server—Most IBM i applications are transaction-based. There is little need for downloads.
Personally, I agree with the logic in excluding these functions from the IBM i implementation of Zend Server, with the possible exception of the last one. While I can think of several situations where having a download server would be useful if not completely necessary, I agree with the statement that most IBM i applications are transactional in nature, so there is very limited need for a download server.
So now that you are all chomping at the bit to start using Zend Server, I've saved the best for last. As of April 12, 2010, Zend Server 5 for IBM i is no longer in beta and is generally available. You can now go to the Zend Web site and download the general release version of Zend Server 5 for IBM i. There are several download files and options for installing it. Read the release notes carefully and note that you will need to uninstall any installed beta version before installing the general release version. The general release version includes a Windows installer if you want to go that route. If not, the install is still very simple, using FTP and save files (*SAVF). Enjoy!