全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1694|回复: 6

[疑问] 优化了一下网络设置,感觉油管速度提升了20%+

[复制链接]
发表于 2023-6-1 16:41:50 | 显示全部楼层 |阅读模式
本帖最后由 AlanNeverStop 于 2023-6-1 16:45 编辑

这个是默认的:
sysctl -w net.core.wmem_max=16777216
sysctl -w net.core.rmem_max=16777216

sysctl -w net.ipv4.tcp_wmem='4096        212992        16777216'
sysctl -w net.ipv4.tcp_rmem='4096        212992        16777216'


这个是优化过后的

sysctl -w net.core.wmem_max=33554432
sysctl -w net.core.rmem_max=33554432

sysctl -w net.ipv4.tcp_wmem='4096 425984 33554432'
sysctl -w net.ipv4.tcp_rmem='4096 425984 33554432'

sysctl -w net.ipv4.tcp_fastopen=1


不知道是心理作用还是啥,没执行前是稳定6-7W,执行过后到9W了
发表于 2023-6-1 16:42:42 | 显示全部楼层
心理作用,物理物理不好在优化也没用
 楼主| 发表于 2023-6-1 16:43:31 | 显示全部楼层
newwstd 发表于 2023-6-1 16:42
心理作用,物理物理不好在优化也没用

线路是CN2 GIA,物理应该是没问题的...
发表于 2023-6-1 16:44:31 | 显示全部楼层
First we need to do some kernel settings for performance and raise ulimits.
sudo nano /etc/sysctl.conf
Copy this at end of then file and save and close.
  1. net.ipv4.tcp_keepalive_time = 90
  2. net.ipv4.ip_local_port_range = 1024 65535
  3. net.ipv4.tcp_fastopen = 3
  4. net.core.default_qdisc=fq
  5. net.ipv4.tcp_congestion_control=bbr
  6. fs.file-max = 65535000
复制代码

Then run this command to edit limits.conf
sudo nano /etc/security/limits.conf
Copy this at end of the file and save and close.
  1. * soft     nproc          655350
  2. * hard     nproc          655350
  3. * soft     nofile         655350
  4. * hard     nofile         655350
  5. root soft     nproc          655350
  6. root hard     nproc          655350
  7. root soft     nofile         655350
  8. root hard     nofile         655350
复制代码

Run this to apply settings.
sudo sysctl -p
 楼主| 发表于 2023-6-1 16:52:56 | 显示全部楼层
hostvps 发表于 2023-6-1 16:44
First we need to do some kernel settings for performance and raise ulimits.
sudo nano /etc/sysctl.co ...

不知道是不是和我执行的哪个冲突了,改完后速度只剩5W+了
发表于 2023-6-2 09:56:12 | 显示全部楼层
hostvps 发表于 2023-6-1 16:44
First we need to do some kernel settings for performance and raise ulimits.
sudo nano /etc/sysctl.co ...

20w油管改完剩10w
发表于 2023-6-2 12:40:43 | 显示全部楼层
MoeClub
https://github.com/MoeClub/apt/blob/master/bbr/bbr.sh


Neko Neko Cloud
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_ecn=0
net.ipv4.tcp_frto=0
net.ipv4.tcp_mtu_probing=0
net.ipv4.tcp_rfc1337=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_fack=1
net.ipv4.tcp_window_scaling=2
net.ipv4.tcp_adv_win_scale=2
net.ipv4.tcp_moderate_rcvbuf=1
net.ipv4.tcp_rmem=4096 65536 37331520
net.ipv4.tcp_wmem=4096 65536 37331520
net.core.rmem_max=37331520
net.core.wmem_max=37331520
net.ipv4.udp_rmem_min=8192
net.ipv4.udp_wmem_min=8192
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-21 07:07 , Processed in 0.067541 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表