More Related Content Similar to Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server Cluster Manager (20) More from Zend by Rogue Wave Software (20) Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server Cluster Manager1. Performance, High Availability, and
Scalability of Magento using Zend
Server
by Enrico Zimuel
Senior Consultant & Architect
Zend Technologies
enrico@zend.com
© All rights reserved. Zend Technologies, Inc.
2. About me
● Senior Consultant and Architect at Zend
Technologies since 2008
● Software Engineer since 1996: C/C++, Java,
PHP, Perl, VB/C#/ASP.NET, JavaScript
● More than 10 years of experience in PHP
● International speaker at web conferences:
PHPCon, PHP Barcelona Conference,
PHPDay, ZendCon, etc
● B.Sc. (Hons) in Economics and Computer
Science
● Blog on web dev't: http://www.zimuel.it/blog
© All rights reserved. Zend Technologies, Inc.
3. Summary
● What is Magento?
● What is Zend Server?
● How to optimize the performance of
Magento using Zend Server
● Zend Server Cluster Manager
● High availability and scalability of
Magento using Zend Server
Cluster Manager
© All rights reserved. Zend Technologies, Inc.
5. What is Magento?
● An open source feature-rich eCommerce platform
● Developed in PHP with Zend Framework
● First stable release March 2008
● Main features:
▶ Flexible
▶ Extendable
▶ Modular
▶ Upgradable
▶ Scalable
http://www.magentocommerce.com
© All rights reserved. Zend Technologies, Inc.
6. Magento flavors
● Magento Community
▶ Free to download and use
● Magento Professional
▶ Annual subscription version
▶ Supported by Magento Solution Partners
▶ Warranty included
● Magento Enterprise
▶ Annual subscription version
▶ World class support (SLA)
▶ Additional feature set
▶ Warranty included
© All rights reserved. Zend Technologies, Inc.
7. Zend Server
© All rights reserved. Zend Technologies, Inc.
8. What is Zend Server?
● Production ready, complete
PHP application stack
● Application monitoring and
problem diagnostics
● Multi-level performance
enhancement capabilities
● Cluster management, High
Availability, Scalable
● Technical support, software
updates and security hot
fixes http://www.zend.com/server/
© All rights reserved. Zend Technologies, Inc.
9. Zend Server flavors
● Zend Server Community Edition
▶ Free to download and use
▶ Zend Optimizer+ (PHP accelerator)
▶ Zend Data Cache
▶ Java Bridge
● Zend Server
▶ Annual subscription version
▶ World class support (SLA)
▶ Additional feature set: Monitoring, Code Tracing, Job
Queue, Page Caching, etc
▶ Software updates and security hot fixes
© All rights reserved. Zend Technologies, Inc.
10. Zend Server flavors (2)
● Zend Server Cluster Manager
▶ Annual subscription version
▶ World class support (SLA)
▶ Additional feature set: Monitoring, Code Tracing, Job
Queue, Page Caching, etc
▶ Cluster Manager
▶ Session Clustering
▶ High availability
▶ Scalable architecture
▶ Software updates and security hot fixes
© All rights reserved. Zend Technologies, Inc.
12. Getting better performance from Magento
● Magento optimization
▶ Magento Native Cache
▶ Magento Compilation Module
● Running Magento on Zend Server
▶ PHP opcode accelerator (Zend Optimizer+)
▶ Zend Server Data Cache
▶ Zend Server Page Caching
▶ Diagnosing performance problems
© All rights reserved. Zend Technologies, Inc.
13. Magento native cache
● Magento uses Zend_Cache (Zend Framework
class) for data caching
● Supported backends modules:
●
▶ File ▶ memcached
▶ APC ▶ Zend Server
▶ eAccelerator ▶ etc
● File system backend (default)
● Cache backend model specified in
app/etc/local.xml
● Cache configuration examples can be found in
app/etc/local.xml.additional
© All rights reserved. Zend Technologies, Inc.
14. Major cached entities
● Configuration
● Page Layouts
● HTML Blocks (top navigation, footer, etc)
● Translations
● Data collections (website collection, store collection,
store view collection, etc)
© All rights reserved. Zend Technologies, Inc.
15. Magento compilation module
● Goal: decrease number of file system operations (I/O)
● By default Magento uses 4 additional directories in
include_path in the following order:
▶ app/code/local
▶ app/code/community
▶ app/code/core
▶ lib
● This schema provides extensibility and flexibility and
allows to fully rewrite code of some classes but yet
keeps upgradability
© All rights reserved. Zend Technologies, Inc.
16. Magento compilation module: process
● Copy all the php files to the 4 dirs into one folder
(include/src) and declare one directory for include_path.
This step give 10-25% improvemente in performance.
● Aggregate code of most used php classes to “scope
include” files.
▶ For instance Varien_Object, Mage_Core_Model_Abstract,
Zend_Cache are included in every request. The classes
are aggregated to the “default scope include” file.
● Note: compilation needs to be disabled when
upgrading or developing and should be enabled in
production
© All rights reserved. Zend Technologies, Inc.
17. Zend Optimizer+: PHP opcode accelerator
● Caching compiled PHP opcode in
shared memory
● Automatically enabled when you run
PHP applications using Zend Server
● Usually provide a very significant
performance boost
© All rights reserved. Zend Technologies, Inc.
18. Zend Server Page Caching
● Caches entire HTTP response
● The rule caching is based on different parameters:
URL, $_SESSION, $_SERVER, $_GET, $_COOKIE
● Performance gains are usually very high
● Typically doesn't require code changes
© All rights reserved. Zend Technologies, Inc.
20. Real use case: Zend's online store
© All rights reserved. Zend Technologies, Inc.
21. Diagnosing performance problems
● Bult-in application monitoring alerts
on script execution slowdowns
● Problem diagnostics enables quick
problem isolation
● Code-level profiling and analysis
performed with:
▶ Code Tracing
▶ Integration with Zend Studio
© All rights reserved. Zend Technologies, Inc.
23. Zend Server Cluster Manager
● Zend Server Cluster Manager extends
the benefits of Zend Server across
large-scale PHP deployments
● With Zend Server Cluster Manager you
can implement solutions of:
▶ High Availability
▶ Scalability
▶ Central management
© All rights reserved. Zend Technologies, Inc.
24. Zend Server Cluster Manager architecture
Load Balancer Firewall
MySQL
© All rights reserved. Zend Technologies, Inc.
27. High availability and
Scalability
of Magento using
Zend Server Cluster Manager
© All rights reserved. Zend Technologies, Inc.
28. Magento session handlers
● Magento supports different PHP session handlers:
▶ file
▶ eaccelerator
▶ memcached
▶ db
● Right now, the version 1.4 of Magento doesn't support
the session clustering of Zend Server but there is a
patch to enable the session cluster:
http://arr.gr/magento/magento-1.4-trunk-r69862-issue-23361-01.patch
● This patch will be included in the future version of
Magento
© All rights reserved. Zend Technologies, Inc.
29. The patch
● Edit the file app/code/core/Mage/Core/Model/Session/
Abstract/Varien.php
● Add the following lines (with +):
▶ @@ -59,6 +59,11 @@
case 'eaccelerator':
ini_set('session.save_handler', 'eaccelerator');
break;
+
+ case 'cluster':
+ ini_set('session.save_handler', 'cluster');
+ break;
+
default:
session_module_name('files');
if (is_writable(Mage::getBaseDir('session'))) {
© All rights reserved. Zend Technologies, Inc.
30. High Availability and Scalability for Magento
● Using Zend Server Cluster Manager you can implement
an high availability and scalability architecture for
Magento
● For a Magento ecommerce web sites the advantages
using Zend Server Cluster Manager are:
▶ High availability = Never loose customers
▶ Scalability = Increment the number of customers
▶ Central management = Better support to the customers
© All rights reserved. Zend Technologies, Inc.
31. Questions?
© All rights reserved. Zend Technologies, Inc.