SlideShare a Scribd company logo
1 of 48
Download to read offline
Performance Tuning PHP on IBM i

Mike Pavlak                   Alan Seiden
Solution Consultant           Strategic Business Systems


Watch the recorded webinar: http://bit.ly/A4NjYM




                                                    © All rights reserved. Zend Technologies, Inc.
Agenda

    • What affects performance
    • Zend Server configuration
    • Review hardware architecture
    • Explore Web specific opportunities
    • Where to get additional help
    • Wrap up
    • Q&A




2                         © All rights reserved. Zend Technologies, Inc.
Performance is in the eye of the beholder…
    Perception is reality
      Many pieces to the performance puzzle

      Rarely a single silver bullet

      Performance tuning is a journey, not a destination

      Learn as you go

      Commercial websites look great…
          • And can be great motivators for change
      PHP is often accused but rarely convicted




3                             © All rights reserved. Zend Technologies, Inc.
Major contributors to performance issues

    • Additive workload
    • Transitional workload
    • Organic growth
    • Network infrastructure
    • Entropy
    • A piece of advice…
         When you see these coming…GET IN FRONT OF THEM
                 • Or get run over!




4   Insert->Header & Footer           © All rights reserved. Zend Technologies, Inc.
Speed = money
• Google’s experiment
   Google Search lists 10 results per page


   They tested pages of 30 results
           • Traffic and revenue dropped by 20%
           • Why?
                   – 10 results took .4 seconds to generate
                   – 30 results took .9 seconds
           • A ½ second delay caused a 20% drop in traffic
   Source:
       http://glinden.blogspot.com/2006/11/marissa
       -mayer-at-web-20.html


 Performance Tuning PHP on IBM i | 5   © All rights reserved. Zend Technologies, Inc.
Speed = competitiveness

• Search engine ranking
      Since early 2010, Google’s search algorithm has included speed

      Faster sites rank higher, all else being equal



• Consumers lose patience with slow sites
      With many choices, users give up on sites that drag

      Patience has decreased since the 1990s



• Slower sites often waste bandwidth and CPU
      Costly infrastructure driven by performance mistakes

Performance Tuning PHP on IBM i | 6   © All rights reserved. Zend Technologies, Inc.
How do we improve performance

    • Subject of this webinar
         Doing what you are doing now!

    • From the softer side
         Communication with other teams is essential
                 • While it is encouraged to bang you head against the wall…
                 • Do not suffer in silence, reach out for help
         Education
                 • If you think education is expensive, try ignorance!
         Services
                 • There are folks who may know more than you. Hire them.


7   Insert->Header & Footer           © All rights reserved. Zend Technologies, Inc.
Performance Tuning PHP on IBM i

www.zend.com




 Looking at Zend Server Administration




                © All rights reserved. Zend Technologies, Inc.
Zend Server for IBM i 5.6

    • Zend Server is Home Base
    • Configuration options abound
    • We will look at
         FastCGI settings

         Logs

         Extensions




9   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Fast CGI

     • Mechanism for communicating between Apache and PHP
     • Built in with 10 server jobs at the time of installation
     • This should conform to concurrent processes
     • Watch this as more workload is migrated to web




10   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Fast CGI
     • Changing this
          is something that should be considered

          But not taken lightly (system resources, etc.)

     • File to edit:
          /www/zendsvr/conf/fastcgi.conf

          SetEnv="PHP_FCGI_CHILDREN=10"

     • But don’t forget…
          StartProcesses = “2” * PHP_FCGI_CHILDREN = 8 is 16 total worker jobs

          http://www.youngiprofessionals.com/wiki/FastCGI

          http://www.systeminetwork.com/article/other-
              languages/fastcgi-boosts-php-performance-on-ibm-i-66195

11   Insert->Header & Footer      © All rights reserved. Zend Technologies, Inc.
PHP Logs

     • IFS performance, minimize read/writes
          Alan will discuss more

          But what about the logs

     • Consider the event monitor
     • Read the logs
     • Reduce the messages
     • Clip the log
          /usr/local/zendsvr/var/log/php.log




12   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Rename the log
     • Zend Server will create more!
           REN OBJ('/usr/local/zendsvr/var/log/php.log') NEWOBJ(phplog20120306.txt)




13   Insert->Header & Footer      © All rights reserved. Zend Technologies, Inc.
Extensions
     • PHP travels with a posse
          70+ extensions

          Many are used every day

          But if not used, may be turned off…

          Default,
                  • Zend Server for IBM i shipped with DB2 on and SQL Server off
                  • Look at the Zend Server admin interface
                           – Server setup  Extensions
                           – Like a light switch




14   Insert->Header & Footer                  © All rights reserved. Zend Technologies, Inc.
IBM i administration

     • PTF’s
          Current cumulative & group for HTTP

     • Memory pools
          Isolate memory from other attacks

     • Workload partitioning
          With i6.1 & i7.1 can protect processor without LPAR

     • Understanding demands on the systems
          If the boss doesn’t believe you, have your BP back you up!

          Performance Monitor tools

          3rd party

15   Insert->Header & Footer    © All rights reserved. Zend Technologies, Inc.
WRKSYSSTS – The first place to go!!!




16   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Performance Tuning PHP on IBM i

www.zend.com




 Tools




               © All rights reserved. Zend Technologies, Inc.
Firebug add-on graphs performance

• Firebug
      https://addons.mozilla.org/firefox/addon/firebug/

      Even better with FirePHP and Page Speed




Performance Tuning PHP on IBM i | 18   © All rights reserved. Zend Technologies, Inc.
Performance Tuning PHP on IBM i

www.zend.com




 Use Compression




               © All rights reserved. Zend Technologies, Inc.
Compression reduces file size
• Called gzip or mod_deflate (the same for our purposes)




• Compresses, speeds up html, javascript, css, any text
• Add two lines (OK, two long lines) to httpd.conf Apache config
       LoadModule deflate_module
          /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
       AddOutputFilterByType DEFLATE application/x-httpd-php
          application/json text/css application/x-javascript
          application/javascript text/html


