best mysql config for my vps

349 Views Asked by At

what best config for my.cnf file i have big size sql

Total processors: 4
Processor #1
Vendor
GenuineIntel
Name
Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
Speed
3200.058 MHz
Cache
12288 KB
Memory Information
Memory: 14243308k/15728640k available 
2

There are 2 best solutions below

0
On

There is no straight forward answer of this question as one configuration can be suitable for one but not for other..

If you are using innodb engine then You can start with below configuration initially and can optimize as per your requirement/problems-

default_storage_engine = InnoDB
innodb_file_per_table
lower_case_table_names = 1
wait_timeout = 120
innodb_buffer_pool_size = 10G
key_buffer_size = 20M
max_allowed_packet = 64M
max_connections = 100
query_cache_type = 1
query_cache_size = 20M
query_cache_limit = 2M
read_buffer_size = 2M
sort_buffer_size = 2M
join_buffer_size = 2M
tmp_table_size = 512M
max_heap_table_size = 512M
0
On

for the mysql optimization, I will suggest you please try with MySQL tuner script. You can try it with the following command

wget https://launchpad.net/mysql-tuning-primer/trunk/1.6-r1/+download/tuning-primer.sh

chmod 755 tuning-primer.sh

./tuning-primer.sh