Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server Cluster Manager

2,291 views

Published on

Il business on-line stà diventando un fattore sempre più critico per le aziende. In particolare la realizzatione di siti di commercio elettronico che siano affidabili, con meccanismi di fault tolerant, sta diventando un'esigenza sempre più richiesta. In questo webinar verrà spiegato come creare un sito di commercio elettronico in alta affidabilità utilizzando Magento, un software PHP open source per lo sviluppo di applicazioni e-commerce e Zend Server Cluster Manager, l'application server PHP per la realizzazione di architetture web PHP in alta affidabilità.

Published in: Technology
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total views
2,291
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
18
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server Cluster Manager

  1. 1. Performance, High Availability, andScalability of Magento using ZendServerby Enrico ZimuelSenior Consultant & ArchitectZend Technologiesenrico@zend.com © All rights reserved. Zend Technologies, Inc.
  2. 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 devt: http://www.zimuel.it/blog © All rights reserved. Zend Technologies, Inc.
  3. 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.
  4. 4. Magento © All rights reserved. Zend Technologies, Inc.
  5. 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. 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. 7. Zend Server © All rights reserved. Zend Technologies, Inc.
  8. 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. 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. 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.
  11. 11. Performance improvement of Magento using Zend Server © All rights reserved. Zend Technologies, Inc.
  12. 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. 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. 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. 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. 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. 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. 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 doesnt require code changes © All rights reserved. Zend Technologies, Inc.
  19. 19. Example: cache /js/index.php © All rights reserved. Zend Technologies, Inc.
  20. 20. Real use case: Zends online store © All rights reserved. Zend Technologies, Inc.
  21. 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.
  22. 22. Zend Server Cluster Manager © All rights reserved. Zend Technologies, Inc.
  23. 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. 24. Zend Server Cluster Manager architecture Load Balancer Firewall MySQL © All rights reserved. Zend Technologies, Inc.
  25. 25. High availability: session cluster © All rights reserved. Zend Technologies, Inc.
  26. 26. High availability: session cluster (2) © All rights reserved. Zend Technologies, Inc.
  27. 27. High availability and Scalability of Magento usingZend Server Cluster Manager © All rights reserved. Zend Technologies, Inc.
  28. 28. Magento session handlers ● Magento supports different PHP session handlers: ▶ file ▶ eaccelerator ▶ memcached ▶ db● Right now, the version 1.4 of Magento doesnt 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. 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. 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. 31. Questions? © All rights reserved. Zend Technologies, Inc.
  32. 32. Thank you!More info:http://www.zend.comhttp://www.magentocommerce.com © All rights reserved. Zend Technologies, Inc.

×