Magento Site Performance Optimization
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Tuning, Scaling, and Replicating MySQL<br />
Physical Memory : 1.95 G<br />
Max memory limit exceeds 90% of physical memory<br />
As a reminder, the configuration on which I ran the script was not the default<br />
one but a misconfigured one in order to check the benefits of the<br />
recommendation system.<br />
Tuning my.cnf for performance<br />
As a base to work with, my advice will be to generate the configuration file by<br />
using the MySQL tuning Primer script by analyzing a real production server. Then,<br />
copy the generated files onto your development server in order to test out the<br />
recommendation of the script. After that, you can use the MySQL tuner.pl script<br />
and add the additional recommendation.<br />
Follow the next steps to add the additional recommendation:<br />
1. Run the Primer script on your production server.<br />
2. Make sure it generates a my.cnf file.<br />
3. Copy this file to your development environment.<br />
4. Replace the /etc/mysql/my.cnf file of your environment server with the<br />
one generated by the Run Primer, and then play around with your <strong>Magento</strong><br />
in order to generate new usage statistics of your database engine.<br />
5. Run the mysqltuner.pl script on your production environment and add the<br />
new recommendation to your my.cnf file.<br />
Then, follow the recommendations given here; they are targeting better<br />
performances for <strong>Magento</strong>:<br />
• innodb_buffer_pool_size: This should be around 50 percent of the<br />
physical server RAM when the server hosts the web server and the database<br />
engine both. If MySQL has its own server, then the allocated RAM should be<br />
80 percent of the total physical RAM.<br />
• innodb_thread_concurrency: This must be two more than twice the<br />
number of your CPUs. This means that on a true dual core, the value must<br />
be 2 x 2 + 2 = 6.<br />
• thread_concurrency: This should be equal to three times the number<br />
of CPUs.<br />
• query_cache_size: This should be 64 MB.<br />
• query_cache_limit: This should be 2 MB.<br />
[ 44 ]<br />
www.it-ebooks.info