Performance Tuning PHP on IBM i | 20   © All rights reserved. Zend Technologies, Inc.
Netflix saw improvement with gzip/deflate

• Saw 13-25% performance improvement
• Cut outbound traffic in half
      That saves money for a busy site such as Netflix

• Details of Netflix improvement:
      http://www.slideshare.net/billwscott/improving-netflix-
          performance-experience
• It really works!
• Tutorial on my blog:
      http://www.alanseiden.com/2010/08/13/maximize-zend-
          server-performance-with-apache-compression/


Performance Tuning PHP on IBM i | 21   © All rights reserved. Zend Technologies, Inc.
Performance Tuning PHP on IBM i

www.zend.com




 Reduce HTTP Requests




               © All rights reserved. Zend Technologies, Inc.
Requests cause “blocking” in browser

• Browsers typically limit themselves to 2 parallel requests to
  a given server
• File requests stack up, blocked by prev. requests
•




• Above, even “not modified” files caused blocking
• Solution: reduce number of images or improve
      caching via “Expires” headers
         http://httpd.apache.org/docs/2.0/mod/mod_expires.html

Performance Tuning PHP on IBM i | 23   © All rights reserved. Zend Technologies, Inc.
More ways to reduce “blocking”

• If many .js or .css files are used:
      Combine them into fewer files

      Move contents of smaller .js or .css files inline to your pages,
          eliminating those external files
      Page Speed tool will help you decide




Performance Tuning PHP on IBM i | 24   © All rights reserved. Zend Technologies, Inc.
Performance Tuning PHP on IBM i

www.zend.com




 Ajax: friend or foe?




                 © All rights reserved. Zend Technologies, Inc.
AJAX=Asynchronous Javascript And XML

• AJAX updates parts of a page without reloading the whole
  page
• Not always XML. These days, JSON too
• Requests and file sizes are generally small
• Meant to bring SPEED to the web


• Potential problems if overused




Performance Tuning PHP on IBM i | 26   © All rights reserved. Zend Technologies, Inc.
AJAX mistake #1
• Too much of a good thing
      Requiring several AJAX requests to complete before the page
          itself can load fully
      Too many HTTP requests at once
      I’ve seen a situation where 4 AJAX requests were embedded in a
          page load
              • The AJAX doesn’t even start till the page loads
              • Causes “blocking” as the requests pile up, waiting for the previous
                ones to complete
      Solution: when page first loads, embed AJAX content right in the
          page
              • Re-use logic on the server side when building page
              • Subsequent updates can be done with AJAX

Performance Tuning PHP on IBM i | 27   © All rights reserved. Zend Technologies, Inc.
AJAX mistake #2

• Duplicate requests
      Might go unnoticed with javascript library tools (Dojo, jQuery...)

      Happens more than you would expect! Common, actually




Performance Tuning PHP on IBM i | 28   © All rights reserved. Zend Technologies, Inc.
AJAX mistake #3
 • Dynamically generating static content (don’t do that)
 • Solutions:
        Change to static files

        Cache URLs (e.g. with Zend Data Cache if using PHP, or Apache caching)
           See example below, before and after caching




Performance Tuning PHP on IBM i | 29   © All rights reserved. Zend Technologies, Inc.
Performance Tuning PHP on IBM i

www.zend.com




 Keep-alive




               © All rights reserved. Zend Technologies, Inc.
Keep HTTP connections alive
• “Keep-alive” setting in Apache (or any web server)


• The HTTP job will stay open, waiting for you
      Perfect when downloading many images, css, js files



• Configurable by number of seconds to keep connection open,
  number of files to be downloaded
      KeepAlive On

      KeepAliveTimeout 15

      See http://httpd.apache.org/docs/2.0/mod/core.html#keepalive



• Don’t overdo it—you are locking out other users from that HTTP
  job while it’s dedicated to you
Performance Tuning PHP on IBM i | 31   © All rights reserved. Zend Technologies, Inc.
Connecting takes time

• Clues that Keepalive is off
      “Connection: close”, “Connecting”

• Example bottom right: 3.6 seconds “Connecting” (longer
  than average but it really happened)




Performance Tuning PHP on IBM i | 32   © All rights reserved. Zend Technologies, Inc.
What you see when Keep-alive is on

• Firebug’s “Net” tab shows “Connection: Keep-Alive”, and,
  here, timeout=300 seconds (5 minutes)




    • Zero seconds to
    connect
    • Keep-alive is working!



Performance Tuning PHP on IBM i | 33   © All rights reserved. Zend Technologies, Inc.
Performance Tuning PHP on IBM i

www.zend.com




 Persistent DB Connections




                © All rights reserved. Zend Technologies, Inc.
Persistence = connection pool

• On IBM i, job initialization is relatively slow
      Gives us good things—auditing, logging, security

      Solution: a pool of pre-initialized jobs


• Pre-started DB2 jobs save time
      Generally run in subsystem QSYSWRK, job name QSQSRVR

      These prestart jobs can be configured with CHGPJE command


• In PHP, persistent connections reuse initialized jobs
      db2_pconnect()

      Dramatic speed boost
Performance Tuning PHP on IBM i | 35   © All rights reserved. Zend Technologies, Inc.
Use db2_pconnect() to connect persistently
• resource db2_pconnect ( string $database , string
  $username , string $password [, array $options ] )


• Persistent is much faster than non-persistent
     db2_pconnect can reuse connections, reducing the time needed
        to connect (after the first time) to almost zero
• How db2_pconnect() reuses connections
     Connections defined by database, username, and password

     Tries to reuse an existing connection matching these 3 params

     db2_close() on a persistent connection does nothing

     db2_pclose() forces the conn to close

Performance Tuning PHP on IBM i | 36   © All rights reserved. Zend Technologies, Inc.
db2_pconnect() example with library list
$database = 'MYDB';
$user = 'MYUSER';
$password = 'MYPASS';

