1 Optimizing your Magento store for heavy API access 1.0 June 2013
2 About This Guide This guide is for anyone who is looking to optimise the API link speed between a Magento installation and Brightpearl. In this guide we will offer practical advice and settings for MySQL, PHP and Magento itself. In general most VPS/Cloud or dedicated hosting companies offer both managed and unmanaged hosting services for clients. If you're managing your server directly then you will have access to change and update settings as suggested. If your server is fully managed then you may wish to request these changes are made by your hosting provider. In general we are assuming that you are running cpanel on a Linux distribution and that you are running your Magento installation as an account on this cpanel/linux environment. If you're hosting environment is non standard or distributed then settings suggested in this guide may not apply or be appropriate. Suggestions in this guide are not to be taken as definitive and due consideration should be given the repercussions of changes on other installed software or services. Background Magento is a highly configurable shopping cart built on PHP and MySQL. It is known to offer a great deal of configurability allowing a high level of customisation. It is also known however to suffer from performance issues if poorly configured which can affect not only front end user performance but also affect internal services such as the API interface. Brightpearl utilises the Magento API to perform its communication to Magento. As this is the case it is important to consider API performance to ensure that the connection between the two systems remains stable and trouble free. Using the Magento API means that the servers Apache service, PHP services along with mysql services are all put under load. For that reason optimisation of these 3 critical components is vital. How to update your Magento system If you are not a technical expert, please do not attempt to make the changes to the server yourself. You may take your store offline, and it may be hard to recover, even by professionals. Brightpearl cannot restore your Magento installation or Magento server to a previous state; your Magento store is your own property and access by Brightpearl is not required at any stage of the integration.
3 Hosting Recommendations Due consideration should be given to the specification of the server (dedicated or virtualised) that you intend to run Magento on. In general the higher the specification a server is will ultimately result in performance improvements. Of course a business decision needs to be made to decide at what price point is appropriate and then obtain the best package possible within that price range. For small to medium size Magento stores of product catalogue size of up to around 20,000 items an entry dedicated server or a similarly specified cloud/vps hosting package is recommended. An example entry level dedicated server specification is as follows: Processor Cores Memory Hard Drives Hot Swappable Drives SSD Available Bandwidth Quad Core Xeon 3.1GHz 4 Core 8GB RAM Network Uptime Guarantee 100% Control Panel Options 2 x 250GB SATA-III RAID1 UNLIMITED Plesk / cpanel Servers below this specification are not guaranteed to cope with the demands placed on it by a Brightpearl integration. Typically we have found that hosting of the above specification costs from 100 / $150 per month upwards. Wherever possible the use of SSD local disks is highly recommended Server Loading How many sites run on your server? Logically the more sites & other services that are being run on a single server the more load that server is under at any given point in time and therefore the slower your Magento store and API may run. Wherever possible we highly recommend the use of one dedicated server for one business critical Magento site/installation. This approach minimises the risk of timeouts and allows for easier debugging of problems, it is also appropriate if you are required to run a PCI DSS validated server.
4 Apache Optimization 1. Enable module mod_fcgid for Apache What does this do? mod_fcgid is a high performance alternative to mod_cgi or mod_cgid, which starts a sufficient number instances of the CGI program to handle concurrent requests, and these programs remain running to handle further incoming requests. It is favored by the PHP developers, for example, as a preferred alternative to running mod_php in-process, delivering very similar performance. (standard module for Apache version >= 2.2 ) This module can be enabled via EasyApache in the exhaustive options list as below. Build, compile and restart Apache Additional configuration settings for mod_fcgid Include the following configuration lines in configuration file http.conf (accessed from the command line or from Cpanel -> Service Configuration -> Apache Configuration -> Include Editor -> Pre Main Include -> I wish to edit the Pre Main configuration include file for: All Versions) FcgidMaxRequestLen FcgidIOTimeout 300 FcgidMaxRequestsPerProcess 5000 FcgidMaxProcesses 20 FcgidMinProcessesPerClass 0 FcgidIdleTimeout 20 FcgidIdleScanInterval 10 FcgidBusyTimeout 20 FcgidBusyScanInterval 10 FcgidErrorScanInterval 5 FcgidZombieScanInterval 5 FcgidProcessLifeTime 10 Example:
5 Note: for cpanel do not edit the http.conf file directly as this will be overwritten on any cpanel upgrade or Apache rebuild.
7 SetEnvIfNoCase Request_URI \.(?:gif jpe?g png)$ no-gzip dontvary vary # Make sure proxies don t deliver the wrong content Header append Vary User-Agent env=!dont-vary </IfModule> Your Magento site should now be passing content in gzipped compressed form. Test here:
9 4. Additional Apache optimisations.optimizing in configuration file http.conf ( from command line or from Cpanel -> Service Configuration -> Apache Configuration -> Global Configuration Turn Directive `KeepAlive` to 'on' Change the following values StartServers 50 MinSpareServers 15 MaxSpareServers 30 MaxClients 225 MaxRequestsPerChild 4000
10 PHP optimization 1. Install a PHP accelerator/cache Install APC, Eaccelerator, Zend Accelerator or Xcache on your server or contact with your hosting provider to install these PHP Cache Systems. 2. Update PHP configuration either in php.ini (usually in directory /etc) or via cpanel GUI where applicable. realpath_cache_size=1m realpath_cache_ttl=86400 memory_limit = 128M post_max_size = 20M upload_max_filesize = 20M max_execution_time = 300 ***Very important can help reduce timeouts max_input_time = 300 output_buffering = 4096 disable_functions = exec, passthru, system, proc_open, proc_get_status, proc_nice, proc_terminate, proc_close, curl_multi_exec, show_source, dl, shell, system_exec, virtual error_reporting = E_COMPILE_ERROR E_ERROR E_CORE_ERROR Example:
11 MySQL Magento database optimization An optimised well performing Magento database is vital for overall system performance and speed. 1. Go to phpmyadmin 2. Choose your magento database 3. Select checkboxes for all tables 4. Choose Repair on select menu 5. Select with checkboxes all tables 6. Choose Optimize on select menu 7. Your database is ready It is always recommended to backup your database before performing any optimisation.
12 MySql Server Optimization (Advanced) 1. If you have subtable RAM (no less 8GB) - you can disable the swap file in the OS. This can be done via SSH command line >swap off 2. Update key_buffer_size MyISAM engine. go to mysql with superuser permissions (usually - root account on Mysql) enter two commands mysql > SHOW VARIABLES LIKE '%key_buffer%'; mysql > SET GLOBAL key_buffer_size = ; 3. Changes of configuration file. Go to my.cnf (/etc or /etc/mysql directory) open file and create section [mysqld] [mysqld] key_buffer = 512M max_allowed_packet = 64M thread_stack = 192K thread_cache_size = 32 table_cache = 512 query_cache_type = 1 query_cache_size = tmp_table_size = 128M expire_logs_days = 10 max_binlog_size = 100M sort_buffer_size = 4M read_buffer_size = 4M read_rnd_buffer_size = 2M myisam_sort_buffer_size = 64M wait_timeout = 300 max_connections = Restart Mysql
14 8. Run Compilation Admin Panel -> System > Tools -> Compilation and click on Run Compilation Process (top right corner) 10. Delete or uninstall non-used extensions/modules Example Admin Panel -> System -> Configuration -> Advanced -> Disable Modules Output and turn off Mage_poll (as example). 11. Delete non used Java-scripts from Theme page.xml file 12. Use custom Jquery scripts on page footer. Using of APC / Memcached as cache backend (Advanced) 1. Magento uses cache system on files, its possible to change this so that Magento uses to an APC or Memcached system. Installation, APC (root permissions) apt-get install php5-apc or pecl install APC or contact your hosting provider Add cache block to local.xml file <?xml version="1.0"?> <config> <global> <install> <date><![cdata[sat, 26 Jun :55: ]]></date> </install> <cache> <backend>apc</backend> <prefix>alphanumeric</prefix> </cache> <crypt> <key><![cdata[870f60e1ba58fd34dbf730bfa8c9c152]]></key> </crypt> <disable_local_modules>false</disable_local_modules> <resources> <db> <table_prefix><![cdata]></table_prefix> </db> <default_setup> <connection> <host><![cdata[localhost]]></host> <username><![cdata[root]]></username>
Magento Enterprise Edition User Guide Part V: Store Operations System Operations Version 1.14.2 Contents Store Operations 1 Chapter 1: Currency Rates 3 Currency Setup 4 Currency Symbols 8 Updating Currency
User's Manual Intego VirusBarrier Server 2 / VirusBarrier Mail Gateway 2 User's Manual Page 1 VirusBarrier Server 2 and VirusBarrier Mail Gateway 2 for Macintosh 2008 Intego. All Rights Reserved Intego
WS_FTP Server WS_FTP Server Installation and Configuration Guide Contents CHAPTER 1 Introduction What is WS_FTP Server?...1 WS_FTP Server product family...1 New in WS_FTP Server 7.5...2 For more assistance...3
HP D2D NAS Integration with HP Data Protector 6.11 Abstract This guide provides step by step instructions on how to configure and optimize HP Data Protector 6.11 in order to back up to HP D2D Backup Systems
Kerio Connect Administrator s Guide Kerio Technologies 2011 Kerio Technologies s.r.o. All rights reserved. This guide provides detailed description on Kerio Connect, version 7.2. All additional modifications
SuccessFactors Admin: Recruiting Management Admin Guide v1204 (One Admin) For SuccessFactors v12 (One Admin) Last Modified 07/17/2012 2012 SuccessFactors, Inc. All rights reserved. Execution is the Difference
Administrator Manual Across Personal Edition v6 (Revision: February 4, 2015) Copyright 2004-2015 Across Systems GmbH The contents of this document may not be copied or made available to third parties in
ProfileUnity with FlexApp Technology Help Manual Introduction This guide has been authored by experts at Liquidware Labs in order to provide information and guidance concerning ProfileUnity with FlexApp.
HP StoreOnce Catalyst and HP Data Protector 7 Implementation and Best Practice Guide Release 1 Executive Summary This guide is intended to enable the reader to understand the basic technology of HP StoreOnce
DocuFire for Windows User Manual Version: 5.20 Date: February 19, 2010 Web: http://www.docufire.com TABLE OF CONTENTS Introduction to DocuFire for Windows... 4 Contacting Technical Support... 4 Getting
Table Of Contents INTRODUCTION...4 About EventLog Analyzer... 5 Release Notes... 6 INSTALLATION AND SETUP...8 System Requirements... 8 Prerequisites... 11 Installing and Uninstalling... 13 Starting and
Must License Installation Guide HOPEX V1R2 EN Last updated: February 19, 2015 Created: January 20, 2005 Author: Jérôme HORBER CONTENTS Summary This article describes the technical configurations necessary
Import Guide 021312 2009 Blackbaud, Inc. This publication, or any part thereof, may not be reproduced or transmitted in any form or by any means, electronic, or mechanical, including photocopying, recording,
FileMaker Server 13 FileMaker Server Help 2010-2013 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and Bento are trademarks of FileMaker,
Page 1 of 78 Features - NAS NDMP Client TABLE OF CONTENTS OVERVIEW SYSTEM REQUIREMENTS - NAS NDMP IDATAAGENT INSTALLATION Install the MediaAgent - Windows Install the MediaAgent - Windows -Clustered Environment
Getting Started Guide StarTeam Borland Software Corporation 100 Enterprise Way Scotts Valley, California 95066-3249 www.borland.com Borland Software Corporation may have patents and/or pending patent applications
Parallels Deploying Microsoft Clusters in Parallels Virtuozzo-Based Systems Copyright 1999-2008 Parallels, Inc. ISBN: N/A Parallels Holdings, Ltd. c/o Parallels Software, Inc. 13755 Sunrise Valley Drive
Syncro SVN Client 4.2 User Manual SyncRO Soft Ltd. Syncro SVN Client 4.2 User Manual SyncRO Soft Ltd. Copyright 2002-2009 SyncRO Soft Ltd. All Rights Reserved. Many of the designations used by manufacturers
USER GUIDE Note: 1. PROLINUX is a DHCP client and is set to auto mode by default. 2. Default IP:192.168.1.251 Port:6666 3. Default UI account: sysadmin 4. Default UI password: sysadmin1234 1 TABLE OF CONTENTS
Cumulus 8.1 Administrator Guide Copyright 2010, Canto GmbH. All rights reserved. Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto, registered in the U.S. and other