Magento Themes and Magento Extensions

BEST CONFIGURATION FOR MAGENTO

Share

Following are some important configurations that will speed up the Magento site . This tutorial is mainly focusing on my.cnf, php.ini and apache configuration files.

1. MySQL Configuration

Proper MySQL configuration will speed up the performance of the system. Below are the necessary configurations for MySQL.

  • code
  • source
  1. innodb_thread_concurrency = 2 * [numberofCPUs] + 2
  2. innodb_flush_log_at_trx_commit = 2
  3. thread_concurrency = [number of CPUs] * 3
  4. thread_cache_size = 32
  5. table_cache = 1024
  6. query_cache_size = 64M
  7. query_cache_limit = 2M
  8. join_buffer_size = 8M
  9. tmp_table_size = 256M
  10. key_buffer = 32M
  11. innodb_autoextend_increment=512
  12. max_allowed_packet = 16M
  13. max_heap_table_size = 256M
  14. read_buffer_size = 2M
  15. read_rnd_buffer_size = 16M
  16. bulk_insert_buffer_size = 64M
  17. myisam_sort_buffer_size = 128M
  18. myisam_max_sort_file_size = 10G
  19. myisam_max_extra_sort_file_size = 10G
  20. myisam_repair_threads = 1

In addition to these configurations, we need some more configurations in the innodb. They are:

1. innodb_buffer_pool_size

  • code
  • source
  1. Combined web and db server, 6 GB RAM – 2-3 GB
  2. Dedicated database server, 6 GB RAM – 5 GB
  3. Dedicated database server, 12 GB RAM – 10 GB

2. innodb_thread_concurrency

  • code
  • source
  1. 2 * [numberofCPUs] + 2

3. table_cache is the number of tables that can be simultaneously opened by MySQL

4. query_cache_size (64 Mb )

5. query_cache_limit (2 Mb)

2. PHP Configuration

The main configuration for php.ini file are the following

  • code
  • source
  1. realpath_cache_size = 32k
  2. realpath_cache_ttl = 7200
  3. max_execution_time = 90
  4. max_input_time = 90
  5. memory_limit = 256M
  6. default_socket_timeout = 90
  7. pdo_mysql.cache_size = 2000
  8. output_buffering = 4096

3. Apache Configurations

Main apache configurations include:

1. Enable ‘Keep Alive’

KeepAlive provides long-lived HTTP sessions which allow multiple requests to be sent over the same TCP connection. In some cases this has been shown to result in an almost 50% speedup in latency times for HTML documents with many images.

2. Eliminating directory structure scans for the .htaccess

3. Apache modules -Use just necessary apache modules

Comments are closed.