// set library list (works the same for connect or pconnect)
$options = array('i5_naming'                             => DB2_I5_NAMING_ON,
                                   'i5_libl'             => 'MYLIB1 MYLIB2');
$conn = db2_pconnect($database, $user, $password, $options);

if ($conn) {
       echo "Connection succeeded.";
} else {
    echo "Connection failed.";
}
// MYTABLE will be found, if in library MYLIB1 or MYLIB2
$stmt=db2_exec($conn,"SELECT * FROM MYTABLE");

Performance Tuning PHP on IBM i | 37      © All rights reserved. Zend Technologies, Inc.
Rules for using persistence
• Because connections are shared when defined with an
  identical database, user, and password, please:
     Avoid unpredictable results by also specifying the same $options
        for these connections
     Promote sharing of jobs by minimizing the number of user profiles
        that you connect with
             • Each user profile creates a new set of database jobs
             • Each set of jobs consumes system resources



• More information:
     “DB2 and PHP Best Practices on IBM i” at
        http://alanseiden.com/presentations

Performance Tuning PHP on IBM i | 38   © All rights reserved. Zend Technologies, Inc.
New open source PHP IBM i toolkit
• Ships with Zend Server 5.6+
      PTFs and hotfixes on download page
      Many improvements since first release


• Information and updates:
      Young i Professionals site
              • http://youngiprofessionals.com/wiki/XMLSERVICE
      Zend Forum for Q&A and tips
              • http://forums.zend.com/viewtopic.php?f=113&t=41648
              • “PHP on IBM i”->”Zend Server for IBM i”->”New Toolkit”


• Efficient: use single DB2 connection for SQL and Toolkit
      http://forums.zend.com/viewtopic.php?f=113&t=46688
      Persistent connection is the fastest
Performance Tuning PHP on IBM i | 39   © All rights reserved. Zend Technologies, Inc.
Performance Tuning PHP on IBM i

www.zend.com




 Wrap it up




               © All rights reserved. Zend Technologies, Inc.
Help!

     • I’ve got PHP applications and not sure what to do?
     • Do your homework
          Read, learn, explore

          Talk in forums (Zend.com and midrange.com)

     • Zend Services
          Application Audit
                  • Up to 50,000 lines of code
                  • Review on site or off (knowledge transfer!)
                  • Report summary & remediation available




41   Insert->Header & Footer           © All rights reserved. Zend Technologies, Inc.
Zend Performance Audit
      Comprehensive Methodology
          Detailed evaluation of your application and environment
          Detailed analysis of performance patterns and behaviors
          Provide report and improvements recommendations
      Proven Success
          Delivered to numerous Global 1000 companies
          Accelerated performance across industries
          Methodologies applied to hundreds of applications
      Delivered by the PHP Company Experts
          Unparalleled experience in PHP and Zend Server
          Methodology developed by the architects of PHP
          Utilizing Zend standard benchmarks




42   Zend Professional Services     © All rights reserved. Zend Technologies, Inc.
Zend Server features (Full version)

     • Event Monitor
          Become aware of issues before your users call

     • Code Tracing
          Black box flight recorder for PHP scripts

     • Caching
          Op-code (Alan discussed & available with CE)

          Data (Also available with CE)

          Page

     • Job Queue
          SBMJOB for PHP!!!

43   Insert->Header & Footer    © All rights reserved. Zend Technologies, Inc.
Webcasts

     • April 12 – Stored Procedures Part II (RPG, etc.)
     • May 2 – Additional Functions of DB2 with PHP on IBM i




                       Your thoughts???

44   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Events where you’ll find Zend…
     • User groups
          WMCPA (Lake Geneva, WI) Mar 20-22 (Mike & Alan)
                  • http://wmcpa.org/
          NEUGC (Boston, MA) April 2-4
                  • http://neugc.org/

     Alan:
     March 29: COMMON webcast: more performance tips
     http://www.common.org/index.php/webcasts/upcoming-webcasts.html

     April 5: live online event with System i Network
     New PHP Toolkit for IBM i
     http://www.systeminetwork.com/events/upcoming-events

     In New York City? I host the NYC Zend Framework Meetup
     http://www.meetup.com/ZendFramework-NYCmetro/
45   Insert->Header & Footer            © All rights reserved. Zend Technologies, Inc.
Events where you’ll find Zend…(cont.)
     • Major venues
          RPG & DB2 Summit (Ft. Worth, TX) Mar 25-28
                  • http://www.systemideveloper.com/Summit/conferences.html




          COMMON Annual Meeting and Expo (Anaheim, CA) May 6-9
                  • http://www.common.org/index.php/annualmeeting.html




          COMMON Fall Conference (Columbus, OH) Sep 24-26
                  • http://www.common.org/index.php/fall-conference-and-expo.html


46   Insert->Header & Footer        © All rights reserved. Zend Technologies, Inc.
Contact | Get tips
Alan Seiden                                           Strategic Business Systems, Inc,
201-327-9400                                          17 S. Franklin Tpk
aseiden@sbsusa.com                                    Ramsey, NJ, 07446


http://alanseiden.com                                 Twitter: @alanseiden


Free PHP/i tips by email:
http://alanseiden.com/tips




Performance Tuning PHP on IBM i | 47   © All rights reserved. Zend Technologies, Inc.
Q&A
     mike.p@zend.com

     aseiden@sbsusa.com
      Watch the recorded webinar: http://bit.ly/A4NjYM




48                © All rights reserved. Zend Technologies, Inc.

More Related Content

What's hot

PHP Toolkit from Zend and IBM: Open Source on IBM i
PHP Toolkit from Zend and IBM: Open Source on IBM iPHP Toolkit from Zend and IBM: Open Source on IBM i
PHP Toolkit from Zend and IBM: Open Source on IBM iAlan Seiden
 
