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.
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)
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.