mysql 内存优化之关闭numa

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

关闭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 /VERSION if
                              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 /VERSION if
                              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,如需转载请自行联系原作者
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
3月前
|
存储 缓存 关系型数据库
【如何选择Mysql服务器的CPU核数及内存大小】
【如何选择Mysql服务器的CPU核数及内存大小】
105 0
|
3月前
|
监控 关系型数据库 MySQL
走进RDS之MySQL内存分配与管理(下)
本篇为下篇,主要对MySQL内存限制特性进行解读,代码基于8.0.28。本文将围绕该项工作的改动、设计实现等方面展开介绍。
|
3月前
|
SQL 关系型数据库 MySQL
走进RDS之MySQL内存分配与管理(上)
MySQL的内存分配、使用、管理的模块较多,本篇文章主要介绍InnoDB层和SQL层内存分配管理器,主要包括ut_allocator、mem_heap_allocator和MEM_ROOT,代码版本主要基于8.0.25。
|
3月前
|
存储 监控 关系型数据库
深度剖析MySQL Performance Schema内存管理
深度剖析MySQL Performance Schema内存管理:源码分析与改进思路 MySQL Performance Schema(PFS)是MySQL提供的强大的性能监控诊断工具,它能够在运行时检查server内部执行情况。PFS通过监视server内部已注册的事件来收集信息,将收集到的性能数据存储在performance_schema存储引擎中。本文将深入剖析PFS内存分配及释放原理,解读其中存在的问题以及改进思路。
52 2
|
5月前
|
关系型数据库 MySQL
mysql内存计算公式
mysql内存计算公式
82 0
|
9月前
|
存储 SQL 缓存
MySQL高级第三篇(共四篇)之应用优化、查询缓存优化、内存管理优化、MySQL锁问题、常用SQL技巧(二)
锁是计算机协调多个进程或线程并发访问某一资源的机制(避免争抢)。 在数据库中,除传统的计算资源(如 CPU、RAM、I/O 等)的争用以外,数据也是一种供许多用户共享的资源。如何保证数据并发访问的一致性、有效性是所有数据库必须解决的一个问题,锁冲突也是影响数据库并发访问性能的一个重要因素。从这个角度来说,锁对数据库而言显得尤其重要,也更加复杂。
369 0
|
9月前
|
SQL 存储 缓存
MySQL高级第三篇(共四篇)之应用优化、查询缓存优化、内存管理优化、MySQL锁问题、常用SQL技巧(一)
前面章节,我们介绍了很多数据库的优化措施。但是在实际生产环境中,由于数据库本身的性能局限,就必须要对前台的应用进行一些优化,来降低数据库的访问压力。
15963 7
|
11月前
|
存储 SQL 缓存
MySQL 8 内存的使用
mysql内存使用的计算公式
186 0
|
11月前
|
存储 SQL 缓存
MySQL-DB参数、内存、I/O、安全等相关参数设置
MySQL-DB参数、内存、I/O、安全等相关参数设置
137 0
|
11月前
|
存储 SQL 缓存
一文带你了解MySQL之Server层的内存结构
前面的文章我们介绍了InnoDB存储引擎的一些内存、内存+磁盘的结构以及工作原理,今天我们就来看一下关于MySQL Server层的一些内存结构。
109 0