Magento Performance

  • 2,333 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,333
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
94
Comments
0
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Enterprise Edition 1.9Maximizing Performance and Scalabilitywith Magento Enterprise EditionMagento White Paper SeriesIn this Performance White Paper, we provide an overview of architecture and design considerations,optimization guidelines, and performance tuning tips for Magento Enterprise Edition as well as for theunderlying hosting environment. We also provide test results from our testing of these optimizationtechniques in order to provide best practices for maximizing the Magento Enterprise Edition performance. ECOMMERCE PLATFORM FOR GROWTH
  • 2. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 1Content IntroductionINTRODUCTION 1 Introduced in 2009, the Magento Enterprise Edition is thePERFORMANCE TESTING METHODOLOGY 2 leading enterprise-grade, feature-rich eCommerce platform built on Open Source technology. The MagentoPERFORMANCE TECHNIQUES AND TEST RESULTS 3 Enterprise Edition provides online merchants with Overview 3 unprecedented flexibility and control over the Environment Components 3 presentation, content, and functionality of their Magento Enterprise Edition Configuration Components 3 eCommerce channel, giving merchants the power to Database Configuration 4 create sites that provide an unrivaled and rich online shopping experience for their customers. Available Memory 4 Multi-Threading 4 Magento Enterprise Edition is an open system designed to Built-In Caching 4 be flexible, completely scalable and configurable, easily Buffers 4 tailored to merchants’ unique technical and business Slow Queries Logging 4 requirements and restraints. However, much like all InnoDB Storage 4 flexible enterprise-grade software, custom configurations Web Server Configuration 5 can often result in a number of places where incorrect Accelerating PHP 7 configuration or insufficient resources can adversely Realpath Cache Configuration 7 affect performance. Bytecode Caching 7 php.ini Configuration 7 In this Performance Whitepaper, we provide an overview of architecture and design considerations, optimization Directory Structure Optimization 8 guidelines, and performance tuning tips for Magento Caching in Magento Enterprise Edition 9 Enterprise Edition as well as for the underlying hosting System Cache 9 environment in an effort to provide best practices for Full Page Cache 11 maximizing the Magento Enterprise Edition performance. Handling Sessions 12 Magento Configuration and Setup 13 Magento Enterprise Edition cron Scripts 13 Rebuilding Indexes 13 Admin Panel Separation 13 Sales Archive 13 Checkout Performance Test Results 13 Frontend Layout Complexity 14 Number of HTTP Requests per Page 14 Using Parallel Connections 14 Media and Static Content Delivery 14 Scalability 15 Scaling Web Nodes 15 Scaling Database Nodes 16 Multi-Core Servers 17 Using Solr as a Search Engine 18SUMMARY OF RECOMMENDATIONS 19APPENDICES 20 Appendix A—Default Configurations 20 Appendix B—Optimized Configurations 25 Appendix C—Software Versions Used 27 Appendix D—Test Scripts/Steps 28 Appendix E—Sample Databases 30 Appendix F— Magento Enterprise Edition Sample Configurations 30© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 3. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 2Performance Testing MethodologyTests and metrics are crucial components of measuring checkout process. It is used to measureand reflecting performance under any given setup. A ordering performance.number of tests have been conducted showing thebenefit of optimizing different configurations and The results discussed and diagrams included in thissetups. document are based on the results of these tests performed on three Magento Enterprise EditionTests were run on dedicated servers provided by installations of different catalog sizes mentioned earlier.Nexcess.net, LLC (www.nexcess.net). Every tested These are denoted as Magento Enterprise Editioninstance was based on the RedHat Enterprise Linux sample data (sd), 10,000 products (10k) and 80,000x86_64 preinstalled by the Nexcess support team with products (80k). Most tests were performed with 10, 20,the latest updates included. PHP and MySQL were 50, and 100 concurrent connections. The full-pageinstalled from the Magento RPM repository. The cache test was performed with 50, 100, 200, and 500Apache and MySQL configuration files used are concurrent connections.included in Appendices A through C. Tests were runagainst three Magento Enterprise Edition installations of Number of concurrent connections is a number ofdifferent catalog sizes—100 SKUs, 10,000 SKUs, and test threads started consequently with a small delay80,000 SKUs catalogs, respectively. The Solr instance between them and running simultaneously. Eachused in the corresponding test was installed on a thread executes the test plan independently of otherdedicated server. test threads and simulates an activity of a real Magento Enterprise Edition user.Tests were performed against the following predefinedtest scenarios: The majority of figures provided in this white paper show both the CMS (homepage) performance and the  CMS Page Test (Homepage)—a default 2 average performance on abstract customer sessions on column homepage with static content. the site. The performance was calculated as the number of transactions per second.  Shopping and browsing Test (URL List)—an average customer session activity consisting of For the charts in figures 1-1, 7-2 and 8-2 where the a series of URLs that include browsing through checkout URL list was used the performance was categories and product pages. In the case of calculated as the number of orders per hour. shopping, customers add products to shopping cart and browse to shopping cart page. A Magento Inc. cooperates with Nexcess.net LLC to complete list of URLs can be found in provide Magento customers with a fully managed and Appendix D. Please note that the list varies customizable hosting solution to grow their business according to the test and data used. on, backed by dedicated account teams providing 24x7  Order placing Test (Checkout)—a special support. Nexcess.net prides itself on its reputation of module that provides testing every Magento providing some of the world’s best hosting solution Enterprise Edition URL involving into the entire coupled with outstanding and unmatched support provided by a top-notch team.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 4. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 3Performance Techniques and Test ResultsOverview Magento Enterprise Edition ConfigurationWhen getting ready to deploy and configure Magento ComponentsEnterprise Edition, some general technical environmentcomponents must be taken into consideration when When trying to achieve the optimal setup, take intocreating an optimized Magento Enterprise Edition account the following configuration components:setup. These range from physical hardware selection  Using proper cache backendand network throughput to the underlying Open Source  Handling sessions with fast storagestack, which are the key underpinnings in driving  Optimizing directory structureMagento Enterprise Edition and its own configurationcomponents.  Using Flat Frontend Catalog  Using Magento Enterprise Edition cron scriptsEnvironment Components  Rebuilding indexes  Hardware  Using a dedicated server for the Admin With a large number of concurrent users, backend having sufficient RAM is critical to handling all  Using sales order archiving incoming connections. In addition, fast modern systems with multi-core CPUs, high front-side  Simplifying frontend layout bus speed, and fast hard drives (preferably at  Reducing the number of HTTP requests on the 7200RPM and higher) will also speed up the page entire application.  Using parallel connections  Network  Delivering media and static content Insufficient network I/O throughput and latencies in the internal network can  Scaling web and database nodes significantly impact the performance of a multi-  Using multi-core servers server setup. Outbound connection latency  Using Solr module that performs Magento may cause delays for a customer while integration with Apache Solr browsing the store frontend.  Software This white paper looks at both environment Magento Enterprise Edition is a PHP components and Magento Enterprise Edition application that runs on the LAMP stack. configuration components that you can modify to Therefore, current, up-to-date, and well- optimize the performance of your Magento Enterprise configured versions of the Linux Kernel, Edition installation. We also present the results of our Apache, MySQL, and PHP will provide better testing to help you determine which might provide you performance results. A proper configuration of with the greatest benefit for your specific installation a web server, a database server, and PHP itself and environment. is required in order to achieve optimal performance results.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 5. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 4 within the range from 8 to 64 and it depends on yourDatabase Configuration max_connections number. thread_concurrency can beProper MySQL configuration is one of the most simply calculated as:important aspects of configuring any Magento [number of CPUs] * multiplierEnterprise Edition environment. Optimizing the MySQL Where the multiplier value is between 2 and 4 and isconfiguration can provide up to a 70% performance determined by testing different values andboost. An incorrect configuration can result in the web benchmarking for the best results in your environment.server spending more time in idle loops waiting toretrieve data from the database. Built-In CachingThe default MySQL installation, even in later versions, table_cache is the number of tables that can beis configured to use far fewer resources than the simultaneously opened by MySQL. A value of 1024average hardware can accommodate. This section goes will be sufficient for most, if not all, Magento Enterprisethrough the most important directives in the MySQL Edition sites.configuration file, my.cnf, and their recommendedvalues. Having the query cache enabled may result in significant speed improvements when you have a large amount of identical queries, which is the case for any eCommerce application. The recommended values forAvailable Memory the Magento Enterprise Edition database server are:Magento Enterprise Edition uses InnoDB as its primary  query_cache_size 64Mtable storage engine type. InnoDB, unlike MyISAM, can  query_cache_limit 2Muse the in-memory buffer pool to cache table indexesand data. Less disk I/O is needed to get data from harddrives when the value of the in-memory buffer pool is Buffersset higher. A general recommendation is to set this A sort buffer is used for optimizing sorting in ORDERparameter up to 80% of the available RAM for a BY and GROUP BY queries. 8M is the recommendeddedicated database server. In cases where both the web value for the Magento Enterprise Edition database.server and the database are running on the samemachine, it is recommended to split the entire memory Slow Queries Loggingpool into two parts, each having its own primaryassigned portion (e.g. on a single server with 6 GB Logging slow queries is useful for debugging purposes,RAM installed, it can be split to have 2-2.5 GB used by but it should be disabled in production use.MySQL with the rest left for the web server). InnoDB StorageThe key parameter in this section is The InnoDB engine works with a single data storageinnodb_buffer_pool_size, which should be set to use as file that usually grows in time. It is a good idea to havemuch available memory as possible. the engines initial state configured to be at least twiceTable 1. Recommended innodb_buffer_pool_size settings. as large as the Magento Enterprise Edition databaseServer Type Innodb_buffer size, and innodb_autoextend_increment should be set _pool_size to a fairly high value in order to avoid frequent data fileCombined web and db server, 6 GB RAM 2-3 GB extending operations.Dedicated database server, 6 GB RAM 5 GBDedicated database server, 12 GB RAM 10 GB InnoDB supports transaction operations by using transaction log files. Transaction log files are generally configured in groups of two. The bigger the size of aMulti-Threading transaction log file the less often it performs I/OToday’s industry-standard servers typically have more operations on primary storage files. However, in case athan 1 CPU installed with 2 or more cores each. The database restore is required, more time will be needed.InnoDB engine can effectively use multiple threads toserve more concurrent connections. Do not use multiple InnoDB tablespaces unless you areinnodb_thread_concurrency should be set to a value sure you know the benefits for your particular hardwarethat equals to or is greater than 8, even for a single and environment.CPU. The recommended value is calculated with thefollowing equation: 2 * [numberofCPUs] + 2thread_cache_size allows caching of clients threadswhen a client disconnects and reusing them when newconnections are created. The recommended value is© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 6. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 5 When a web server is under a heavy load, keepingWeb Server Configuration persistent connections becomes disadvantageous, thusThe most commonly used Apache configuration the KeepAlive directive should always be disabled.provides PHP support with mod_php. This Apacheconfiguration loads a large number of modules. mod_deflate allows your server to compress contentHowever, most of these modules are not necessary for before sending it to the browser. Magento Enterpriserunning Magento Enterprise Edition. This becomes Edition .htaccess file already includes necessarymore relevant in a multi-server setup where different settings to enable the compression.tasks can be split up into different nodes and each nodehas to be configured to perform its specific task the Make sure to uncomment this section in order to decreasebest. the page load time.The minimum required list of Apache modules includes Additionally, you can take advantage of eliminatingthe following: directory structure scans for the .htaccess files by  mod_expires — generates content expiration and moving all .htaccess directives into the appropriate cache control headers <Directory> sections of the main httpd.conf file.  mod_deflate — compresses content before it is delivered to the client In order to reduce the I/O throughput on Apache web  mod_mime — associates the requested file with nodes in a multi-server setup, it is advisable to use a its type and behavior load balancer, which can handle all logging activity instead of having that activity handled by the Apache  mod_dir — serves directory index files backend servers.  mod_rewrite — supports Search Engine Friendly URL’s As the server configuration chosen for the performance  mod_authz_host — limits access to specific files testing has rather big RAM size, for web server  mod_authz_user — might be required in a optimization we intentionally used the web server staging environment to set up password configuration with RAM reduced down to 8 GB. authentication, but on a live site it is not necessary All the following tests were performed using optimized If you are running other web applications on the same configurations for both Apache and MySQL. server, consult which Apache modules are required for them.With all unused Apache modules disabled bycommenting out the corresponding ‘LoadModule’ linesin httpd.conf, it is possible to cut memory consumedby Apache, which will allow more concurrentconnections to be handled with the same amount ofRAM.Another important web server configurationcomponent is setting an optimal number for runningApache processes. The best method to do this is tocreate the required number of Apache processes whenthe web server is started. This number should becalculated by measuring the memory amountconsumed by Apache under the maximum load. This iscurrently the best threading method as mpm_workercannot be safely used with PHP and the process offorking every new Apache child in the mod_preforkmode is an expensive operation.Also, note that the ServerLimit and MaxClients valuesshould be specified explicitly to prevent running out ofphysical memory and going into a swap file, whichcauses a severe degradation of web serverperformance. MaxRequestsPerChild can be set to thedefault value of 4000.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 7. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 6Figure 1-1: DefaultEnvironment and MagentoEnterprise Edition setup vs.Optimized MySQL andApache configuration forShopping scenario test.Results: MySQL optimizationprovides a performanceincrease on larger databases.Figure 1-2: DefaultEnvironment and MagentoEnterprise Edition setup vs.Optimized MySQL andApache configurationorderplacing scenario test.Results: Similar to thetransaction performance,MySQL optimizationprovides a product orderperformance increase onlarger databases.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 8. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 7Accelerating PHP Only eAccelerator versions earlier than 0.9.6 can been used with Magento.PHP is an interpreted scripting language. The processof running a PHP script includes the following steps: php.ini Configuration  Reading a script file from the hard drive In php.ini, you can enable only the minimum set of  Parsing and compiling bytecode PHP extensions required to run Magento Enterprise  Running the bytecode Edition to reduce the memory usage and speed up the PHP performance. The necessary extensions are asRealpath Cache Configuration follows:File I/O optimization is not limited to using faster hard  PDO_MySQLdrives only. To provide better optimization, increasing  simplexmlthe default realpath_cache_size and realpath_cache_ttl  mcryptvalues in the php.ini settings is highly recommended.  hashAccording to our tests, the recommended values on  GDproduction servers are as follows:  DOM  realpath_cache_size=32k  iconv2  realpath_cache_ttl=7200  SOAP (if the Magento Webservices API is to be used)Bytecode Caching In case of using APC bytecode cache, the modificationThe process of reading PHP scripts from disk and time check option (apc.stat) must be disabled.compiling them can be eliminated by enabling PHPaccelerators. PHP accelerators cache compiled If you are running other PHP applications on the samebytecode, which results in less file and system I/O. The server, consult which PHP extensions are required forwell-known eAccelerator and APC PHP accelerators them.are tested and partially compatible with MagentoEnterprise Edition. Their built-in shared memory canalso be used as Magento Enterprise Edition cache All the following tests were performed using the APCstorage, which will be covered later in this document. bytecode cache enabled .Figure 2: Default setup vs.eAccelerator vs. APC forCMS (Homepage) andshopping scenario tests.Results: Adding a PHPaccelerator provides aperformance boost from 20%to 100% when different PHPfiles are used. According toour tests, APC is 3-5% betterthan eAccelerator in thebytecode caching mode.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 9. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 8 extra require_once directives within the configurationDirectory Structure Optimization file. Additional require_once calls are not required The following test was performed with APC bytecode because Magento Enterprise Edition implements its cache feature disabled, there is no sense to use both APC own autoload function that handles all necessary file bytecode cache and Directory Structure Optimization requests on demand. feature at the same time.Optimizing the directory structure can also help fine- In addition, recent Magento Enterprise Edition versionstune Magento Enterprise Edition performance in cases (since version 1.3.x) include the Magento Enterprisewhere it’s not possible to use APC bytecode cache. It is Edition Compilation Module (Mage_Compiler) thathighly recommended to use the Zend Framework provides extra optimization by placing all files in onedistribution bundled within Magento Enterprise Edition directory and combining the most used classes in a fewas it is adjusted to significantly reduce the number of single files.system calls required to locate a file in the directorystructure. This is accomplished by commenting out allFigure 5: Compilation enabled vs.Compilation disabled.Conclusion: Enabling MagentoEnterprise Compilation Moduleprovides a 10-15% additionalperformance boost© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 10. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 9 Once the cache is enabled and one of the above-Caching in Magento Enterprise mentioned shared memory backends is used, MagentoEdition automatically uses a TwoLevel cache backend (see http://framework.zend.com/manual/en/zend.cache.bac kends.html for more information). In which case, the specified cache backend is used as a fast cache. The file system cache backend is used as a slow cache forSystem Cache single web node environments, and the MySQLMagento Enterprise Edition can cache frequently used database is used as a slow cache for multiple web nodedata using various cache backends. environments.Using a cache backend will always improve the This is fully customizable and can be easily set inperformance of Magento Enterprise Edition. By default, app/etc/local.xml, as shown in the Appendix F.when installed, Magento Enterprise Edition is set to usethe file system as a cache backend. While the filesystem cache is the most reliable storage with When using APC, the Source Code Compiler must beunlimited size, it does not provide the best disabled.performance. Make sure that if you are using APC or memcached asMagento Enterprise Edition v. 1.9 can also work with backends, you configure each of them with enoughthe following cache backends that provide memory to include all cached data; otherwise, a backendperformance better than that of the file system cache may purge the required cache hierarchy structure.backend:  APC—a bytecode cache for PHP which also provides a shared memory storage for application data  Memcached—a distributed, high-performance caching systemFigure 3-1: Caching enabled vs.Caching disabledResults: It may be required todisable the built-in MagentoEnterprise Edition cache (that is,by default, enabled after theinstallation) during sitedevelopment. But be sure thatcaching is enabled on productionsites. Our test show that disabledcache makes the store frontend 5-6 times slower and less responsiveunder a load.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 11. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 10Figure 3-2: Cache backends:file system vs. APC vs.Memcached.Results: APC gives the bestresults, which are 3-5% betterthan the file system backendresults. However, usingMemcached is recommendedfor installations which involvemultiple web nodes, because,in case of multiple webnodes, the APC and filesystem cache backends needadditional administration forsynchronizing data betweennodes.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 12. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 11 From the tests performed, Full page cache stores andFull Page Cache uses generated full web page for forthcoming users. The presence of the cache significantly improves theMagento Enterprise Edition can cache entire page performance of the website by up to 9.5 times wherecontents and return statically stored (X)HTML files the hardware experience a decreasing load duringrather than building pages dynamically for each regular surfing through the websiterequest. Only CMS, category, and product view pagessupport full page caching.The homepage is the CMS page that is accessed mostfrequently. Full Page Cache allows the web server tosignificantly increase the performance on pages thatcan be cached statically.Figure 4-1: Full Page Cacheon the CMS (Homepage):enabled vs. disabled.Results: Our tests show thatwith Full Page Cacheenabled, the performanceincrease for the homepageexponentially depends on thenumber of simultaneousconcurrent connections.Increasing the number ofconcurrent connections from10 to 100 leads to thehomepage performanceincrease up to 4.7 times.Figure 4-2: Full Page Cachefor browsing and shoppingscenarios : enabled vs.disabled.Results: The performancebehavior for thecachableURLs resembles tests for theCMS (homepage), i.e.increasing the number ofconcurrent connections from10 to 100 leads to theperformance increase up to9.5 times; while for thestandard set of URLs, theperformance gives 150%increase.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 13. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 12Handling SessionsMagento Enterprise Edition uses PHP sessions to storecustomer session data.The default method is to use the file system storage,which works well if you are using a single web server.Its performance can be improved by configuring thetmpfs in-memory partition to avoid extra hard drive I/Oactivity.In a clustered environment with multiple web servers,the first option for handling sessions is to use a loadbalancer capable of associating client requests withspecific web nodes based on the client IP or the clientcookies. If you are in a clustered environment and notusing a load balancer capable of the above-mentioned,it is necessary to share the session data among all webservers. Magento Enterprise Edition supports twoadditional session storage types that can be used in thiscase.Though fully supported, storing session data in thedatabase is not recommended as it puts an additionalload on the main database, and therefore, requires aseparate database server to efficiently handle multipleconnections under load in most cases. However,storing session data in the database provides anadvantage in case its important to keep user sessions incase of any server crashes. Database-driven sessionswill not be damaged when one or all servers in thecluster are down.The memcached session storage is free of thesedisadvantages.The memcached service can be run on one of thecluster servers to provide fast session storage for allweb nodes of the cluster. Though, because of extraoverhead processing compared to raw file systemsession files, the memcached session storage does notshow any performance improvements when used in asingle server configuration.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 14. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 13 Sales Archive As it has been previously noted, generally backendMagento Configuration and Setup operations require more server resources, especially when the administrator works with orders. A hugeMagento Enterprise Edition cron Scripts number of orders being processed by a Magento Enterprise Edition installation can be the cause of serverThere are some activities in Magento Enterprise Edition performance failure. However, most of the orders arethat must be scheduled with cron. For example, catalog just listed in the backend; they do not need to beprice rules generate price indexes for three days ahead actively processed by the administrator.when a rule is applied from the Admin Panel. In orderensure catalog price rules do not expire in three days, Sales archiving introduced in Magento Enterprisethey must be refreshed by the Magento Enterprise Edition v1.8 helps the administrator list and work onlyEdition cron scripts on a daily basis. There are also with those orders that are currently in use. The rest ofother scheduled tasks in Magento Enterprise Edition, the orders are available in the archive; thus, Magentoand it is important not to configure all of them to run does not need to manipulate old order data whensimultaneously as it may overload the master database. processing daily orders. This lets the administrator perform order management operations faster and Note on Scheduled Backups: reduces the overall server load for administration It is a general best practice to run important data backup routines. on servers on a daily basis. Though it is not under the Magento Enterprise Edition scope, make sure that on your server the system backups are run at a time when the Sales archive operation separates the sales entity grid number of active customers and the server load are database tables. While the table for archived orders minimal. contains a full set of data, the table for active orders contains only the records corresponding to active orders. This decreases the amount of data in the grid tables and improves the performance of sorting/filteringRebuilding Indexes operations in the admin grids.The process of rebuilding the Magento EnterpriseEdition index tables, for example, layered navigation Checkout Performance Test Resultsindexes or catalog price rules indexes, is a resourceconsuming operation. Prior to Enterprise Edition v1.8, the checkout process contained two large database transactions—one for the customer increment calculation (if a new customer is Do not rebuild indexes during the period of highest created during the checkout) and the other to check customer activity. and decrease the stock items quantity. During heavy traffic times, this could cause delays on the frontend forMagento Enterprise Edition includes content staging customers attempting to checkout. Only one checkoutfunctionality that can be used for previewing and at the same time was possible. In Enterprise Editionscheduling catalog and store updates at an appropriate v1.8 and later versions the checkout process has beentime. significantly refactored. So, the stock operations transaction has been separated into smaller quickerIn the future Magento Enterprise Edition versions, there database requests, and the customer increment logicwill be an option to use a separate database for has become optional (it is disabled by default now).calculating index data in order not to affect the Due to this change, locks on the database tables usedperformance of the store. for the checkout are avoided, and simultaneous checkouts for many customers are possible.Admin Panel SeparationAdmin Panel operations in general consume more Magento Enterprise Edition v. 1.8 has also introduced aresource than frontend activities. Often they require flat structure for the Sales module data, which results inincreasing PHP memory limits or having extra an additional checkout performance increase.extensions compiled into PHP. Therefore, having adedicated admin server can help make Admin Paneloperations faster while not impacting the frontendconfiguration and performance. This separation can bedone by specifying different base URL’s on a globallevel for the Admin Panel than for the frontendwebsites and stores. Each separate domain name canthen be served by a separate server.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 15. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 14Frontend Layout Complexity Using Parallel ConnectionsThe Magento Enterprise Edition page generation Browsers can load page elements in parallel. Specifyingprocess implies building a block object hierarchy different domains for media, skin, and JavaScript URLsspecified by the frontend theme layout. The fewer is the in the Magento Enterprise Edition configurationnumber of blocks on a page, the less time is required to (System→Configuration→GENERAL→Web) will helpinstantiate block objects. speed the page rendering time in the browser, as most browsers limit the number of downloads to 2-4 parallelDefault Magento Enterprise Edition themes were threads per domain name.designed to represent all Magento Enterprise Editionfeatures. The themes introduce a large number of small Other web page design recommendations are beyondblocks on most pages. A specific store will benefit from the scope of this document. You can find the detaileda custom-built theme that facilitates practical customer list of web site design best practices at the Yahooexperience while taking into account business and Developer Network atproduct specifics. http://developer.yahoo.com/performance/rules.html.Customizing a proper design theme, simplifying the Media and Static Content Deliverylayout structure, and combining small blocks can makethe page generation time 4-5% faster than using of a Though Apache is a fast and reliable web server, therecomplex layout with a lot of blocks on the page. are other web server options that are known to more efficiently serve static content and media files which consumes less memory and CPU time.Number of HTTP Requests per PageIn order to improve page load and processing time, it is Among the widely used are nginx, lighttpd, andimportant to reduce the number of HTTP requests per tinyhttpd. These are the multiplexing web serverspage. Magento Enterprise Edition allows combining which do not have built-in scripting languages supportmultiple JavaScript files and style sheets into a smaller but can handle thousands of simultaneous connectionsnumber of files. per server. This process is fully under the control of a theme developer Static content delivery can be improved by using a who implements it through the flexible system of theme caching reverse proxy, such as Squid or an HTTP layouts instead of directly including the JavaScript files accelerator like Varnish. A reverse proxy can locally from within the templates. cache the content received from Apache in order to reduce the load on the Apache backends.The following is the example of how the number ofJavaScript files can be properly reduced: Another way to reduce your server load and to get smaller network latencies is the use of content delivery<reference name="head"> networks (CDN). Most CDNs support pushing media <action method="addJs"> <script>custom_js/gallery.js</script> content through a simple API and can be integrated </action> with the Magento Enterprise Edition backend quite <action method="addJs"> easily. <script>custom_js/intro.js</script> </action></reference>The previous layout file example combines the twoscripts in a single file that will be added to the pagewith one request tojs/index.php?c=auto&f=,custom_js/gallery.js,custom_js/intro.js.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 16. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 15Scalability Scaling Web Nodes Magento Enterprise Edition can be scaled over anyMagento Enterprise Edition is designed to be able to number of additional web servers. This allows handlingtake advantage of a multi-server setup in a clustered a bigger number of concurrent requests by simplyenvironment. Web nodes are not limited to be of introducing new web nodes when the number of pageexactly the same type. There may be different nodes, views and visitors grows. Doubling the number of websuch as frontend servers, static content and media nodes can provide a performance increase of overservers, and a separate admin panel server each 90%.performing different tasks.Figure 7-1: Single frontendserver vs. multiple frontendserversResults: Enabling a secondfrontend web server almostdoubles the number ofrequests that can be handledby this setup. Introducingevery new web node adds upto a 95-99% performanceincrease with higherconcurrencies.Figure 7-2: Single frontendserver vs. multiple frontendserversResults: Enabling a secondfrontend web server almostdoubles the number ofrequests that can be handledby this setup. Introducingevery new web node adds upto a 95-99% performanceincrease with higherconcurrencies.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 17. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 16Scaling Database NodesMagento Enterprise Edition works with a database in amanner that easily allows separating databaseconnections for read and write activities. Eachparticular module can use its own connections ifneeded. This is fully customizable and can be easily setin app/etc/local.xml as shown in Appendix F.In case of separating read and write databaseoperations, there must be a master database instancethat processes only write requests, and a slave databaseinstance that is used for reading data. There must be aninstant replication organized between the master andthe slave instances.The replication speed is a critical parameter and mustbe as high as possible.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 18. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 17Multi-Core ServersAs it is expected, the test results show betterperformance on servers with more CPU coresper server as can be seen from the following figures.Figure 8-1: 1-core/4GBvirtual server (SATA HDD)vs. 2-core/8GB virtual server(SATA HDD) vs. 8-core/16GB dedicated server(SAS 15K, RAID1).Conclusion: A low-levelsingle-core server with asingle SATA hard drive and4GB RAM installed is able tohandle about 9 trans/sec onhomepage tests and up to 4trans/sec during an averagecustomer session. Addingmore cores and faster harddrives configured in a RAIDarray allows for the handlingof more page requests. Dual-core server with SATA harddrive is able to handle 18trans/sec on homepage andup to 7 trans/sec on customersession URL test, while 8-core server with SAS 15K hard drives in RAID1 array can handle 38 trans/sec on homepage and about 17 trans/sec oncustomer session URL test with hundreds of concurrent customer sessions which allows for the serving of more page views for more visitors. Inour tests, we were able to get the same requests per second with 400 concurrent sessions, but to keep page response time low, one mightconsider adding another web node for serving such traffic.Figure 8-2: 1-core/4GBvirtual server (SATA HDD)vs. 2-core/8GB virtual server(SATA HDD) vs. 8-core/16GB dedicated server(SAS 15K, RAID1).Conclusion: A low-levelsingle-core server with asingle SATA hard drive and4GB RAM installed is able tohandle about 6000orders/hour during anaverage customer session.Adding more cores and fasterhard drives configured in aRAID array allows for thehandling of more orders perhour. Dual-core server withSATA hard drive is able tohandle 12000 orders/hour oncustomer session URL test,and, finally, 8-core server withSAS 15K hard drives inRAID1 array can handle up to27000 orders/hour on customersession URL test.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 19. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 18 provides better performance on larger catalogs withUsing Solr as a Search Engine more SKUs, thus it is recommended to use Solr whenSince v1.8, Magento Enterprise Edition supports the possible, unless you are not running a store with aApache Solr search engine and provides the small catalog.Enterprise_Search module that allows choosingbetween the built-in MySQL fulltext search engine and Solr is not built into Magento and must be installed andthe Solr. Either of these two search engines can be set up separately. Once installed, the integration ofselected in the backend configuration under Magento and Solr is simply a set of configurationSystem→Configuration→CATALOG→Catalog→ settings in the Admin Panel.Catalog Search:  MySql Fulltext  SolrThe fulltext search is used by default in case Solr is notavailable, not effective, or cannot be used in thecurrent Magento configuration. However, Apache SolrFigure 9-1: Search engineperformance for search:database search engine vs.Solr.Results: Enabling the Solrintegration gives the searchperformance increase up to14% on bigger database andhigher concurrentconnections number. As aside-effect, using Solrsignificantly increases thesearch quality.Figure 9-2: Search engineperformance for catalogfilter: database searchengine vs. SolrResults: Enabling the Solrintegration gives the catalognavigation (filtering)performance increase up to25% on bigger database andhigher concurrentconnections number.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 20. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 19Summary of RecommendationsWithout a doubt, planning, deploying, and configuring your Magento Enterprise Edition environment requires greatattention to detail in order to get the best performance out of it. Considerations on physical platform, networkperformance, stack configuration and fine-tuning as well as a suitable Magento Enterprise Edition installation each playan important role in ensuring that you get the best performance possible out of your unique setup. The following is thereview of some key points discussed in this white paper.  We strongly recommend that you optimize your MySQL and Apache configurations. Doing so can provide a 55- 70% performance increase, especially on dynamic pages. The default MySQL and Apache setups are configured to use far fewer resources than the average hardware can provide and are not able to handle a high number of concurrent customer sessions, which can result in unpredictable and sometimes erratic server loads and behavior.  Adding a PHP accelerator is another important aspect of configuring your Magento Enterprise Edition environment. eAccelerator shows good results with 40%-600% increase. According to our tests, APC is even more efficient showing an additional 15-20% performance boost over eAccelerator.  Enabling caching on production sites is vital. The disabled cache can make the web store frontend 5-6 times slower and less responsive under load.  When configuring Magento Enterprise Edition on a single server, consider using default file system cache backend or APC fast storage cache backend, which provide similar results. However, in case of using several web nodes, it is better to switch to the memcached cache backend. If used on multiple web nodes, APC and file system cache backends need additional administration to synchronize data between nodes.  Enabling the Full Page Cache feature can improve the Magento Enterprise Edition performance for any page with static content (homepage or other CMS pages), so if you considered having the homepage static and using several landing pages for your website, it is highly recommended to turn Full Page Cache on.  In a single server setup, there is no need to change the default file system session storage as it shows the best results. However, in clustered environment, if the used load balancer cannot associate client requests with specific web nodes based on the client IP or the client cookies, it may be required to use either the memcached or the database shared session storage. The memcached session storage shows the results that are close to those of the default storage or even 1-2% worse. The database session storage should be used in a clustered environment only if the memcached storage cannot be used for some reasons.  Installing the Magento Enterprise Edition Compilation Module and enabling compilation can give 10-15% additional performance boost.  If you’re able to install and set up the Apache Solr search engine, it is recommended to have the Solr search engine support enabled in the catalog search configuration options. The search quality increases significantly even in case the product list is short and it gives only a small performance increase (not more than 25% on catalog navigation and 14% on search).  Using modern multi-core CPUs and fast hard drives improves the results even more. A low-level single-core server with a single SATA hard drive and 4GB RAM installed is able to handle about 9 trans/sec on homepage tests and up to 4 trans/sec during an average customer session. Dual-core server with SATA hard drive is able to handle 18 trans/sec on homepage and up to 7 trans/sec on customer session URL test, while 8-core server with 15K hard drives in RAID1 array can handle 38 trans/sec on homepage and about 17 trans/sec on customer session URL test with hundreds of concurrent customer sessions which allows for the serving of more page views for more visitors.The Magento Enterprise Edition is the leading Open Source eCommerce platform built on solid technology that givesyou the flexibility, configurability, and performance you need to develop an online channel that suits the unique needsof your business. Attention to these configuration details can go a long way, and with a little bit of fine-tuning, theMagento Enterprise Edition’s rock solid stability and performance give you the ultimate value when it comes to servingas many customers as richly and as cost-effectively as possible, while providing you with the edge necessary todifferentiate yourself from, and stay ahead of, your competitors.© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 21. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 20AppendicesAppendix A—Default ConfigurationsApache Web Server ConfigurationServerTokens OSServerRoot "/etc/httpd"PidFile run/httpd.pidTimeout 120KeepAlive OffMaxKeepAliveRequests 100KeepAliveTimeout 15StartServers 8MinSpareServers 5MaxSpareServers 20ServerLimit 256MaxClients 256MaxRequestsPerChild 4000Listen 80LoadModule auth_basic_module modules/mod_auth_basic.soLoadModule auth_digest_module modules/mod_auth_digest.soLoadModule authn_file_module modules/mod_authn_file.soLoadModule authn_alias_module modules/mod_authn_alias.soLoadModule authn_anon_module modules/mod_authn_anon.soLoadModule authn_dbm_module modules/mod_authn_dbm.soLoadModule authn_default_module modules/mod_authn_default.soLoadModule authz_host_module modules/mod_authz_host.soLoadModule authz_user_module modules/mod_authz_user.soLoadModule authz_owner_module modules/mod_authz_owner.soLoadModule authz_groupfile_module modules/mod_authz_groupfile.soLoadModule authz_dbm_module modules/mod_authz_dbm.soLoadModule authz_default_module modules/mod_authz_default.soLoadModule ldap_module modules/mod_ldap.soLoadModule authnz_ldap_module modules/mod_authnz_ldap.soLoadModule include_module modules/mod_include.soLoadModule log_config_module modules/mod_log_config.soLoadModule logio_module modules/mod_logio.soLoadModule env_module modules/mod_env.soLoadModule ext_filter_module modules/mod_ext_filter.soLoadModule mime_magic_module modules/mod_mime_magic.soLoadModule expires_module modules/mod_expires.soLoadModule deflate_module modules/mod_deflate.soLoadModule headers_module modules/mod_headers.soLoadModule usertrack_module modules/mod_usertrack.soLoadModule setenvif_module modules/mod_setenvif.soLoadModule mime_module modules/mod_mime.soLoadModule dav_module modules/mod_dav.soLoadModule status_module modules/mod_status.soLoadModule autoindex_module modules/mod_autoindex.soLoadModule info_module modules/mod_info.soLoadModule dav_fs_module modules/mod_dav_fs.soLoadModule vhost_alias_module modules/mod_vhost_alias.soLoadModule negotiation_module modules/mod_negotiation.soLoadModule dir_module modules/mod_dir.soLoadModule actions_module modules/mod_actions.soLoadModule speling_module modules/mod_speling.soLoadModule userdir_module modules/mod_userdir.soLoadModule alias_module modules/mod_alias.soLoadModule rewrite_module modules/mod_rewrite.soLoadModule proxy_module modules/mod_proxy.soLoadModule proxy_balancer_module modules/mod_proxy_balancer.soLoadModule proxy_ftp_module modules/mod_proxy_ftp.soLoadModule proxy_http_module modules/mod_proxy_http.soLoadModule proxy_connect_module modules/mod_proxy_connect.soLoadModule cache_module modules/mod_cache.soLoadModule suexec_module modules/mod_suexec.soLoadModule disk_cache_module modules/mod_disk_cache.soLoadModule file_cache_module modules/mod_file_cache.soLoadModule mem_cache_module modules/mod_mem_cache.soLoadModule cgi_module modules/mod_cgi.soLoadModule version_module modules/mod_version.soUser apacheGroup apache© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 22. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 21ServerAdmin root@localhostUseCanonicalName OffDocumentRoot "/var/www/html"<Directory /> Options FollowSymLinks AllowOverride None</Directory><Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all</Directory>DirectoryIndex index.html index.html.varAccessFileName .htaccess<Files ~ "^.ht"> Order allow,deny Deny from all</Files>TypesConfig /etc/mime.typesDefaultType text/plain<IfModule mod_mime_magic.c># MIMEMagicFile /usr/share/magic.mime MIMEMagicFile conf/magic</IfModule>HostnameLookups OffErrorLog logs/error_logLogLevel warnLogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combinedLogFormat "%h %l %u %t "%r" %>s %b" commonLogFormat "%{Referer}i -> %U" refererLogFormat "%{User-agent}i" agentCustomLog logs/access_log combinedServerSignature OnAlias /icons/ "/var/www/icons/"<Directory "/var/www/icons"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all</Directory>ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"<Directory "/var/www/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all</Directory>IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTableAddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzipAddIconByType (TXT,/icons/text.gif) text/*AddIconByType (IMG,/icons/image2.gif) image/*AddIconByType (SND,/icons/sound2.gif) audio/*AddIconByType (VID,/icons/movie.gif) video/*AddIcon /icons/binary.gif .bin .exeAddIcon /icons/binhex.gif .hqxAddIcon /icons/tar.gif .tarAddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .ivAddIcon /icons/compressed.gif .Z .z .tgz .gz .zipAddIcon /icons/a.gif .ps .ai .epsAddIcon /icons/layout.gif .html .shtml .htm .pdfAddIcon /icons/text.gif .txtAddIcon /icons/c.gif .cAddIcon /icons/p.gif .pl .pyAddIcon /icons/f.gif .forAddIcon /icons/dvi.gif .dviAddIcon /icons/uuencoded.gif .uuAddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tclAddIcon /icons/tex.gif .texAddIcon /icons/bomb.gif core© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 23. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 22AddIcon /icons/back.gif ..AddIcon /icons/hand.right.gif READMEAddIcon /icons/folder.gif ^^DIRECTORY^^AddIcon /icons/blank.gif ^^BLANKICON^^DefaultIcon /icons/unknown.gifReadmeName README.htmlHeaderName HEADER.htmlIndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,tAddLanguage ca .caAddLanguage cs .cz .csAddLanguage da .dkAddLanguage de .deAddLanguage el .elAddLanguage en .enAddLanguage eo .eoAddLanguage es .esAddLanguage et .etAddLanguage fr .frAddLanguage he .heAddLanguage hr .hrAddLanguage it .itAddLanguage ja .jaAddLanguage ko .koAddLanguage ltz .ltzAddLanguage nl .nlAddLanguage nn .nnAddLanguage no .noAddLanguage pl .poAddLanguage pt .ptAddLanguage pt-BR .pt-brAddLanguage ru .ruAddLanguage sv .svAddLanguage zh-CN .zh-cnAddLanguage zh-TW .zh-twLanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TWForceLanguagePriority Prefer FallbackAddDefaultCharset UTF-8AddType application/x-compress .ZAddType application/x-gzip .gz .tgzAddHandler type-map varAddType text/html .shtmlAddOutputFilter INCLUDES .shtmlAlias /error/ "/var/www/error/"<IfModule mod_negotiation.c><IfModule mod_include.c> <Directory "/var/www/error"> AllowOverride None Options IncludesNoExec AddOutputFilter Includes html AddHandler type-map var Order allow,deny Allow from all LanguagePriority en es de fr ForceLanguagePriority Prefer Fallback </Directory></IfModule></IfModule>BrowserMatch "Mozilla/2" nokeepaliveBrowserMatch "MSIE 4.0b2;" nokeepalive downgrade-1.0 force-response-1.0BrowserMatch "RealPlayer 4.0" force-response-1.0BrowserMatch "Java/1.0" force-response-1.0BrowserMatch "JDK/1.0" force-response-1.0BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefullyBrowserMatch "MS FrontPage" redirect-carefullyBrowserMatch "^WebDrive" redirect-carefullyBrowserMatch "^WebDAVFS/1.[0123]" redirect-carefullyBrowserMatch "^gnome-vfs/1.0" redirect-carefullyBrowserMatch "^XML Spy" redirect-carefully© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 24. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 23BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefullyMySQL Configuration[mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=mysqlold_passwords=1max_connections=100[mysqld_safe]log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pidPHP Configuration[PHP]engine = Onzend.ze1_compatibility_mode = Offshort_open_tag = Onasp_tags = Offprecision = 14y2k_compliance = Onoutput_buffering = 4096zlib.output_compression = Offimplicit_flush = Offunserialize_callback_func=serialize_precision = 100allow_call_time_pass_reference = Offsafe_mode = Offsafe_mode_gid = Offsafe_mode_include_dir =safe_mode_exec_dir =safe_mode_allowed_env_vars = PHP_safe_mode_protected_env_vars = LD_LIBRARY_PATHdisable_functions =disable_classes =expose_php = Onmax_execution_time = 30 ; Maximum execution time of each script, in secondsmax_input_time = 60 ; Maximum amount of time each script may spend parsing request datamemory_limit = 128M ; Maximum amount of memory a script may consume (128MB)error_reporting = E_ALLdisplay_errors = Offdisplay_startup_errors = Offlog_errors = Onlog_errors_max_len = 1024ignore_repeated_errors = Offignore_repeated_source = Offreport_memleaks = Ontrack_errors = Offvariables_order = "EGPCS"register_globals = Offregister_long_arrays = Offregister_argc_argv = Offauto_globals_jit = Onpost_max_size = 8Mmagic_quotes_gpc = Offmagic_quotes_runtime = Offmagic_quotes_sybase = Offauto_prepend_file =auto_append_file =default_mimetype = "text/html"© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 25. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 24doc_root =user_dir =enable_dl = Onfile_uploads = Onupload_max_filesize = 2Mallow_url_fopen = Onallow_url_include = Offdefault_socket_timeout = 60[Syslog]define_syslog_variables = Off[mail function]; For Win32 only.SMTP = localhostsmtp_port = 25; For Win32 only.;sendmail_from = me@example.com; For Unix only. You may supply arguments as well (default: "sendmail -t -i").sendmail_path = /usr/sbin/sendmail -t -i[SQL]sql.safe_mode = Off[ODBC]odbc.allow_persistent = Onodbc.check_persistent = Onodbc.max_persistent = -1odbc.max_links = -1odbc.defaultlrl = 4096odbc.defaultbinmode = 1[MySQL]mysql.allow_persistent = Onmysql.max_persistent = -1mysql.max_links = -1mysql.default_port =mysql.default_socket =mysql.default_host =mysql.default_user =mysql.default_password =mysql.connect_timeout = 60mysql.trace_mode = Off[MySQLi]mysqli.max_links = -1mysqli.default_port = 3306mysqli.default_socket =mysqli.default_host =mysqli.default_user =mysqli.default_pw =mysqli.reconnect = Off[mSQL]msql.allow_persistent = Onmsql.max_persistent = -1msql.max_links = -1[PostgresSQL]pgsql.allow_persistent = Onpgsql.auto_reset_persistent = Offpgsql.max_persistent = -1pgsql.max_links = -1pgsql.ignore_notice = 0pgsql.log_notice = 0[Sybase]sybase.allow_persistent = Onsybase.max_persistent = -1sybase.max_links = -1sybase.min_error_severity = 10sybase.min_message_severity = 10sybase.compatability_mode = Off[Sybase-CT]sybct.allow_persistent = Onsybct.max_persistent = -1sybct.max_links = -1© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 26. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 25sybct.min_server_severity = 10sybct.min_client_severity = 10[bcmath]bcmath.scale = 0[Informix]ifx.default_host =ifx.default_user =ifx.default_password =ifx.allow_persistent = Onifx.max_persistent = -1ifx.max_links = -1ifx.textasvarchar = 0ifx.byteasvarchar = 0ifx.charasvarchar = 0ifx.blobinfile = 0ifx.nullformat = 0[Session]session.save_handler = filessession.save_path = "/var/lib/php/session"session.use_cookies = 1session.name = PHPSESSIDsession.auto_start = 0session.cookie_lifetime = 0session.cookie_path = /session.cookie_domain =session.cookie_httponly =session.serialize_handler = phpsession.gc_probability = 1session.gc_divisor = 1000session.gc_maxlifetime = 1440session.bug_compat_42 = 0session.bug_compat_warn = 1session.referer_check =session.entropy_length = 0session.entropy_file =session.cache_limiter = nocachesession.cache_expire = 180session.use_trans_sid = 0session.hash_function = 0session.hash_bits_per_character = 5url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"[MSSQL]mssql.allow_persistent = Onmssql.max_persistent = -1mssql.max_links = -1mssql.min_error_severity = 10mssql.min_message_severity = 10mssql.compatability_mode = Offmssql.secure_connection = Off[Tidy]tidy.clean_output = Off[soap]soap.wsdl_cache_enabled=1soap.wsdl_cache_dir="/tmp"soap.wsdl_cache_ttl=86400Appendix B—Optimized ConfigurationsApache Web Server ConfigurationServerTokens OSServerRoot "/etc/httpd"PidFile run/httpd.pidTimeout 120KeepAlive OffMaxKeepAliveRequests 100KeepAliveTimeout 15StartServers 100MinSpareServers 100MaxSpareServers 150ServerLimit 256© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 27. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 26MaxClients 256MaxRequestsPerChild 4000Listen *:80LoadModule authz_host_module modules/mod_authz_host.soLoadModule expires_module modules/mod_expires.soLoadModule deflate_module modules/mod_deflate.soLoadModule mime_module modules/mod_mime.soLoadModule dir_module modules/mod_dir.soLoadModule rewrite_module modules/mod_rewrite.soLoadModule log_config_module modules/mod_log_config.soUser apacheGroup apacheServerAdmin root@localhost#ServerName www.example.com:80UseCanonicalName OffDocumentRoot "/var/www/html"<Directory />Options FollowSymLinksAllowOverride None</Directory><Directory "/var/www/html">Options Indexes FollowSymLinksAllowOverride AllOrder allow,denyAllow from all</Directory>AccessFileName .htaccess<Files ~ "^.ht">Order allow,denyDeny from all</Files>TypesConfig /etc/mime.typesDefaultType text/plain<IfModule mod_mime_magic.c>#MIMEMagicFile /usr/share/magic.mimeMIMEMagicFile conf/magic</IfModule>HostnameLookups OffErrorLog logs/error_logLogLevel warnLogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combinedLogFormat "%h %l %u %t "%r" %>s %b" commonLogFormat "%{Referer}i -> %U" refererLogFormat "%{User-agent}i" agentCustomLog logs/access_log combinedServerSignature OnAddDefaultCharset UTF-8AddType application/x-compress .ZAddType application/x-gzip .gz .tgzLoadModule php5_module modules/libphp5.soAddHandler php5-script .phpAddType text/html .phpDirectoryIndex index.phpMySQL Configuration[mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=mysql# Default to using old password format for compatibility with mysql 3.x# clients (those using the mysqlclient10 compatibility package).old_passwords=1# Disabling symbolic-links is recommended to prevent assorted security risks;# to do so, uncomment this line:# symbolic-links=0© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 28. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 27max_connections = 1000max_connect_errors = 10table_cache = 1024max_allowed_packet = 16Mmax_heap_table_size = 64Msort_buffer_size = 8Mjoin_buffer_size = 8Mthread_cache_size = 8thread_concurrency = 8query_cache_size = 64Mquery_cache_limit = 2Mtmp_table_size = 64Mkey_buffer_size = 32Mread_buffer_size = 2Mread_rnd_buffer_size = 16Mbulk_insert_buffer_size = 64Mmyisam_sort_buffer_size = 128Mmyisam_max_sort_file_size = 10Gmyisam_max_extra_sort_file_size = 10Gmyisam_repair_threads = 1myisam_recoverinnodb_additional_mem_pool_size = 16Minnodb_log_buffer_size = 8Minnodb_log_file_size = 512Minnodb_log_files_in_group = 2innodb_buffer_pool_size = 10Ginnodb_data_file_path = ibdata1:1G;ibdata2:512M:autoextendinnodb_autoextend_increment=512[mysqld_safe]log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pidPHP Configuration (complementary to the default configuration)Required extensionsextension=bcmath.soextension=curl.soextension=dom.soextension=gd.soextension=mcrypt.soextension=memcache.soextension=mhash.soextension=pdo.soextension=pdo_mysql.soExtensions from the default setup that are no longer needed in the optimized configuration;;;extension=dbase.so;;;extension=json.so;;;extension=mysqli.so;;;extension=mysql.so;;;extension=pdo_sqlite.so;;;extension=sqlite.so;;;extension=wddx.so;;;extension=xmlreader.so;;;extension=xmlwriter.so;;;extension=xsl.so;;;extension=zip.soAPC-specific configuration used where APC is enabledextension=apc.soapc.shm_size=256apc.num_files_hint=10000apc.user_entries_hint=10000apc.max_file_size=5MeAccelerator-specific configuration used where eAccelerator is enabledzend_extension="/usr/lib64/php/modules/eaccelerator.so"eaccelerator.shm_size = "256"Appendix C—Software Versions Used  CentOS release 5.5 (Final)  Linux 2.6.18-194.3.1.el5 SMP x86_64 GNU/Linux© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 29. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 28  mysql 5.0.84  PHP 5.2.13  php-pecl-apc-3.1.3p1-1  php-eaccelerator-0.9.5.3  Apache/2.2.3  memcached 1.4.5  SIEGE 2.69  Magento Enterprise Edition 1.9.0.0Appendix D—Test Scripts/StepsGeneral URL List for Testing with Sample Data$(BASEURL)$(BASEURL)electronics/cell-phones.html$(BASEURL)electronics/cell-phones.html?price=2%2C100$(BASEURL)electronics/cell-phones.html?price=2%2C100&color=23$(BASEURL)electronics/cell-phones/samsung-mm-a900m-ace.html$(BASEURL)checkout/cart/add/product/20/$(BASEURL)apparel.html$(BASEURL)cn-clogs-beach-garden-clog.html$(BASEURL)checkout/cart/$(BASEURL)checkout/onepage/$(BASEURL)catalogsearch/result/?q=ink&x=0&y=0$(BASEURL)apparel.html?cat=17$(BASEURL)apparel.html?price=1%2C100&cat=17$(BASEURL)the-get-up-kids-band-camp-pullover-hoodie.html$(BASEURL)checkout/cart/add/product/39/$(BASEURL)apparel/shirts.htmlGeneral URL List for Testing with 10.000 and 80.000 SKUs$(BASEURL)$(BASEURL)category-3.html$(BASEURL)category-3.html?cat=28$(BASEURL)category-3.html?cat=28&price=2%2C1000$(BASEURL)category-3/pr15031-50.html$(BASEURL)checkout/cart/add/product/2489/$(BASEURL)category-273.html$(BASEURL)category-273/100-190-b7h.html$(BASEURL)checkout/cart/$(BASEURL)checkout/onepage/$(BASEURL)catalogsearch/result/?q=345&x=0&y=0$(BASEURL)category-273.html?cat=427$(BASEURL)category-273.html?cat=427&ab_host=303$(BASEURL)category-273/r1256ap.html$(BASEURL)checkout/cart/add/product/1354/$(BASEURL)category-273/category-309.htmlURL List of Cachable Pages Only for Testing with Sample Data$(BASEURL)$(BASEURL)electronics/cell-phones.html$(BASEURL)electronics/cell-phones.html?price=2%2C100$(BASEURL)electronics/cell-phones.html?price=2%2C100&color=23$(BASEURL)electronics/cell-phones/samsung-mm-a900m-ace.html$(BASEURL)apparel.html$(BASEURL)cn-clogs-beach-garden-clog.html$(BASEURL)apparel.html?cat=17$(BASEURL)apparel.html?price=1%2C100&cat=17$(BASEURL)the-get-up-kids-band-camp-pullover-hoodie.html$(BASEURL)apparel/shirts.html$(BASEURL)apparel/shoes.html$(BASEURL)apparel/shoes.html?price=1%2C1000000$(BASEURL)apparel/shoes.html?price=1%2C1000000&shoe_type=52$(BASEURL)kenneth-cole-new-york-men-s-con-verge-slip-on.htmlURL List of Cachable Pages Only for Testing with 10.000 and 80.000 SKUs$(BASEURL)© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 30. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 29$(BASEURL)category-3.html$(BASEURL)category-3.html?cat=28$(BASEURL)category-3.html?cat=28&price=2%2C1000$(BASEURL)category-3/pr15031-50.html$(BASEURL)category-273.html$(BASEURL)category-273/100-190-b7h.html$(BASEURL)category-273.html?cat=427$(BASEURL)category-273.html?cat=427&ab_host=303$(BASEURL)category-273/r1256ap.html$(BASEURL)category-273/category-309.html$(BASEURL)category-924/category-925.html$(BASEURL)category-924/category-925.html?price=1%2C1000000$(BASEURL)category-924/category-925.html?aahauptkategorie=513&price=1%2C1000000$(BASEURL)category-924/category-925/cc08-01-002.htmlURL List for Testing the Flat Catalog Feature with Sample Data$(BASEURL)furniture/living-room.html?dir=desc&order=position$(BASEURL)furniture/living-room.html?dir=asc&order=position$(BASEURL)furniture/living-room.html?dir=asc&order=name$(BASEURL)furniture/living-room.html?dir=desc&order=name$(BASEURL)furniture/living-room.html?dir=asc&order=price$(BASEURL)furniture/living-room.html?dir=desc&order=priceURL List for Testing the Flat Catalog Feature with 10.000 and 80.000 SKUs$(BASEURL)category-811.html?dir=desc&order=position$(BASEURL)category-811.html?dir=asc&order=position$(BASEURL)category-811.html?dir=asc&order=name$(BASEURL)category-811.html?dir=desc&order=name$(BASEURL)category-811.html?dir=asc&order=price$(BASEURL)category-811.html?dir=desc&order=priceURL List for Testing Solr Integration for SearchAutomatically generated URL lists for testing Solr vs. MySQL search are available as a separate file and can be sentby request. Please contact enterprise@magento.com for URL lists for:  for search with Sample Data  for search with 10.000 and 80.000 SKUsPlease note, that the Solr vs. MySQL search performance was tested using slightly different technique, every URL fromthe list was taken randomly to prevent every concurrent connection to perform the same search request.URL List Used for Testing Solr Integration for catalog filtering with Sample Data$(BASEURL)apparel/shirts.html$(BASEURL)apparel/shirts.html?price=1%2C100$(BASEURL)apparel/shirts.html?price=2%2C100$(BASEURL)apparel/shirts.html?color=White$(BASEURL)apparel/shoes/mens.html$(BASEURL)apparel/shoes/mens.html?price=2%2C100$(BASEURL)apparel/shoes/mens.html?color=Gray$(BASEURL)apparel/shoes/mens.html?shoe_type=Running$(BASEURL)apparel/shoes/womens.html$(BASEURL)apparel/shoes/womens.html?price=1%2C100$(BASEURL)apparel/shoes/womens.html?manufacturer=CN+CLogs$(BASEURL)apparel/shoes/womens.html?color=BrownURL List for Testing Solr Integration for catalog filtering with 10.000 and 80.000 SKUs$(BASEURL)category-736.html$(BASEURL)category-736.html?aahauptkategorie=515$(BASEURL)category-736.html?aahauptkategorie=514$(BASEURL)category-736.html?aahauptkategorie=513$(BASEURL)category-924.html$(BASEURL)category-924.html?aahauptkategorie=515$(BASEURL)category-924.html?aahauptkategorie=514$(BASEURL)category-924.html?aahauptkategorie=513$(BASEURL)category-811.html$(BASEURL)category-811.html?aahauptkategorie=515$(BASEURL)category-811.html?aahauptkategorie=514$(BASEURL)category-811.html?aahauptkategorie=513© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 31. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 30 $(BASEURL) = http://server.test/Appendix E—Sample DatabasesPlease contact enterprise@magento.com for sample data and databases.Appendix F— Magento Enterprise Edition Sample ConfigurationsConfiguration for Two Level Cache<config> <global> <cache> <!-- Can also be either apc, memcached, or file. If empty, file is assumed --> <backend>memcached</backend> <!-- Used for only memory based storages, can be either database or file. If empty, file is assumed --> <slow_backend></slow_backend> <!-- memcached cache backend related config --> <memcached> <servers><!-- any number of server nodes can be included --> <server1> <host><![CDATA[localhost]]></host> <port><![CDATA[11211]]></port> <persistent><![CDATA[1]]></persistent> <weight><![CDATA[2]]></weight> <timeout><![CDATA[10]]></timeout> <retry_interval><![CDATA[10]]></retry_interval> <status><![CDATA[]]></status> </server1><!-- <server2> ... </server2>--> </servers> <compression><![CDATA[0]]></compression> <cache_dir><![CDATA[]]></cache_dir> <hashed_directory_level><![CDATA[]]></hashed_directory_level> <hashed_directory_umask><![CDATA[]]></hashed_directory_umask> <file_name_prefix><![CDATA[]]></file_name_prefix> </memcached> </cache> </global></config>© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 32. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 31Configuration for Two Database NodesThe following configuration code sample shows how to set up two separate connections for the master and slavedatabase servers:<config> <global> <resources> <default_setup> <connection> <host><![CDATA[master]]></host> <username><![CDATA[writeuser]]></username> <password><![CDATA[writeuserpwd]]></password> <dbname><![CDATA[magento]]></dbname> <active>1</active> </connection> </default_setup> <default_read> <connection> <use></use> <host><![CDATA[slave]]></host> <username><![CDATA[readuser]]></username> <password><![CDATA[readuserpwd]]></password> <dbname><![CDATA[magento]]></dbname> <model>mysql4</model> <initStatements>SET NAMES utf8</initStatements> <type>pdo_mysql</type> <active>1</active> </connection> </default_read> </resources> </global><config>© 2010, Magento, Inc. All rights reserved. December 1, 2010
  • 33. MAXIMIZING PERFORMANCE AND SCALABILITY WITH MAGENTO ENTERPRISE EDITION 32 Magento, Inc. is an experienced player in the eCommerce industry. Since 2001, we have been leveraging the power of Open Source technology to help online merchants fulfill their business goals at a fraction of the cost and time of proprietary eCommerce solutions. Our clients are a new generation of merchants eager to realize their creative ideas and gain an edge in their industry, without technology getting in the way. Magento is a feature-rich, professional open-source eCommerce solution that offers merchants complete flexibility and control over the look, content, and functionality of their online store. Magento’s intuitive administration interface contains powerful marketing, merchandising and content management tools to give merchants the power to create sites that are tailored to their unique business needs. Completely scalable and backed by an extensive support network, Magento offers companies the ultimate eCommerce solution. For more information, visit us at www.MagentoCommerce.com.Headquarters Sales Information and InquiriesMagento, Inc. Magento has offices and solution partners worldwide. Contact us10441 Jefferson Blvd. for more information about Magneto Enterprise Edition atSuite 200 enterprise@magento.com.Culver City, CA 90232USAwww.MagentoCommerce.com© 2010, Magento, Inc. All rights reserved. December 1, 2010