Collaboration at COMMON

The 2015 COMMON annual meeting and expo, now in its first day, is helping speakers and attendees create innovation through IBM i integration: open source, closed source, IBM and vendor solutions. For example, of my six presentations during this conference, two are collaborations:

The Art of Performance Diagnostics, with IBM’s Dawn May, allows us to show, among other topics, how IBM i’s integrated performance tools complement green-screen tools and third-party tools (in this case, Zend Server) to pinpoint and solve performance issues (here, PHP-and DB2-based applications).

PHP Tricks for RPG Developers, a talk jointly created by RPG and SQL expert Birgitta Hauser and me, combines RPG, PHP, and DB2, allowing RPG to achieve graphical (charts and graphs, PDF and Excel files) and internet (json-based web services, flexible email) functionality using native functions.

Conferences such as COMMON serve a need that’s difficult to replicate back at the office—brainstorming and sharing possibilities among interdisciplinary peers, or sitting side-by-side with like-minded colleagues who work for different employers, to try something new. This week, for example, some of us plan to share knowledge on compiling binaries in PASE and to further the potential of open source on IBM i. I’m looking forward to presenting my talks (both joint and solo) and helping to realize new ideas with forward-looking colleagues during the conference.

Birgitta Hauser and Alan Seiden collaborate on their talk at COMMON 2015

Birgitta Hauser and Alan Seiden collaborate on their talk at COMMON 2015

Free webinars sponsored by COMMON Europe (open to all)

Starting January 27, 2015, I’ll be giving three free Tuesday webinars:

  • January 27: Strategic Modernization with PHP
  • February 17: Bring RPG/COBOL business logic to the web with the PHP Toolkit
  • March 10: Speedy PHP on IBM i

All three one-hour webinars will be held at 14:00 Central European Time (CET). That’s 8 AM Eastern Standard Time (EST). The registration page includes a time zone converter.

Details and to register: http://www.data3.se/?p=5287

Thanks to Torbjörn Appehl of Data3 (COMMON Sweden) for organizing these.

Zend Framework 2 performance optimization: it works

Zend Framework 2 (ZF2) provides optimization techniques that are often overlooked by published performance tests. One excellent source for such techniques is a presentation by Gary Hockin. I was thrilled when my client and friend King Harrison IV of K3S began testing the effect of these techniques on his ZF2 application running on IBM i.

King’s initial tests produced a 600ms reduction in load time, obtaining respectable performance for his database-heavy application. He plans to update his blog post with further speed improvements as he implements them.

Read King Harrison IV’s blog post about ZF2 performance improvements.

Performance Tweet chat Monday, online workshop Thursday

Join me for two events this week sponsored by COMMON, a Users Group:

Details on online workshop: http://www.common.org/index.php/webinars.html

PHP Performance on IBM i: Tuesday, Dec. 10 (limited-time discount)

Update: a recording of this class is available at http://iprodeveloper.com/let-your-php-apps-fly-ibm-i-high-performance-php-demand

————-

This Tuesday, learn how to Let Your PHP applications fly on IBM i. Busy? You can attend while getting your work done, with three one-hour class segments separated by breaks.

“Our process now runs 30-50% faster, thanks to one tip from Alan’s presentation.”
—Mike Meszaros, Software Developer, Specialty Pipe & Tube

You’ll learn to quickly improve your application’s performance, including:

  • Give your app that “snap” by optimizing its front end as well as PHP
  • Configure Zend Server for performance
  • Diagnose bottlenecks
  • Leverage unique IBM i performance tools
  • Optimize DB2 and the IBM i toolkit

I’ll be there to answer your questions. What’s more, the presentation will be archived for 60 days so you can review the material afterward.

“Alan is the performance guru of PHP on IBM i. When we encountered unexpectedly slow queries and program calls, Alan showed us a configuration change that helped our application run 3x faster, creating happy users. Thanks, Alan!”
—Adam Chuk Shirley, PHP Developer, Sabel Steel Service

What: PHP on IBM i performance eLearning event
When: Tuesday, December 10, 2013: three one-hour segments with two one-hour breaks, starting 11AM and ending 4PM (ET).
Where: Online
Cost: $150 (but discounted to $99 through Friday, Dec. 6)

