开发者社区> 余二五> 正文

mysql 内存优化之关闭numa

简介:
+关注继续查看

关闭numa,内存优化,至于什么是numa,大家自己上网上查一下,文章很多。

最近在测试mariadb,要想选型,千万不要听别人说那个好那个不好,要自己实践,说白了就是多做实验,多敲命令,自己去感受,适合自己的才是最好的。

至于选什么,就看你能hold住那种数据库了。


1
2
3
4
5
6
7
8
9
10
11
mysql 5.6.x
[root@mysql92 ~]# yum install numactl -y 
[root@mysql92 ~]# numactl --interleave=all mysqld_safe --defaults-file=/etc/my.cnf &
[1] 7592
[root@mysql92 ~]
[root@mysql92 ~]# 170103 19:04:34 mysqld_safe Logging to '/data/mysqllogs/error.log'.
170103 19:04:34 mysqld_safe Starting mysqld daemon with databases from /data/mysqldata
mariadb 10.1.x
[root@mysql91 ~]# mysqld_safe --defaults-file=/etc/my.cnf --numa-interleave & 
[1] 4066
[root@mysql91 ~]# 170103 19:06:52 mysqld_safe Logging to '/log/mysql/error.log'.



mysql & mariadb mysqld_safe的区别


最近一直在和贺春旸老师学习mariadb,自己也在不断地测试,发现mariadb 的服务层做的确实要比

mysql 要好很多。看参数自己找区别吧。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Mariadb 
[root@mysql91 ~]# mysqld_safe --help
Usage: /usr/bin/mysqld_safe [OPTIONS]
  --no-defaults              Don't read the system defaults file
  --core-file-size=LIMIT     Limit core files to the specified size
  --defaults-file=FILE       Use the specified defaults file
  --defaults-extra-file=FILE Also use defaults from the specified file
  --ledir=DIRECTORY          Look for mysqld in the specified directory
  --open-files-limit=LIMIT   Limit the number of open files
  --crash-script=FILE        Script to call when mysqld crashes
  --timezone=TZ              Set the system timezone
  --malloc-lib=LIB           Preload shared library LIB if available
  --mysqld=FILE              Use the specified file as mysqld
  --mysqld-version=VERSION   Use "mysqld-VERSION" as mysqld
  --dry-run                  Simulate the start to detect errors but don't start
  --nice=NICE                Set the scheduling priority of mysqld
  --no-auto-restart          Exit after starting mysqld
  --nowatch                  Exit after starting mysqld
  --plugin-dir=DIR           Plugins are under DIR or DIR/VERSIONif
                             VERSION is given
  --skip-kill-mysqld         Don't try to kill stray mysqld processes
  --syslog                   Log messages to syslog with 'logger'
  --skip-syslog              Log messages to error log (default)
  --syslog-tag=TAG           Pass -t "mysqld-TAG" to 'logger'
  --flush-caches             Flush and purge buffers/caches before
                             starting the server
  --numa-interleave          Run mysqld with its memory interleaved
                             on all NUMA nodes
All other options are passed to the mysqld program.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
MySQL 
[root@mysql92 ~]# mysqld_safe --help
Usage: /usr/bin/mysqld_safe [OPTIONS]
  --no-defaults              Don't read the system defaults file
  --defaults-file=FILE       Use the specified defaults file
  --defaults-extra-file=FILE Also use defaults from the specified file
  --ledir=DIRECTORY          Look for mysqld in the specified directory
  --open-files-limit=LIMIT   Limit the number of open files
  --core-file-size=LIMIT     Limit core files to the specified size
  --timezone=TZ              Set the system timezone
  --malloc-lib=LIB           Preload shared library LIB if available
  --mysqld=FILE              Use the specified file as mysqld
  --mysqld-version=VERSION   Use "mysqld-VERSION" as mysqld
  --nice=NICE                Set the scheduling priority of mysqld
  --plugin-dir=DIR           Plugins are under DIR or DIR/VERSIONif
                             VERSION is given
  --skip-kill-mysqld         Don't try to kill stray mysqld processes
  --syslog                   Log messages to syslog with 'logger'
  --skip-syslog              Log messages to error log (default)
  --syslog-tag=TAG           Pass -t "mysqld-TAG" to 'logger'
All other options are passed to the mysqld program.










本文转自 roidba 51CTO博客,原文链接:http://blog.51cto.com/roidba/1888532,如需转载请自行联系原作者

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
mysql 的预编译功能默认是关闭的| 学习笔记
快速学习 mysql 的预编译功能默认是关闭的。
75 0
MySQL 中的开启和关闭事务| 学习笔记
快速学习 MySQL中的开启和关闭事务
161 0
[MySQL FAQ]系列 — 为什么要关闭query cache,如何关闭
[MySQL FAQ]系列 — 为什么要关闭query cache,如何关闭
51 0
MySQL中的开启和关闭事务|学习笔记
快速学习MySQL中的开启和关闭事务
32 0
程序员之路:启动和关闭mysql服务
程序员之路:启动和关闭mysql服务
20 0
[MySQL FAQ]系列 — 如何安全地关闭MySQL实例
[MySQL FAQ]系列 — 如何安全地关闭MySQL实例
153 0
mysql启动和关闭外键约束的方法(FOREIGN_KEY_CHECKS)
本文主要讲mysql启动和关闭外键约束的方法
151 0
linux下开启、关闭、重启mysql服务
linux下开启、关闭、重启mysql服务
126 0
navicat通过ssh连接方式远程mysql(远程mysql3306端口关闭或者只允许localhost链接状态)...
navicat通过ssh连接方式远程mysql(远程mysql3306端口关闭或者只允许localhost链接状态)...
224 0
Navicat使用HTTP通道连接MySQL(远程mysql3306端口关闭或者只允许localhost链接状态)...
Navicat使用HTTP通道连接MySQL(远程mysql3306端口关闭或者只允许localhost链接状态)...
1314 0
+关注
余二五
文章
问答
视频
文章排行榜
最热
最新
相关电子书
更多
让 MySQL 原生分布式触手可及
立即下载
好的 MySQL 兼容可以做到什么程度
立即下载
云数据库RDS MySQL从入门到高阶
立即下载