30.06.2016 Views

Magento Site Performance Optimization

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Tuning, Scaling, and Replicating MySQL<br />

<strong>Magento</strong> uses many indexes in order to access easily to, for example, rules for each<br />

product each time they are added to the basket of each customer. Indexes are very<br />

important in <strong>Magento</strong> and can be managed from the admin panel by navigating to<br />

System | Index Management. In this menu, each table that is in need of a reindexing<br />

will appear in red. You can reindex a table by selecting the table, selecting Reindex<br />

in the upper-right corner, and clicking on the Submit button. Here is a screenshot of<br />

the table after indexation:<br />

Truncating some tables for performance<br />

The logging system for user interactions with your e-commerce website is<br />

exclusively based on MySQL. This means that whatever your users are doing on<br />

your website, their actions are stored in your MySQL database. On one hand, it's a<br />

very handy way of informing you what your user is looking for in your store and to<br />

adjust yourself to fit your customers' needs, but on the other hand, this information<br />

comes with an incredibly heavy weight. On average, these data weigh 1 MB per<br />

visitor per month. Knowing that, doing the math is fairly easy, 1,000 visitor/month<br />

weigh 1 GB of logs in your MySQL database. Needless to say, the heavier the<br />

database becomes, the slower your data will be served. Therefore, you should dump<br />

that log from time to time in order to learn about your customers from them, and<br />

also, delete them on a monthly basis.<br />

The following are the commands to truncate a table:<br />

$ mysql –user magento-user –password<br />

[ 46 ]<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!