DB2 and PHP in Depth on IBM i
DB2 and PHP in Depth on IBM iDB2 and PHP in Depth on IBM i
DB2 and PHP in Depth on IBM iAlan Seiden
 
Strategic Modernization with PHP on IBM i
Strategic Modernization with PHP on IBM iStrategic Modernization with PHP on IBM i
Strategic Modernization with PHP on IBM iAlan Seiden
 
Performance tuning with zend framework
Performance tuning with zend frameworkPerformance tuning with zend framework
Performance tuning with zend frameworkAlan Seiden
 
Browser tools that make web development easier
Browser tools that make web development easierBrowser tools that make web development easier
Browser tools that make web development easierAlan Seiden
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi Shlomo Vanunu
 
PHP Batch Jobs on IBM i
PHP Batch Jobs on IBM iPHP Batch Jobs on IBM i
PHP Batch Jobs on IBM iAlan Seiden
 
PHP on IBM i Tutorial
PHP on IBM i TutorialPHP on IBM i Tutorial
PHP on IBM i TutorialZendCon
 
Adm02 Be a Domino Detective: Tackling Your Toughest Performance Problems
Adm02 Be a Domino Detective: Tackling Your Toughest Performance ProblemsAdm02 Be a Domino Detective: Tackling Your Toughest Performance Problems
Adm02 Be a Domino Detective: Tackling Your Toughest Performance ProblemsKim Greene
 
Adm07 The Health Check Extravaganza for IBM Social and Collaboration Environm...
Adm07 The Health Check Extravaganza for IBM Social and Collaboration Environm...Adm07 The Health Check Extravaganza for IBM Social and Collaboration Environm...
Adm07 The Health Check Extravaganza for IBM Social and Collaboration Environm...Kim Greene
 
IBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power HourIBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power HourChris Miller
 
Practical solutions for connections administrators lite
Practical solutions for connections administrators litePractical solutions for connections administrators lite
Practical solutions for connections administrators liteSharon James
 
Taking IBM Sametime Mobile
Taking IBM Sametime MobileTaking IBM Sametime Mobile
Taking IBM Sametime MobileGabriella Davis
 
IBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right wayIBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right wayLetsConnect
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsLetsConnect
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblastpanagenda
 
You don't want to do it like that
You don't want to do it like thatYou don't want to do it like that
You don't want to do it like thatSharon James
 
Sa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSharon James
 

What's hot (20)

PHP Toolkit from Zend and IBM: Open Source on IBM i
PHP Toolkit from Zend and IBM: Open Source on IBM iPHP Toolkit from Zend and IBM: Open Source on IBM i
PHP Toolkit from Zend and IBM: Open Source on IBM i
 
DB2 and PHP in Depth on IBM i
DB2 and PHP in Depth on IBM iDB2 and PHP in Depth on IBM i
DB2 and PHP in Depth on IBM i
 
Strategic Modernization with PHP on IBM i
Strategic Modernization with PHP on IBM iStrategic Modernization with PHP on IBM i
Strategic Modernization with PHP on IBM i
 
Performance tuning with zend framework
Performance tuning with zend frameworkPerformance tuning with zend framework
Performance tuning with zend framework
 
Browser tools that make web development easier
Browser tools that make web development easierBrowser tools that make web development easier
Browser tools that make web development easier
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi
 
PHP Batch Jobs on IBM i
PHP Batch Jobs on IBM iPHP Batch Jobs on IBM i
PHP Batch Jobs on IBM i
 
PHP on IBM i Tutorial
PHP on IBM i TutorialPHP on IBM i Tutorial
PHP on IBM i Tutorial
 
Adm02 Be a Domino Detective: Tackling Your Toughest Performance Problems
Adm02 Be a Domino Detective: Tackling Your Toughest Performance ProblemsAdm02 Be a Domino Detective: Tackling Your Toughest Performance Problems
Adm02 Be a Domino Detective: Tackling Your Toughest Performance Problems
 
Adm07 The Health Check Extravaganza for IBM Social and Collaboration Environm...
Adm07 The Health Check Extravaganza for IBM Social and Collaboration Environm...Adm07 The Health Check Extravaganza for IBM Social and Collaboration Environm...
Adm07 The Health Check Extravaganza for IBM Social and Collaboration Environm...
 
Optimizing performance
Optimizing performanceOptimizing performance
Optimizing performance
 
A Tale of Two Toolkits
A Tale of Two ToolkitsA Tale of Two Toolkits
A Tale of Two Toolkits
 
IBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power HourIBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
IBM Connect 2016 - 60+ in 60 - Admin Tips Power Hour
 
Practical solutions for connections administrators lite
Practical solutions for connections administrators litePractical solutions for connections administrators lite
Practical solutions for connections administrators lite
 
Taking IBM Sametime Mobile
Taking IBM Sametime MobileTaking IBM Sametime Mobile
Taking IBM Sametime Mobile
 
IBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right wayIBM Connections administration – keep your systems running the right way
IBM Connections administration – keep your systems running the right way
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM Connections
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblast
 
You don't want to do it like that
You don't want to do it like thatYou don't want to do it like that
You don't want to do it like that
 
Sa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administrators
 

Similar to Performance tuning PHP on IBMi

What's new with Zend server
What's new with Zend serverWhat's new with Zend server
What's new with Zend serverCOMMON Europe
 
High performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructureHigh performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructuremkherlakian
 
Getting started with PHP on IBM i
Getting started with PHP on IBM iGetting started with PHP on IBM i
Getting started with PHP on IBM iCOMMON Europe
 
Turbocharging php applications with zend server
Turbocharging php applications with zend serverTurbocharging php applications with zend server
Turbocharging php applications with zend serverEric Ritchie
 
Turbocharging php applications with zend server (workshop)
Turbocharging php applications with zend server (workshop)Turbocharging php applications with zend server (workshop)
Turbocharging php applications with zend server (workshop)Eric Ritchie
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIvo Jansch
 
