Jenkins在Ubuntu上的网络优化实践
一 基础网络与端口可达性
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: no
addresses: [10.0.2.15/24]
gateway4: 10.0.2.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
二 传输层与内核网络优化
sudo sysctl -p | grep bbr
echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
echo "net.ipv4.ip_local_port_range=10240 65535" | sudo tee -a /etc/sysctl.conf
echo "net.ipv4.tcp_tw_reuse=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
echo "net.ipv4.tcp_fin_timeout=15" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
三 代理与上游仓库优化
http_proxy="http://proxy.example.com:8080"
https_proxy="http://proxy.example.com:8080"
no_proxy="localhost,127.0.0.1,.example.com"
使环境变量生效并重启相关服务(如 Jenkins)。四 分布式构建与高可用
五 快速检查清单