| 14 | First you need to check if query_cache is enabled on your server. It was noticed that 80% of all SELECT queries are taken from query_cache when it is enabled, so if it is disabled on your server - mysql performance is '''5''' times slower ! |
| 15 | |
| 16 | To check this go to phpMysqlAdmin tool (in most cases it is in your whm panel -> SQL Services -> phpMyAdmin). Then click "Variables" tab. |
| 17 | "query cache size" must be at lesat 16M, "query cache type" must be ON and "query cache limit" value should be around 1M. |
| 18 | Example of good configuration: |
| 19 | |
| 20 | [[Image(hssr-mysql-1-query-cache.jpg)]] |
| 21 | |
| 22 | After you realized that you need to change these settings you need to edit "my.cnf" file on your server (in most cases it in in "/etc" folder) and add the foollowing lines in "[mysqld]" section of the file, if the same configuration options already exists it is better to comment out old ones (with hash # symbol ) and add new ones near them: |
| 23 | |
| 24 | {{{ |
| 25 | [mysqld] |
| 26 | query_cache_limit = 1M |
| 27 | query_cache_size = 32M |
| 28 | }}} |
| 29 | |
| 30 | You need to restart mysql server to apply the changes, you can do it from whm panel or from command line, most common command line for linux servers is: |
| 31 | |
| 32 | {{{ |
| 33 | /etc/init.s/mysql restart |
| 34 | }}} |
| 35 | |
| 36 | This most critical configuration options. Other useful options must be enabled too - "key buffer size", "max heap table size", "tmp table size", "thread_cache" are some of them. But exact values varies from server from server, for example for dedicated or VPS server with 1Gb RAM and one dolphin site, these values maybe like this: |
| 37 | |
| 38 | {{{ |
26 | | First you need to check if query_cache is enabled on your server. It was noticed that 80% of all SELECT queries are taken from query_cache when it is enabled, so if it is disabled on your server - mysql performance is '''5''' times slower ! |
27 | | |
28 | | To check this go to phpMysqlAdmin tool (in most cases it is in your whm panel -> SQL Services -> phpMyAdmin). Then click "Variables" tab. |
29 | | "query cache size" must be at lesat 16M, "query cache type" must be ON and "query cache limit" value should be around 1M. |
30 | | Example of good configuration: |
31 | | |
32 | | [[Image(hssr-mysql-1-query-cache.jpg)]] |
33 | | |
34 | | After you realized that you need to change these settings you need to edit "my.cnf" file on your server (in most cases it in in "/etc" folder) and add the foollowing lines in "[mysqld]" section of the file, if the same configuration options already exists it is better to comment out old ones (with hash # symbol ) and add new ones near them: |
35 | | |
36 | | {{{ |
37 | | [mysqld] |
38 | | |
39 | | query_cache_limit = 1M |
40 | | query_cache_size = 32M |