盒子测试环境:192.168.44.59
对于SSD也可以采用同样的系统策略进行测试!
内核版本:
Linux nvidia-desktop 4.9.201-tegra #1 SMP PREEMPT Fri Feb 19 08:42:04 PST 2021 aarch64 aarch64 aarch64 GNU/Linux
系统:
Ubuntu 18.04.5 LTS
内核调优参数:
#sudo cat >> /etc/sysctl.conf <<- EOF
vm.min_free_kbytes = 83886
vm.watermark_scale_factor=100
vm.swappiness = 1
vm.dirty_background_ratio = 10
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
vm.vfs_cache_pressure = 500
vm.extfrag_threshold = 200
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_max_tw_buckets = 20000
net.ipv4.tcp_keepalive_time = 120
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.core.somaxconn = 65535
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.core.netdev_max_backlog = 30000
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_max_orphans = 262144
fs.file-max = 6553600
kernel.watchdog_thresh=30
EOF
#sudo sysctl -p
1)保证系统可靠运行,保留可用内存
2)优先使用物理内存,仅可能规避swap分区的使用
3)优先脏页数据尽量写入磁盘
4)放大tcp和udp的缓冲区,提升tcp,udp的收发包的性能
5)增加文件句柄
6)调整优先使用buffer缓冲区和内存整理的平衡
7)调整为内存触发策略min,low,high以及调大宽度,提前为峰值业务保留多一点内存
8)及时关闭tcp的链接,对于wait状态的链接开启重用文章来源:https://www.toymoban.com/news/detail-609312.html
压测后,测试观察:
1)磁盘swap分区,vmstat 1 1000
2)负载:uptime 负载
3)内存:free -h 和 smem
4)程序的运行时间和系统的运行时间
5)碎片化监控和zone各内存的分配情况文章来源地址https://www.toymoban.com/news/detail-609312.html
到了这里,关于智能盒子内核参数调优的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!