Book Image

Instant Magento Performance Optimization How-to

By : Nayrolles Mathieu (USD), Mathieu Nayrolles
Book Image

Instant Magento Performance Optimization How-to

By: Nayrolles Mathieu (USD), Mathieu Nayrolles

Overview of this book

The optimization of an attractive commercial website is a non-trivial task that demands time and knowledge. Optimization is a critical point for all growing businesses because a misconfiguration could make you lose money, a lot of money. If your server is overloaded, a browser that wants to turn into a buyer will not be able to, and you will lose customers. "Instant Magento Performance Optimization How-To" is a practical, hands-on guide that provides you with a number of clear, step-by-step exercises to help you reach a high performance level for your Magento stores and keep your customers satisfied.This book looks at tweaks and tips used to boost your Magento Performance, and breaks down the confusion that surrounds the subject.You will learn how to compress your pages, styles, and scripts by almost 80%. We will also take a look at controversial optimization settings such as Magento core compilation or enabling all caching systems. You will discover new applications that improve performance. If you wish your e-businesses to grow and want to keep your customers satisfied, you definitely need this book.
Table of Contents (7 chapters)

Configuring MySQL (Should know)


The MySQL default configuration is really safe. Indeed, MySQL developers want their product to be run on all servers, even smaller ones. If you have a server with RAM greater than 1 GB, you can definitely improve your MySQL. You can also, periodically, select all the tables in your MySQL Manager and apply the repair and optimize commands.

How to do it...

Open the file named my.cnf in the root directory of your MySQL installation and modify it as follows:

key_buffer = 512M
max_allowed_packet = 64M
table_cache = 512
sort_buffer_size = 4M
net_buffer_length = 8K
read_buffer_size = 4M
read_rnd_buffer_size = 2M
myisam_sort_buffer_size = 64M
tmp_table_size = 128m
query_cache_size = 96m
query_cache_type = 1
thread_cache_size = 8
max_connections = 400
wait_timeout = 300
thread_concurrency = (Computer CPU'S * 2)

How it works...

The efficiency of these settings depends on the number of articles and categories present on your website, but the key point is to allow MySQL to use the server's RAM in a more intensive way. When a query is cached, its result (that is, the data sent to the client) is already known and stored somewhere in the cache. Therefore, the MySQL server can directly send the response without processing the request.