在清华大学出版社出版的<<Kubernetes零基础快速入门>>一书上看到了总结的Kubectl命令,觉得很不错,比较全,包括有命令的含义以及常见的资源对象,所以分享一下。
dirname $PIDFILEPATH` #Handle NUMA access to CPUs (SERVER-3574) #This verifies the existence of numactl as well as testing that the commandworks NUMACTL_ARGS="--interleave=all" if which numactl >/dev /null 2>/dev/null && numactl$NUMACTL_ARGS ls / >/dev/null 2>/dev/null then NUMACTL="numactl $NUMACTL_ARGS" else NUMACTL="" fi start() { # Make sure the default pidfile ulimit -u 64000 echo -n $"Starting mongod: " daemon --user "$MONGO_USER" --check $mongod "$NUMACTL
You have an upgrade for numactl-libs which is missing some dependency that another package You can try redoing the upgrade with --exclude numactl-libs.otherarch ... this should give You have duplicate versions of numactl-libs installed already. Protected multilib versions: numactl-libs-2.0.12-5.el7.i686 ! = numactl-libs-2.0.9-7.el7.x86_64我正在参与2023腾讯技术创作特训营第三期有奖征文,组队打卡瓜分大奖!
常用性能监测工具 Linux系统下,CPU与内存子系统性能调优的常用性能监测工具有top、perf、numactl这3个工具。1) top工具 top工具是最常用的Linux性能监测工具之一。 perf report 查看记录 3) numactl工具 numactl工具可用于查看当前服务器的NUMA节点配置、状态,可通过该工具将进程绑定到指定 以CentOS为例,使用如下命令安装numactl工具: numactl -H 查看当前服务器的NUMA配置。 例子:echo 0-4 > /proc/irq/78/smp_affinity_list echo 3,8 > /proc/irq/78/smp_affinity_list (2)通过numactl numactl -C 0-7 ./mongod (3)可以使用 taskset 命令把一个程序绑定在一个核上运行。 taskset -c 0 .
explicit_defaults_for_timestamp=true 二、 bin/mysqld: error while loading shared libraries: libnuma.so.1 如果安装mysql出现了以上的报错信息.这是却少numactl 这个时候如果是Centos就 yum -y install numactl 就可以解决这个问题了. ubuntu的就sudo apt-get install numactl就可以解决这个问题了 三、 –initialize specified but the data directory has files
【关闭NUMA的方案】 1、 在MySQLd_safe脚本中加上“numactl –interleave all”来启动mysqld 2、 Linux Kernel启动参数中加上numa=off,需要重启服务器 innodb_numa_interleave选项 对于2、3、4关闭NUMA的方案比较简单,不做详细描述,下面重点描述下1方案 【开启numa interleave访问的步骤】 1、 yum install numactl -y 2、修改/usr/bin/mysqld_safe文件 cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"下新增一条脚本 cmd="/usr/bin/numactl 10秒 sleep 10 6、#清理pagecache、dentries和inodes sysctl -q -w vm.drop_caches=3 7、service mysql start 8、验证numactl
下载 numactl 软件包: numactl-2.0.9-6.el7_2.x86_64.rpm numactl-devel-2.0.9-6.el7_2.x86_64.rpm numactl-libs 64.rpm 安装perl-Data-Dumper-2.145-3.el7.x86_64.rpm rpm -ivh perl-Data-Dumper-2.145-3.el7.x86_64.rpm 安装numactl 相关 rpm -ivh numactl* 如果不安装此包,我们将会得到如下错误 error: Failed dependencies: libnuma.so.1()(64bit) is needed
loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory 原因是这是缺少numactl 所以直接yum -y install numactl就可以解决这个问题了. yum -y install numactl 再次初始化MySQL,此时初始化成功 三、准备启动脚本并开启MySQL服务 cp mkdir /data/mysql/{data,tmp,binlog,log} -p chown -R mysql.mysql /data/mysql yum -y install autoconf numactl
numactl的使用 Linux提供了一个一个手工调优的命令numactl(默认不安装),在Ubuntu上的安装命令如下: sudo apt install numactl -y 首先你可以通过man numactl或者numactl --h了解参数的作用与输出的内容。 查看系统的numa状态: numactl --hardware 运行得到如下的结果: available: 4 nodes (0-3) node 0 cpus: 0 1 2 3 4 5 6 7 node numactl --interleave=all mongod -f /etc/mongod.conf 因为NUMA默认的内存分配策略是优先在进程所在CPU的本地内存中分配,会导致CPU节点之间内存分配不均衡
如我们前面所述,在NUMA架构里,每一个物理CPU都有不同的内存组,通过numactl命令可以查看这个分组情况。 # numactl --hardware available: 2 nodes (0-1) node 0 cpus: 0 1 2 3 4 5 12 13 14 15 16 17 node 0 size: 4 动手测试NUMA架构内存延迟差异 numactl命令有--cpubind和--membind的选项,通过它们我们可以指定我们要用的node节点。 还沿用《实际测试内存在顺序IO和随机IO时的访问延时差异》里的测试代码 1、让内存和CPU处于同一个Node 下面代码可能需要左右滑动 # numactl --cpubind=0 --membind=0 2.40 2.40 2.40 2.40 4.80 4.80 19.20 28.80 52.80 2、让内存和CPU处于不同Node 下面代码可能需要左右滑动 # numactl
loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory 原因是这是缺少numactl 所以直接yum -y install numactl就可以解决这个问题了. yum -y install numactl 再次初始化MySQL,此时初始化成功 三、准备启动脚本并开启MySQL服务 cp mkdir /data/mysql/{data,tmp,binlog,log} -p chown -R mysql.mysql /data/mysql yum -y install autoconf numactl
数据库层,在 mysqld_safe 脚本中加上 “numactl --interleave=all” 来启动 mysqld。 # numactl --interleave=all . 关于 NUMA 的误区: numactl 命令未找到,numa 就是未开启吗? 不是,numactl 是 Linux 提供的一个对 NUMA 进行手工调优的命令(默认不安装),可以用 numactl 命令查看系统的 NUMA 状态和对 NUMA 进行控制。
检查是否卸载完成 rpm -qa|grep mariadb 查看是否安装libaio rpm -qa|grep libaio 如果没有安装则执行 yum -y install libaio 查看是否安装numactl rpm -qa|grep numactl 如果没有安装则执行 yum -y install numactl 安装MySQL 这里我安装在/usr/local目录下 cd /usr/local/ wget
2.0.9-2.el6.x86_64.rpm --2015-12-09 01:22:50-- http://mirror.centos.org/centos/6/os/x86_64/Packages/numactl HTTP request sent, awaiting response... 200 OK Length: 75912 (74K) [application/x-rpm] Saving to: “numactl ============================>] 75,912 197K/s in 0.4s 2015-12-09 01:22:51 (197 KB/s) - “numactl el6.x86_64.rpm” saved [75912/75912] [root@slave02 percona56]# [root@slave02 percona56]# rpm -ivh numactl el6.x86_64.rpm Preparing... ########################################### [100%] 1:numactl
We suggest launching mongod like this to avoid performance problems: numactl –interleave=all mongod [other options] * 解决方案: 在原启动命令前面加numactl –interleave=all 如# numactl --interleave=all ${MONGODB_HOME}
2.0.9-2.el6.x86_64.rpm --2015-12-09 01:22:50-- http://mirror.centos.org/centos/6/os/x86_64/Packages/numactl HTTP request sent, awaiting response... 200 OK Length: 75912 (74K) [application/x-rpm] Saving to: “numactl ============================>] 75,912 197K/s in 0.4s 2015-12-09 01:22:51 (197 KB/s) - “numactl el6.x86_64.rpm” saved [75912/75912] [root@slave02 percona56]# [root@slave02 percona56]# rpm -ivh numactl el6.x86_64.rpm Preparing... ########################################### [100%] 1:numactl
大概了解一下NUMA最核心的numactl命令: shell> numactl --hardware available: 2 nodes (0-1) node 0 size: 16131 MB node 需要说明的一点事,numactl命令中看到的各节点剩余内存中时不包括Cache内存的,如果需要知道,我们可以利用drop_caches参数先释放它: shell> sysctl vm.drop_caches 如果要规避NUMA对SWAP的影响,最简单的方法就是在启动进程的时候禁用它: shell> numactl --interleave=all ...
那为了以后也别栽坑,赶紧去了解了下我的机器的numa状态: # numactl --hardware available: 2 nodes (0-1) node 0 cpus: 0 1 2 3 4 5 numactl --cpunodebind=0 --membind=0 /search/odin/daemon/redis/bin/redis-server /search/odin/daemon/redis 不过那是我手工通过numactl指令绑定cpu和mem的亲和性后才遭遇的。相信国内绝大部分的线上Redis没有进行这个绑定,所以理论上来单Redis单实例可以使用到整个机器的物理内存。 (实践中最好不要这么干,你的大部分内存都绑定到一个redis进程里的话,那其它CPU核就没啥事干了,浪费了CPU的多核计算能力) 6 扩展 当通过numactl绑定CPU和mem都在一个node里的时候 # numactl --hardware ...... node distances: node 0 1 0: 10 21 1: 21 10 你要是对性能有极致的追求,可以试着绑定
https://github.com/axboe/fio/blob/master/examples/libpmem.fio # # run command for this workload: # numactl -N 1 fio Libpmemjob.fio # numactl -N 1 fio --output=Libpmemjob.json --output-format=json Libpmemjob.fio 测试命令:(针对fsdax模式进行测试) numactl -N 1 fio --output=Libpmemjob.json --output-format=json Libpmemjob.fio 测试结果
operationProfiling: replication: replSetName: shard1 sharding: clusterRole: shardsvr 启动三台服务器的shard1 server numactl operationProfiling: replication: replSetName: shard2 sharding: clusterRole: shardsvr 启动三台服务器的shard2 server numactl operationProfiling: replication: replSetName: shard3 sharding: clusterRole: shardsvr 启动三台服务器的shard3 server numactl operationProfiling: replication: replSetName: shard4 sharding: clusterRole: shardsvr 启动三台服务器的shard4 server numactl operationProfiling: replication: replSetName: shard5 sharding: clusterRole: shardsvr 启动三台服务器的shard5 server numactl