简体   繁体   English

我的 vps 的最佳 mysql 配置

[英]best mysql config for my vps

what best config for my.cnf file i have big size sql my.cnf 文件的最佳配置我有大尺寸的 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 

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-如果您使用的是 innodb 引擎,那么您最初可以从以下配置开始,并可以根据您的要求/问题进行优化-

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

for the mysql optimization, I will suggest you please try with MySQL tuner script.对于 mysql 优化,我建议您尝试使用 MySQL 调谐器脚本。 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM