Make Your Magento go FAST !
This is an old revision of the document!
There are indeed several options for improving Magento performance. These are some of the options we, Pro Contractors, have chosen to utilize for optimizing Magento. The following assume that you have at least shell (SSH) access to your hosting provider. Also, it is strongly recommended to use a hosting provider that can guarantee your Magento store being located on hardware that is dedicated for hosting Magento applications.
- CentOs 5.3 x86_64 - 2.6.18-128.2.1.el5
- Apache 2.2.3 64-Bit - Prefork_MPM
- MySQL Ver 14.12 Distrib 5.0.83 x86_64
- PHP 5.2.9
- Zend Engine v2.2.0
- eAccelerator v0.9.5.3
- ionCube PHP Loader v3.1.28
- memcached 1.2.5
- Magento Community Edition 1.3.x
There is several places through out the Magento eCommerce infrastructure. Each and everyone utilize the available resources in different manners. What is important also to have in mind is which of the applications are possible to move out to other dedicated hardware. The improve performance and resources allocated for the remaining applications. Ie. Should we run MySQL on a dedicated server for optimizing cpu/ram/disk for increase the possibility on how Apache will run on the remaining server ? Should we implement a MySQL cluster as well. Or should we just keep the ammount of Magentostores on the single hardware we have chosen to be our solution ?
I will try and let you understand what discisions i have made for improving our Magento demo store performance I have focused on both initial page load, and for ammount of concurrent users.
The major issue with this, and i do not seem to have found a proper solution for this yet. Is that CentOs/Linux will eventually automatically cache it’s OS in Mem overtime. Then it ends up with no free Mem. When suddenly a burst in requests to a magento application hits you setup. The entire FS has been cached. And no free mem available. - Then it starts swapping. Because it seems like it’s auto sync of unused cached fs pages is not fast enough to free physical memory for it to stop swapping. You can manually sync data to disk using this command :
/bin/sync; echo 3 > /proc/sys/vm/drop_caches
The real thing about using the Prefork_mpm is spawning new process. The more processes that is started when your Apache Deamon is started. The less cost will it have on performance during high load in spawning new process. - The cost of this is the memory footprint of running apache will be equally big. You also need to ensure that the MaxClients/ServerLimit never gets above how many SQL connections is allowed in you MySQL Config. If it is above the mysql connection allowed (in my.cnf) you will end up becomming a bottle neck for handling HTTP Req. that needs MySQL Access. - You Do not want that...!