"
目前是用作一台纯数据库服务器,单机多实例设置主从,然后hugepages为32G
现在不知道该如何去优化这个my.cnf,晚上查到一个最大内存的使用量查询方法,结果出来的结果是5G都不到,
贴上mysqld1的配置,求优化
skip-external-locking
key_buffer_size = 1024M
max_allowed_packet = 32M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 128M
thread_cache_size = 8
query_cache_size = 64M
thread_concurrency = 24
skip-name-resolve
skip_slave_start = 1
log-bin = /path/binlogs/mysqld-bin
log-bin-index = /path/binlogs/mysqld-bin.index
server-id = 1
binlog_format=mixed
expire-logs-days = 21
" ![image.png](https://ucc.alicdn.com/pic/developer-ecology/545880f1f99242d4ab10f3a7d0a8cd8b.png)"访问mysqltuner.pl下载脚本自动配置######回复 <a href=""http://my.oschina.net/yahveh"" class=""referer"" target=""_blank"">@hellokitty1 : perl 的,我拿来玩了一下,这工具能给一些建议######执行成功,生成的东西在哪- -######需要什么前提么? python 或者 sh都无法执行成功######
这配置太奢侈了!!!!
问题是你需要这么大的配置吗?如果实际只需要 5G,那么查出来 5G 也正常啊
看看系统的负载怎样呢?
######回复 @hellokitty1 : 没上线的系统占用这点内存正常吧######还没上线了,如何去测试系统负载呢?######至少上线前应该做个压力测试吧?你系统设计的指标至少在需求时就应该大致明确了啊,比如用户规模,并发量,表数据量等等...如果前期只重功能埋头写代码,后面再来优化,时间精力不比写代码少...######这个道理也是明白的,现在就在压力测试,悲催的dz7.2######skip-external-locking key_buffer_size = 20480M max_allowed_packet = 32M table_open_cache = 2048 sort_buffer_size = 256M read_buffer_size = 256M read_rnd_buffer_size = 128M myisam_sort_buffer_size = 512M thread_cache_size = 32 query_cache_size = 2048M thread_concurrency = 24 max_connections = 4096 tmp_table_size = 64M skip-name-resolve skip_slave_start = 1 log-bin = /path/binlogs/mysqld-bin log-bin-index = /path/binlogs/mysqld-bin.index server-id = 1 binlog_format=mixed expire-logs-days = 21
######回复 @皮总 : 什么都瞒不过皮总,还想凑合跑一个redis######两个都跑满也才 40G ,你还要24G 做其他事情呢######皮总,mysql-hugepages为32G,另外运行两个实例,key_buffer_size设20个G,会不会有啥影响?######
skip-external-locking key_buffer_size = 20480M max_allowed_packet = 32M table_open_cache = 2048 sort_buffer_size = 256M read_buffer_size = 256M read_rnd_buffer_size = 128M myisam_sort_buffer_size = 512M thread_cache_size = 32 query_cache_size = 2048M thread_concurrency = 24 max_connections = 4096 tmp_table_size = 64M skip-name-resolve skip_slave_start = 1 log-bin = /path/binlogs/mysqld-bin log-bin-index = /path/binlogs/mysqld-bin.index server-id = 1 binlog_format=mixed expire-logs-days = 21
主要是运行时提示:
./mysqltuner.pl
>> MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
which: no mysqladmin in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[!!] Unable to find mysqladmin in your $PATH. Is MySQL installed?
[root@www bin]#
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。