Details and registration: http://iprodeveloper.com/let-your-php-apps-fly-ibm-i-high-performance-php

High-performance PHP on IBM i this Tuesday (July 30, 2013)

For the first time, I’m teaching how to Let Your PHP applications fly on IBM i, including how to configure Zend Server for performance, diagnose bottlenecks, leverage unique IBM i performance tools, optimize DB2 and the IBM i toolkit, and improve performance of front-end javascript, style sheets, and the like. You’ll come away with knowledge that you can use immediately to improve your application’s performance.

I’ll be there to answer your questions. What’s more, the presentation will be archived for 60 days so you can review the material afterward.

What: PHP on IBM i performance eLearning event
When: Tuesday, July 30, 2013: three one-hour segments with two one-hour breaks, starting 11AM and ending 4PM (ET).
Where: Online
Cost: $150 (group registrations available)

Details and registration: http://iprodeveloper.com/let-your-php-apps-fly-ibm-i-high-performance-php

Questions: Get in touch with Alan

Other upcoming events from Alan:

August 22, 2013: At NESTU (user group in Fairfield, N.J.): “At ease! Relax your neck-back-shoulders at the keyboard”: A special presentation from Alan to help computer workers (such as all of us) avoid repetitive strain injury and stay poised at work. Fun and unusual.

September 9-11, 2013: COMMON Fall 2013 Conference and Expo in St. Louis, Missouri. The Premier IBM i event. I’m presenting 5 talks on PHP and web performance.

October 7, 2013: Full-day, in-depth PHP on IBM i Performance Workshop, 9:30-4PM (PT) at  ZendCon (the PHP conference). Register for both parts of this tutorial (room 6) for Oct. 7, and the full conference, which goes till Oct. 10, in Santa Clara, California. I’m presenting several talks on PHP for IBM i in addition to the full-day performance tutorial.

Alan’s event page: http://www.seidengroup.com/presentations/upcoming/

 

Web performance webinar today

Hope you can join me for “Web performance first aid,” a webcast for the COMMON user group. The webcast will be recorded and archived for future listenings as well.

The webcast is for COMMON members, so anyone wanting to hear it needs to join COMMON.

I based the presentation on my consulting practice that helps ensure high performance for PHP and Zend Framework applications on IBM i. Good performance is critical for customer acceptance of web sites and mobile applications.

Webcast link: http://www.common.org/index.php/webcasts/upcoming-webcasts.html

Anyone wishing to see just the slides can do that on my site: http://alanseiden.com/presentations and look for “Web performance first aid.”

Zend Framework DB2 adapter for IBM i

I recently received a question about how to use DB2 with Zend Framework on IBM i. Thomas wrote:

I would like to start with Zend Framework on i5 [IBM i] with Zend Server and ZF’s DB2 database adapter. I got this error message:
Qualified object name SYSCOLUMNS not valid. SQLCODE=-5016

I told Thomas about an improved DB2 adapter, optimized for IBM i, that I’d created in cooperation with Zend. Its usage is explained in my presentation, “From Zero to ZF,” on my Presentations page: http://www.seidengroup.com/presentations/.

Thomas wrote back to say this adapter worked perfectly for him, eliminating the error and improving performance. I believe this DB2 adapter (or something similar) will eventually be included with Zend Framework 2.0, but until then, it works well as a custom adapter.

PHP performance tip: disable unused extensions with Zend Server

Whenever I’m brought in to improve the performance of a PHP application, an easy change I make is to disable any PHP extensions that the application does not use. PHP extensions are code libraries written in C that add to PHP’s native functionality. Examples of popular extensions on IBM i are ibm_db2 and curl.

Boost performance by disabling unneeded extensions

I’ve noticed that Zend Server ships with most extensions enabled, presumably so that developers won’t have to see “extension not enabled” error messages. While the default configuration is fine as a starting point, developers should understand that each extension requires memory when loaded. When every bit of performance counts, it’s best to disable the unused extensions. Note: don’t disable anything till you read Several Extensions to Keep Enabled.

Managing PHP extensions