Building and managing applications fast for IBM i
Building and managing applications fast for IBM iBuilding and managing applications fast for IBM i
Building and managing applications fast for IBM iZend by Rogue Wave Software
 
PHP Apps on the Move - Migrating from In-House to Cloud
PHP Apps on the Move - Migrating from In-House to Cloud  PHP Apps on the Move - Migrating from In-House to Cloud
PHP Apps on the Move - Migrating from In-House to Cloud RightScale
 
Ria Applications And PHP
Ria Applications And PHPRia Applications And PHP
Ria Applications And PHPJohn Coggeshall
 
Microsoft TechDays 2011 - PHP on Windows
Microsoft TechDays 2011 - PHP on WindowsMicrosoft TechDays 2011 - PHP on Windows
Microsoft TechDays 2011 - PHP on WindowsEnterprise PHP Center
 
Scalable High-Availability Session Storage with ZSCM
Scalable High-Availability Session Storage with ZSCMScalable High-Availability Session Storage with ZSCM
Scalable High-Availability Session Storage with ZSCMZend by Rogue Wave Software
 
DPC2007 Zend Framework (Gaylord Aulke)
DPC2007 Zend Framework (Gaylord Aulke)DPC2007 Zend Framework (Gaylord Aulke)
DPC2007 Zend Framework (Gaylord Aulke)dpc
 
Dutch php conference_2010_opm
Dutch php conference_2010_opmDutch php conference_2010_opm
Dutch php conference_2010_opmisnull
 
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)Nexcess.net LLC
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...Otto Kekäläinen
 
Performance automation 101 @LDNWebPerf MickMcGuinness
Performance automation 101 @LDNWebPerf MickMcGuinnessPerformance automation 101 @LDNWebPerf MickMcGuinness
Performance automation 101 @LDNWebPerf MickMcGuinnessStephen Thair
 

Similar to Performance tuning PHP on IBMi (20)

What's new with Zend server
What's new with Zend serverWhat's new with Zend server
What's new with Zend server
 
High performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructureHigh performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructure
 
Getting started with PHP on IBM i
Getting started with PHP on IBM iGetting started with PHP on IBM i
Getting started with PHP on IBM i
 
Turbocharging php applications with zend server
Turbocharging php applications with zend serverTurbocharging php applications with zend server
Turbocharging php applications with zend server
 
Turbocharging php applications with zend server (workshop)
Turbocharging php applications with zend server (workshop)Turbocharging php applications with zend server (workshop)
Turbocharging php applications with zend server (workshop)
 
Application Deployment on IBM i
Application Deployment on IBM iApplication Deployment on IBM i
Application Deployment on IBM i
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web Services
 
Building and managing applications fast for IBM i
Building and managing applications fast for IBM iBuilding and managing applications fast for IBM i
Building and managing applications fast for IBM i
 
PHP Apps on the Move - Migrating from In-House to Cloud
PHP Apps on the Move - Migrating from In-House to Cloud  PHP Apps on the Move - Migrating from In-House to Cloud
PHP Apps on the Move - Migrating from In-House to Cloud
 
Codeigniter framework
Codeigniter framework Codeigniter framework
Codeigniter framework
 
Ria Applications And PHP
Ria Applications And PHPRia Applications And PHP
Ria Applications And PHP
 
Microsoft TechDays 2011 - PHP on Windows
Microsoft TechDays 2011 - PHP on WindowsMicrosoft TechDays 2011 - PHP on Windows
Microsoft TechDays 2011 - PHP on Windows
 
Scalable High-Availability Session Storage with ZSCM
Scalable High-Availability Session Storage with ZSCMScalable High-Availability Session Storage with ZSCM
Scalable High-Availability Session Storage with ZSCM
 
DPC2007 Zend Framework (Gaylord Aulke)
DPC2007 Zend Framework (Gaylord Aulke)DPC2007 Zend Framework (Gaylord Aulke)
DPC2007 Zend Framework (Gaylord Aulke)
 
Dutch php conference_2010_opm
Dutch php conference_2010_opmDutch php conference_2010_opm
Dutch php conference_2010_opm
 
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)
ExpressionEngine - Simple Steps to Performance and Security (EECI 2014)
 
Performance tuning of Websites
Performance tuning of WebsitesPerformance tuning of Websites
Performance tuning of Websites
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
 
Web Performance Optimization (WPO)
Web Performance Optimization (WPO)Web Performance Optimization (WPO)
Web Performance Optimization (WPO)
 
Performance automation 101 @LDNWebPerf MickMcGuinness
Performance automation 101 @LDNWebPerf MickMcGuinnessPerformance automation 101 @LDNWebPerf MickMcGuinness
Performance automation 101 @LDNWebPerf MickMcGuinness
 

More from Zend by Rogue Wave Software

Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018) Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018) Zend by Rogue Wave Software
 
The Sodium crypto library of PHP 7.2 (PHP Day 2018)
The Sodium crypto library of PHP 7.2 (PHP Day 2018)The Sodium crypto library of PHP 7.2 (PHP Day 2018)
The Sodium crypto library of PHP 7.2 (PHP Day 2018)Zend by Rogue Wave Software
 
Develop web APIs in PHP using middleware with Expressive (Code Europe)
Develop web APIs in PHP using middleware with Expressive (Code Europe)Develop web APIs in PHP using middleware with Expressive (Code Europe)
Develop web APIs in PHP using middleware with Expressive (Code Europe)Zend by Rogue Wave Software
 

More from Zend by Rogue Wave Software (20)

Develop microservices in php
Develop microservices in phpDevelop microservices in php
Develop microservices in php
 
Speed and security for your PHP application
Speed and security for your PHP applicationSpeed and security for your PHP application
Speed and security for your PHP application
 
Building web APIs in PHP with Zend Expressive
Building web APIs in PHP with Zend ExpressiveBuilding web APIs in PHP with Zend Expressive
Building web APIs in PHP with Zend Expressive
 
