分享一下我用的sysctl.conf
侧边栏壁纸
  • 累计撰写 65,187 篇文章
  • 累计收到 0 条评论

分享一下我用的sysctl.conf

James
2024-10-11 / 0 评论 / 2 阅读 / 正在检测是否收录...

网络参数是从googlepixel9开源的代码抄的,google给它的安卓手机用的网络参数,我认为比较适合现代的网络环境,我把rmem改成和wmem一样了,因为服务器上传和下载都很重要,需要双向高速数据传输

https://cs.android.com/android/platform/superproject/main/+/main:device/google/zumapro/conf/init.zumapro.board.rc;l=100

net.ipv4.tcp_slow_start_after_idle=0是针对代理设置的,代理不需要慢启动

https://github.com/klzgrad/naiveproxy/wiki/Performance-Tuning#turn-off-tcp_slow_start_after_idle

net.ipv4.tcp_notsent_lowat=16384,naive作者推荐131072,我选择cloudflare推荐的16384

https://blog.cloudflare.com/http-2-prioritization-with-nginx

net.ipv4.tcp_ecn=1则是我用了bbrv3,支持ecn就试了下,对网速没什么影响而且从原理上能降低网络拥塞,外国的网站服务器也普遍开了ecn,用bbrv3的可以打开试试,需要本地设备也打开ecn

用bbrv1的不需要打开ecn

https://github.com/google/bbr/tree/v3?tab=readme-ov-file#enabling-ecn-support

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
net.core.rmem_default=1310720
net.core.rmem_max=8388608
net.core.wmem_default=1310720
net.core.wmem_max=8388608
net.core.optmem_max=20480
net.core.netdev_max_backlog=10000
net.ipv4.tcp_rmem=209715241943048388608
net.ipv4.tcp_wmem=209715241943048388608
net.ipv4.tcp_mem=442595901288518
net.ipv4.udp_mem=88518118025177036
net.ipv4.tcp_slow_start_after_idle=0
net.ipv4.tcp_notsent_lowat=16384
net.ipv4.tcp_ecn=1


-----------------------------------------------------
网友回复:

1GB内存

kernel.shmmax=536870912

4GB内存

kernel.shmmax=2147483648

8GB内存

kernel.shmmax=4294967296

16GB内存

kernel.shmmax=8589934592

0