Easy path to better performance: up to 20% increase with PHP 5.4
Evgeniy KulishTechnical Solution Architect (Magento ECG)
Reid ParhamLead Systems Engineer (Copious, Gold Magento Solution Partner )
Legal DisclaimerCopyright © 2014 Magento, Inc. All Rights Reserved.
Magento®, eBay Enterprise™ and their respective logos are trademarks, service marks, registered trademarks, or registered service marks of eBay, Inc. or its subsidiaries. Other trademarks or service marks contained in this presentation are the property of the respective companies with which they are associated.
This presentation is for informational and discussion purposes only and should not be construed as a commitment of Magento, Inc. or GSI Commerce, Inc. d/b/a eBay Enterprise (“eBay Enterprise”) or of any of their subsidiaries or affiliates. While we attempt to ensure the accuracy, completeness and adequacy of this presentation, neither Magento, Inc., eBay Enterprise nor any of their subsidiaries or affiliates are responsible for any errors or will be liable for the use of, or reliance upon, this presentation or any of the information contained in it. Unauthorized use, disclosure or dissemination of this information is expressly prohibited.
PHP 5.3 vs PHP 5.401
What’s wrong with PHP 5.3?
• End of Life• “Old-school” language capabilities ☺• Limited performance
Why PHP 5.4?
• Active support and development• New language features• Performance increase• Optimized memory usage• Magento officially supports PHP 5.4 for CE
1.6-1.8+ and EE 1.11-1.13+
Testing methodology02
Test Database
• 2,000,000 products• 198 categories (depth of 5)• 171 EAV attributes• 100,001 customers• 7 CMS blocks• 9 CMS pages• 1 tax rule• 1 catalog rule
Cluster Configuration
Web Server• CPU: 2 Intel Xeon x3460 2.80GHz• RAM: 32GB• OS: Ubuntu 12.04 LTS 64-bit• Storage: HDD, no RAID
Cluster Configuration
Database Server• CPUs: 4 Intel Xeon x5645 2.40GHz• RAM: 32GB• OS: Ubuntu 12.04 LTS 64-bit• Storage: HDD, Raid10
Software
Magento• Version: 1.13.1 with recommended patches• All Enterprise Edition default features enabled• Flat catalog enabled• All caches enabled and Redis is used• CSS and JS compiled• Magento Cron set to 5 minutes intervals
Software
PHP• 5.3.10-1ubuntu3.11 (20090626)• 5.4.26-1+deb.sury.org~precise+1 (20100525)• 5.5.11+dfsg-3+deb.sury.org~precise+ (20121113)nginx• version: 1.1.19DB• MariaDB 10.0.10 (flavour of MySQL)
Test tools and scenariosTools:• Siege 2.70• ApacheBench, Version 2.3• cURL 7.22.0• GNU bash 4.2.25Scenarios:• 5 products per cart• No third-party integrations• HTTPS disabled
Results03
Home Page Response Time
Home Page Throughput
+14%
+20%+18%
18930 rpm
Category Page Response
-13%-17% -15%
Category Page Throughput
+15%
+20%+18%
Product Page Response Time
-10%
-14%-12%
2939 ms
Product Page Throughput
+11%
+16%+14%
Product Page (Promo) Response Time
-13%-18%
-15%
Product Page (Promo) Throughput
+15%
+23%+18%
Orders Throughput (100 users)
+19%
+27% +26%
Orders Scaling Profile
Risks and Tips04
Risks
• Custom code and extensions compatibility • APC is not always stable on PHP 5.4• PHP 5.4 is not widely supported by hosting
providers
Tips
• Magento PHP 5.4 Patch: http://www.magentocommerce.com/knowledge-base/entry/php54-patch
• Official PHP migration guides• PHP Compatibility: https://github.
com/wimg/PHPCompatibility
• Zend OPcache instead of APC
Conclusion05
Hardware utilization
PHP 5.4/5.5• Web server:
▪ +25% Net Tx▪ +25% disk I/O▪ -16% CPU utilization▪ -12% RAM consumption
• DB server:▪ +20% NetTx▪ +30% disk I/O
• Redis/MySQL: difference can be negligible
Pros
• PHP 5.4 is free ☺• PHP 5.4 is stable• Visible performance increase
▪ Up to 20% general performance improvement▪ Up to 25% orders throughput increase
• Easy to upgrade infrastructure• Magento officially supports PHP 5.4 for the last
three major releases
Cons
• Efforts to make the custom code compatible• Support by extensions developers