To PHP 7 and beyond
To PHP 7 and beyondTo PHP 7 and beyond
To PHP 7 and beyond
 
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018) Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
 
The Sodium crypto library of PHP 7.2 (PHP Day 2018)
The Sodium crypto library of PHP 7.2 (PHP Day 2018)The Sodium crypto library of PHP 7.2 (PHP Day 2018)
The Sodium crypto library of PHP 7.2 (PHP Day 2018)
 
Develop web APIs in PHP using middleware with Expressive (Code Europe)
Develop web APIs in PHP using middleware with Expressive (Code Europe)Develop web APIs in PHP using middleware with Expressive (Code Europe)
Develop web APIs in PHP using middleware with Expressive (Code Europe)
 
Middleware web APIs in PHP 7.x
Middleware web APIs in PHP 7.xMiddleware web APIs in PHP 7.x
Middleware web APIs in PHP 7.x
 
Ongoing management of your PHP 7 application
Ongoing management of your PHP 7 applicationOngoing management of your PHP 7 application
Ongoing management of your PHP 7 application
 
Developing web APIs using middleware in PHP 7
Developing web APIs using middleware in PHP 7Developing web APIs using middleware in PHP 7
Developing web APIs using middleware in PHP 7
 
The Docker development template for PHP
The Docker development template for PHPThe Docker development template for PHP
The Docker development template for PHP
 
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
 
Unit testing for project managers
Unit testing for project managersUnit testing for project managers
Unit testing for project managers
 
The new features of PHP 7
The new features of PHP 7The new features of PHP 7
The new features of PHP 7
 
Deploying PHP apps on the cloud
Deploying PHP apps on the cloudDeploying PHP apps on the cloud
Deploying PHP apps on the cloud
 
Data is dead. Long live data!
Data is dead. Long live data! Data is dead. Long live data!
Data is dead. Long live data!
 
Resolving problems & high availability
Resolving problems & high availabilityResolving problems & high availability
Resolving problems & high availability
 
Developing apps faster
Developing apps fasterDeveloping apps faster
Developing apps faster
 
Keeping up with PHP
Keeping up with PHPKeeping up with PHP
Keeping up with PHP
 
