系统
Rocky Linux
https://rockylinux.org/download
openSUSE
https://www.opensuse.org/
数据库
MySQL
https://dev.mysql.com/downloads/mysql/
https://rockylinux.org/download
https://www.opensuse.org/
https://dev.mysql.com/downloads/mysql/
For RHEL 6, RHEL 7, RHEL 8, RHEL 9
RAM size | Recommended swap size | Recommended swap size if allowing for hibernation |
From 0 to 2GB | 2 times the RAM size | 3 times the RAM size |
From 2GB to 8GB | The same size of the RAM | 2 times the RAM size |
From 8GB to 64GB | At least 4GB | 1.5 times the RAM size |
From 64GB | At least 4GB | Hibernation is not recommended |
Note: A 100GB swap is recommended if system with over 140 logical processes or over 3TB RAM
https://access.redhat.com/solutions/15244
通过 docker 启动的线程无法被 kill 命令杀掉。如果要取消这个进程,则只能关闭此容器。
# ip -s -h link
# iftop -nN -i eth0
(补充:这里以持续查看名为 eth0 网卡的流量为例)
# dmesg | grep page_owner
[ 1.149165] page_owner is disabled
(补充:当显示此类信息时则 page_owner 没有开启)
# ls -l /sys/kernel/debug/page_owner
ls: cannot access /sys/kernel/debug/page_owner: No such file or directory.
(补充:当 /sys/kernel/debug/page_owner 文件不存在时则 page_owner 没有开启)
# grubby --args="page_owner=on" --update-kernel=0
(注意:开启 page_owner 会额外占用一定量的内存)
# reboot
# dmesg | grep page_owner
[ 0.000000] Command line: BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-425.19.2.el8_7.x86_64 root=/dev/mapper/rootvg-rootlv ro ipv6.disable=1 audit=1 audit_backlog_limit=8192 crashkernel=auto resume=/dev/mapper/rootvg-swaplv rd.lvm.lv=rootvg/rootlv rd.lvm.lv=rootvg/swaplv rhgb quiet rd.shell=0 page_owner=on
[ 0.000000] Kernel command line: BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-425.19.2.el8_7.x86_64 root=/dev/mapper/rootvg-rootlv ro ipv6.disable=1 audit=1 audit_backlog_limit=8192 crashkernel=auto resume=/dev/mapper/rootvg-swaplv rd.lvm.lv=rootvg/rootlv rd.lvm.lv=rootvg/swaplv rhgb quiet rd.shell=0 page_owner=o
(补充:当显示此类信息时则 page_owner 已经开启)
# ls -l /sys/kernel/debug/page_owner
-r--------. 1 root root 0 Apr 13 14:36 /sys/kernel/debug/page_owner
(补充:当 /sys/kernel/debug/page_owner 文件存在时则 page_owner 已经开启)
# cat /sys/kernel/debug/page_owner > page_owner_full.txt
(补充:这里以将 page_owner 产生的记录导出到名为 page_owner_full.txt 文件为例)
(
注意:
1) 此命令会产生体积很巨大的文件
2) 此命令会持续执行直到手动取消
3) 可以通过同时按下 “ctrl” 键和 “C” 键或者使用 kill 命令取消
4) 如果内存变化较快则可以让此命令多执行一会,反之则可以少执行一会
)
# page_owner_sort page_owner_full.txt sorted_page_owner.txt
loaded 42903
sorting ....
culling
(补充:这里以分析名为 page_owner_full.txt 的文件并将分析结果导入到 sorted_page_owner.txt 文件为例)
# less sorted_page_owner.txt
1 times:
Page allocated via order 0, mask 0x0(), pid 1, tgid 1 (swapper/0), ts 48952109 ns, free_ts 0 ns
PFN 4096 type Unmovable Block 8 type Unmovable Flags 0xfffffc0000100(slab|node=0|zone=1|lastcpupid=0x1fffff)
register_early_stack+0x28/0x60
init_page_owner+0x30/0x2d0
kernel_init_freeable+0x13c/0x232
kernel_init+0xa/0x108
1 times:
Page allocated via order 0, mask 0x0(), pid 1, tgid 1 (swapper/0), ts 48952566 ns, free_ts 0 ns
PFN 4097 type Unmovable Block 8 type Unmovable Flags 0xfffffc0000100(slab|node=0|zone=1|lastcpupid=0x1fffff)
register_early_stack+0x28/0x60
init_page_owner+0x30/0x2d0
kernel_init_freeable+0x13c/0x232
kernel_init+0xa/0x108
......
(补充:这里以查看名为 sorted_page_owner.txt 文件里的分析结果为例)
# grubby --remove-args="page_owner=on" --update-kernel=0
(注意:关闭 page_owner 会额外释放一定量的内存)
# reboot
# dmesg | grep page_owner
[ 2.022585] page_owner is disabled
(补充:当显示此类信息时则 page_owner 没有开启)
# ls -l /sys/kernel/debug/page_owner
ls: cannot access '/sys/kernel/debug/page_owner': No such file or directory
(补充:当 /sys/kernel/debug/page_owner 文件不存在时则 page_owner 没有开启)
https://access.redhat.com/solutions/5609521