To manage extensions, Zend Server provides the “Server Setup / Extensions” tab. Each extension can be enabled or disabled with its “Turn on” or “Turn off” links. Changes do not take effect until the “Restart PHP” button is clicked.

Zend Server PHP extensions management page

Zend Server's Extensions page where PHP extensions are managed

Storage location for extension settings

Zend Server stores extension settings in a set of .INI files, one file per extension. On IBM i, the files are located in /usr/local/ZendSvr/etc/conf.d. Before making large-scale changes, you may wish to back up this folder. Then, if you discover you were overzealous in disabling extensions, you can compare the contents of conf.d with your backup to find out where you went wrong.

Several extensions to keep enabled

In addition to whatever extensions are required by a given application, I’ve found that several extensions are required by Zend Server itself. Do not disable these. So far, I’ve found that Zend Server requires these extensions to be enabled:

  • ctype
  • iconv
  • json
  • pdo_mysql
  • simplexml (used by new open source toolkit)
  • zip

If you accidentally disable an extension required by Zend Server, which you’ll discover when Zend Server fails to start properly, you must re-enable the extension in the correct .INI file and then restart Zend Server from a command line or menu. On IBM i, the command is STRTCPSVR SERVER(*HTTP) RESTART(*HTTP) HTTPSVR(ZENDSVR).

More performance tips to come

I plan to write about more techniques to improve PHP application performance, particularly on IBM i, that I’ve found to be effective in my consulting experience. Performance is a critical part of user experience that developers should not ignore. In addition to this practical need for good performance, I can speak for myself, at least, in saying I feel great satisfaction when I can take a slow application (sometimes the victim of an underpowered server) and, step by step, help it run faster and faster, till the performance is at least acceptable and sometimes quite fast. More to come.

Maximize Zend Server PHP performance with Apache compression

Does your site run as quickly as it could? It’s worth your time to find out. Faster web sites sell more products, improve user satisfaction, and even rank higher in Google searches.

Note: This tip was written for IBM i but could be adapted for other platforms as well.

Benefits of Zend Server

If you have upgraded from Zend Core to Zend Server for IBM i, you have already received several performance improvements: bytecode acceleration (Zend Optimizer+), the elimination of Zend Core’s proxy web server, and configurable Data Caching. If you upgraded from Community Edition (CE) to full Zend Server, you also get monitoring, Page Caching, and Job Queue functionality.

Compression adds even more speed

IBM’s Apache web server provides an additional way to speed up your Zend Server for IBM i pages. You can compress PHP output, javascript, style sheets, and other text-based content. The compressed output will automatically be decompressed and interpreted properly by all modern web browsers. My tests show a speed improvement of 10-50% from this easy technique.

How to enable compression in 3 steps

1. Edit ZENDSVR’s Apache configuration file, located at /www/zendsvr/conf/httpd.conf. This is a simple text file, so you may choose from several editors: IBM’s HTTP Server Admin GUI at port 2001 (if *ADMIN is started), the WRKLNK/EDTF command, or your favorite text editor (I use EditPad Pro).

2. Add the following two directives to the httpd.conf’s main section:

# Load IBM i's module that performs compression
LoadModule deflate_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM

# Specify what to compress (example: php, json, css, javascript, static html)
AddOutputFilterByType DEFLATE application/x-httpd-php application/json text/css
application/x-javascript application/javascript text/html

3. Restart Zend Server using the handy Restart PHP button button or STRTCPSVR SERVER(*HTTP) RESTART(*HTTP) HTTPSVR(ZENDSVR)

Measure the improvement

I ran before-and-after tests using a sample script included with Zend Server for IBM i: http://your-server:10088/Samples/SQL_access/DB2_SQL_example.php.

Before compression: 31kb, loaded in 250ms (milliseconds). See the Firebug report below (Firebug is an optional add-on for Firefox and is not required.)

Zend Server output without compression

Without compression, this page was 31kb and loaded in 250ms

After compression: 4.4kb; loaded in 109ms. That’s only 14% of the size and 50% of the time! See the screen shot below.

after compression: only 4.4kb and loaded in 109ms

after compression: only 4.4kb and loaded in 109ms

I highly recommend that you give output compression a try. Your Zend Server for IBM i pages will fly!

For more information on browser output compression, see: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html