Continuous Delivery e-book
Continuous Delivery e-bookContinuous Delivery e-book
Continuous Delivery e-book
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Performance tuning PHP on IBMi

  • 1. Performance Tuning PHP on IBM i Mike Pavlak Alan Seiden Solution Consultant Strategic Business Systems Watch the recorded webinar: http://bit.ly/A4NjYM © All rights reserved. Zend Technologies, Inc.
  • 2. Agenda • What affects performance • Zend Server configuration • Review hardware architecture • Explore Web specific opportunities • Where to get additional help • Wrap up • Q&A 2 © All rights reserved. Zend Technologies, Inc.
  • 3. Performance is in the eye of the beholder… Perception is reality Many pieces to the performance puzzle Rarely a single silver bullet Performance tuning is a journey, not a destination Learn as you go Commercial websites look great… • And can be great motivators for change PHP is often accused but rarely convicted 3 © All rights reserved. Zend Technologies, Inc.
  • 4. Major contributors to performance issues • Additive workload • Transitional workload • Organic growth • Network infrastructure • Entropy • A piece of advice… When you see these coming…GET IN FRONT OF THEM • Or get run over! 4 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 5. Speed = money • Google’s experiment Google Search lists 10 results per page They tested pages of 30 results • Traffic and revenue dropped by 20% • Why? – 10 results took .4 seconds to generate – 30 results took .9 seconds • A ½ second delay caused a 20% drop in traffic Source: http://glinden.blogspot.com/2006/11/marissa -mayer-at-web-20.html Performance Tuning PHP on IBM i | 5 © All rights reserved. Zend Technologies, Inc.
  • 6. Speed = competitiveness • Search engine ranking Since early 2010, Google’s search algorithm has included speed Faster sites rank higher, all else being equal • Consumers lose patience with slow sites With many choices, users give up on sites that drag Patience has decreased since the 1990s • Slower sites often waste bandwidth and CPU Costly infrastructure driven by performance mistakes Performance Tuning PHP on IBM i | 6 © All rights reserved. Zend Technologies, Inc.
  • 7. How do we improve performance • Subject of this webinar Doing what you are doing now! • From the softer side Communication with other teams is essential • While it is encouraged to bang you head against the wall… • Do not suffer in silence, reach out for help Education • If you think education is expensive, try ignorance! Services • There are folks who may know more than you. Hire them. 7 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 8. Performance Tuning PHP on IBM i www.zend.com Looking at Zend Server Administration © All rights reserved. Zend Technologies, Inc.
  • 9. Zend Server for IBM i 5.6 • Zend Server is Home Base • Configuration options abound • We will look at FastCGI settings Logs Extensions 9 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 10. Fast CGI • Mechanism for communicating between Apache and PHP • Built in with 10 server jobs at the time of installation • This should conform to concurrent processes • Watch this as more workload is migrated to web 10 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 11. Fast CGI • Changing this is something that should be considered But not taken lightly (system resources, etc.) • File to edit: /www/zendsvr/conf/fastcgi.conf SetEnv="PHP_FCGI_CHILDREN=10" • But don’t forget… StartProcesses = “2” * PHP_FCGI_CHILDREN = 8 is 16 total worker jobs http://www.youngiprofessionals.com/wiki/FastCGI http://www.systeminetwork.com/article/other- languages/fastcgi-boosts-php-performance-on-ibm-i-66195 11 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 12. PHP Logs • IFS performance, minimize read/writes Alan will discuss more But what about the logs • Consider the event monitor • Read the logs • Reduce the messages • Clip the log /usr/local/zendsvr/var/log/php.log 12 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 13. Rename the log • Zend Server will create more!  REN OBJ('/usr/local/zendsvr/var/log/php.log') NEWOBJ(phplog20120306.txt) 13 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 14. Extensions • PHP travels with a posse 70+ extensions Many are used every day But if not used, may be turned off… Default, • Zend Server for IBM i shipped with DB2 on and SQL Server off • Look at the Zend Server admin interface – Server setup  Extensions – Like a light switch 14 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 15. IBM i administration • PTF’s Current cumulative & group for HTTP • Memory pools Isolate memory from other attacks • Workload partitioning With i6.1 & i7.1 can protect processor without LPAR • Understanding demands on the systems If the boss doesn’t believe you, have your BP back you up! Performance Monitor tools 3rd party 15 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 16. WRKSYSSTS – The first place to go!!! 16 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 17. Performance Tuning PHP on IBM i www.zend.com Tools © All rights reserved. Zend Technologies, Inc.
  • 18. Firebug add-on graphs performance • Firebug https://addons.mozilla.org/firefox/addon/firebug/ Even better with FirePHP and Page Speed Performance Tuning PHP on IBM i | 18 © All rights reserved. Zend Technologies, Inc.
  • 19. Performance Tuning PHP on IBM i www.zend.com Use Compression © All rights reserved. Zend Technologies, Inc.
  • 20. Compression reduces file size • Called gzip or mod_deflate (the same for our purposes) • Compresses, speeds up html, javascript, css, any text • Add two lines (OK, two long lines) to httpd.conf Apache config  LoadModule deflate_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM  AddOutputFilterByType DEFLATE application/x-httpd-php application/json text/css application/x-javascript application/javascript text/html Performance Tuning PHP on IBM i | 20 © All rights reserved. Zend Technologies, Inc.
  • 21. Netflix saw improvement with gzip/deflate • Saw 13-25% performance improvement • Cut outbound traffic in half That saves money for a busy site such as Netflix • Details of Netflix improvement: http://www.slideshare.net/billwscott/improving-netflix- performance-experience • It really works! • Tutorial on my blog: http://www.alanseiden.com/2010/08/13/maximize-zend- server-performance-with-apache-compression/ Performance Tuning PHP on IBM i | 21 © All rights reserved. Zend Technologies, Inc.
  • 22. Performance Tuning PHP on IBM i www.zend.com Reduce HTTP Requests © All rights reserved. Zend Technologies, Inc.
  • 23. Requests cause “blocking” in browser • Browsers typically limit themselves to 2 parallel requests to a given server • File requests stack up, blocked by prev. requests • • Above, even “not modified” files caused blocking • Solution: reduce number of images or improve caching via “Expires” headers  http://httpd.apache.org/docs/2.0/mod/mod_expires.html Performance Tuning PHP on IBM i | 23 © All rights reserved. Zend Technologies, Inc.
  • 24. More ways to reduce “blocking” • If many .js or .css files are used: Combine them into fewer files Move contents of smaller .js or .css files inline to your pages, eliminating those external files Page Speed tool will help you decide Performance Tuning PHP on IBM i | 24 © All rights reserved. Zend Technologies, Inc.
  • 25. Performance Tuning PHP on IBM i www.zend.com Ajax: friend or foe? © All rights reserved. Zend Technologies, Inc.
  • 26. AJAX=Asynchronous Javascript And XML • AJAX updates parts of a page without reloading the whole page • Not always XML. These days, JSON too • Requests and file sizes are generally small • Meant to bring SPEED to the web • Potential problems if overused Performance Tuning PHP on IBM i | 26 © All rights reserved. Zend Technologies, Inc.
  • 27. AJAX mistake #1 • Too much of a good thing Requiring several AJAX requests to complete before the page itself can load fully Too many HTTP requests at once I’ve seen a situation where 4 AJAX requests were embedded in a page load • The AJAX doesn’t even start till the page loads • Causes “blocking” as the requests pile up, waiting for the previous ones to complete Solution: when page first loads, embed AJAX content right in the page • Re-use logic on the server side when building page • Subsequent updates can be done with AJAX Performance Tuning PHP on IBM i | 27 © All rights reserved. Zend Technologies, Inc.
  • 28. AJAX mistake #2 • Duplicate requests Might go unnoticed with javascript library tools (Dojo, jQuery...) Happens more than you would expect! Common, actually Performance Tuning PHP on IBM i | 28 © All rights reserved. Zend Technologies, Inc.
  • 29. AJAX mistake #3 • Dynamically generating static content (don’t do that) • Solutions: Change to static files Cache URLs (e.g. with Zend Data Cache if using PHP, or Apache caching) See example below, before and after caching Performance Tuning PHP on IBM i | 29 © All rights reserved. Zend Technologies, Inc.
  • 30. Performance Tuning PHP on IBM i www.zend.com Keep-alive © All rights reserved. Zend Technologies, Inc.
  • 31. Keep HTTP connections alive • “Keep-alive” setting in Apache (or any web server) • The HTTP job will stay open, waiting for you Perfect when downloading many images, css, js files • Configurable by number of seconds to keep connection open, number of files to be downloaded KeepAlive On KeepAliveTimeout 15 See http://httpd.apache.org/docs/2.0/mod/core.html#keepalive • Don’t overdo it—you are locking out other users from that HTTP job while it’s dedicated to you Performance Tuning PHP on IBM i | 31 © All rights reserved. Zend Technologies, Inc.
  • 32. Connecting takes time • Clues that Keepalive is off “Connection: close”, “Connecting” • Example bottom right: 3.6 seconds “Connecting” (longer than average but it really happened) Performance Tuning PHP on IBM i | 32 © All rights reserved. Zend Technologies, Inc.
  • 33. What you see when Keep-alive is on • Firebug’s “Net” tab shows “Connection: Keep-Alive”, and, here, timeout=300 seconds (5 minutes) • Zero seconds to connect • Keep-alive is working! Performance Tuning PHP on IBM i | 33 © All rights reserved. Zend Technologies, Inc.
  • 34. Performance Tuning PHP on IBM i www.zend.com Persistent DB Connections © All rights reserved. Zend Technologies, Inc.
  • 35. Persistence = connection pool • On IBM i, job initialization is relatively slow Gives us good things—auditing, logging, security Solution: a pool of pre-initialized jobs • Pre-started DB2 jobs save time Generally run in subsystem QSYSWRK, job name QSQSRVR These prestart jobs can be configured with CHGPJE command • In PHP, persistent connections reuse initialized jobs db2_pconnect() Dramatic speed boost Performance Tuning PHP on IBM i | 35 © All rights reserved. Zend Technologies, Inc.
  • 36. Use db2_pconnect() to connect persistently • resource db2_pconnect ( string $database , string $username , string $password [, array $options ] ) • Persistent is much faster than non-persistent db2_pconnect can reuse connections, reducing the time needed to connect (after the first time) to almost zero • How db2_pconnect() reuses connections Connections defined by database, username, and password Tries to reuse an existing connection matching these 3 params db2_close() on a persistent connection does nothing db2_pclose() forces the conn to close Performance Tuning PHP on IBM i | 36 © All rights reserved. Zend Technologies, Inc.
  • 37. db2_pconnect() example with library list $database = 'MYDB'; $user = 'MYUSER'; $password = 'MYPASS'; // set library list (works the same for connect or pconnect) $options = array('i5_naming' => DB2_I5_NAMING_ON, 'i5_libl' => 'MYLIB1 MYLIB2'); $conn = db2_pconnect($database, $user, $password, $options); if ($conn) { echo "Connection succeeded."; } else { echo "Connection failed."; } // MYTABLE will be found, if in library MYLIB1 or MYLIB2 $stmt=db2_exec($conn,"SELECT * FROM MYTABLE"); Performance Tuning PHP on IBM i | 37 © All rights reserved. Zend Technologies, Inc.
  • 38. Rules for using persistence • Because connections are shared when defined with an identical database, user, and password, please: Avoid unpredictable results by also specifying the same $options for these connections Promote sharing of jobs by minimizing the number of user profiles that you connect with • Each user profile creates a new set of database jobs • Each set of jobs consumes system resources • More information: “DB2 and PHP Best Practices on IBM i” at http://alanseiden.com/presentations Performance Tuning PHP on IBM i | 38 © All rights reserved. Zend Technologies, Inc.
  • 39. New open source PHP IBM i toolkit • Ships with Zend Server 5.6+ PTFs and hotfixes on download page Many improvements since first release • Information and updates: Young i Professionals site • http://youngiprofessionals.com/wiki/XMLSERVICE Zend Forum for Q&A and tips • http://forums.zend.com/viewtopic.php?f=113&t=41648 • “PHP on IBM i”->”Zend Server for IBM i”->”New Toolkit” • Efficient: use single DB2 connection for SQL and Toolkit http://forums.zend.com/viewtopic.php?f=113&t=46688 Persistent connection is the fastest Performance Tuning PHP on IBM i | 39 © All rights reserved. Zend Technologies, Inc.
  • 40. Performance Tuning PHP on IBM i www.zend.com Wrap it up © All rights reserved. Zend Technologies, Inc.
  • 41. Help! • I’ve got PHP applications and not sure what to do? • Do your homework Read, learn, explore Talk in forums (Zend.com and midrange.com) • Zend Services Application Audit • Up to 50,000 lines of code • Review on site or off (knowledge transfer!) • Report summary & remediation available 41 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 42. Zend Performance Audit  Comprehensive Methodology  Detailed evaluation of your application and environment  Detailed analysis of performance patterns and behaviors  Provide report and improvements recommendations  Proven Success  Delivered to numerous Global 1000 companies  Accelerated performance across industries  Methodologies applied to hundreds of applications  Delivered by the PHP Company Experts  Unparalleled experience in PHP and Zend Server  Methodology developed by the architects of PHP  Utilizing Zend standard benchmarks 42 Zend Professional Services © All rights reserved. Zend Technologies, Inc.
  • 43. Zend Server features (Full version) • Event Monitor Become aware of issues before your users call • Code Tracing Black box flight recorder for PHP scripts • Caching Op-code (Alan discussed & available with CE) Data (Also available with CE) Page • Job Queue SBMJOB for PHP!!! 43 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 44. Webcasts • April 12 – Stored Procedures Part II (RPG, etc.) • May 2 – Additional Functions of DB2 with PHP on IBM i Your thoughts??? 44 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 45. Events where you’ll find Zend… • User groups WMCPA (Lake Geneva, WI) Mar 20-22 (Mike & Alan) • http://wmcpa.org/ NEUGC (Boston, MA) April 2-4 • http://neugc.org/ Alan: March 29: COMMON webcast: more performance tips http://www.common.org/index.php/webcasts/upcoming-webcasts.html April 5: live online event with System i Network New PHP Toolkit for IBM i http://www.systeminetwork.com/events/upcoming-events In New York City? I host the NYC Zend Framework Meetup http://www.meetup.com/ZendFramework-NYCmetro/ 45 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 46. Events where you’ll find Zend…(cont.) • Major venues RPG & DB2 Summit (Ft. Worth, TX) Mar 25-28 • http://www.systemideveloper.com/Summit/conferences.html COMMON Annual Meeting and Expo (Anaheim, CA) May 6-9 • http://www.common.org/index.php/annualmeeting.html COMMON Fall Conference (Columbus, OH) Sep 24-26 • http://www.common.org/index.php/fall-conference-and-expo.html 46 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 47. Contact | Get tips Alan Seiden Strategic Business Systems, Inc, 201-327-9400 17 S. Franklin Tpk aseiden@sbsusa.com Ramsey, NJ, 07446 http://alanseiden.com Twitter: @alanseiden Free PHP/i tips by email: http://alanseiden.com/tips Performance Tuning PHP on IBM i | 47 © All rights reserved. Zend Technologies, Inc.
  • 48. Q&A mike.p@zend.com aseiden@sbsusa.com Watch the recorded webinar: http://bit.ly/A4NjYM 48 © All rights reserved. Zend Technologies, Inc.