Optimising Your Web Stack Performance for Magento

Last modified by Simon King on Sun, April 6, 2008 06:43
Source|Old Revisions  |  Back To Group

This is an old revision of the document!


Operating System Configuration

Linux

Windows

BSD

OS X

Web Server Configuration

Apache

http://httpd.apache.org/

Apache is a hugely popular web server (the A in LAMP). It can serve PHP sites using mod_php, FastCGI or CGI.

* Enable KeepAlives (see http://httpd.apache.org/docs/2.2/mod/core.html#keepalive and http://www.magentocommerce.com/blog/comments/performance-is-key-notes-on-magentos-performance/)

NginX

NginX is becoming an increasingly popular alternative to Apache and Lighttpd due to it’s stability, light weight and speed. NginX can server PHP sites using FastCGI or CGI.

Lighttpd

LightSpeed

IIS

PHP Configuration

General

* Set memory limit to 64M

mod_php

PHP FastCGI

PHP CGI

Opcode Caches

PHP Opcode caches reduce the processing overhead involved in reading and compiling PHP scripts. They utilise shared memory as a way of storing and re-using compile scripts.

APC

APC http://uk2.php.net/apc is a free PHP opcode cache written by the PHP team and packaged using PECL.

xCache

eAccelerator

ionCube

Zend Cache

MMCache

MySQL/InnoDB Configuration

Most operating systems install a lightweight MySQL configuration by default, a good LAMP server should provide a decent amount of it’s resources to MySQL. Machines with multiple cores and over 2GB RAM need to be configured carefully to make sure available RAM and cores are being used efficiently.

MySQL

InnoDB

InnoDB (http://www.innodb.com/) is an alternative storage engine which makes use of MySQL’s client/server architecture. Whilst it shares some configuration settings with MyISAM (MySQL’s default storage engine) it has many settings of it’s own and will compete for server resources with MyISAM. It’s possible to tune MySQL server purely for InnoDB if no MyISAM tables are being used.

Multiple MySQL Slaves/Clustering

On larger sites MySQL’s replication functionality can be used to spread SELECT queries across multiple machines. Writes operations will still be run on every server in order to maintain data synchronisation.

Cache Filesystem

Magento uses file caching to store often-used data in an easy to use format. The speed of file caching is directly dependent on speed of the filesystem on which the cache files are being read or written.

tmpfs

tmpfs is an in-memory filesystem designed to deliver the best possible performance.

Reverse Proxy Configuration

Reverse proxies can be used to speed up the serving of cachable assets such as images, CSS, html and javascript by removing the need to ask the web server to serve them.

Apache mod_proxy/mod_cache




 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs