Linux 閮剜舀銝餈啁隤踵,甇斗敹脰雿喳隤踵:4 T' _& L+ ^. N9 `3 g& ?# g
* q. {: r9 a4 K6 P y/ M4 S#vi /etc/sysctl.conf
) {% l9 _/ {2 C; w W/ s### 寥脩頂蝯梯園蝞∠ ###, w* S" x; Y0 `0 n
8 b W: |2 A/ E2 K, L! z' k
F% `2 q+ i2 e3 m) ~9 k# 憭扳獢inode敹怠& W* G# [6 Y" }7 ]
fs.file-max = 2097152
1 a& v; P' _2 I1 w1 a
$ W8 d1 k3 @# U; x9 L2 ^+ N! u! y$ y' _5 b B; S8 A9 ~; Y
# 頛撠鈭斗8 f* ]/ C# ~. t& y
vm.swappiness = 101 B6 o0 j2 w6 B" x3 m
vm.dirty_ratio = 60
+ L$ f! o1 y- Y8 Z( [2 C" ~8 Svm.dirty_background_ratio = 29 N. y3 t: g) c' C' t
7 o% i& r( f, p4 z G+ p
" [. r$ Z5 S$ h$ R
### 銝祉蝬脰楝摰券賊 ###. Z' R- {* | H1 W. F3 Z
$ |7 i( p2 Y* F9 Z/ C% P# E R% ?& ~ P8 x9 w3 C+ f
# 鋡怠(passive)TCP亦SYNACKs甈⊥
3 Y: T$ M! {: H4 enet.ipv4.tcp_synack_retries = 2
& X) k3 u# @! V* A8 ^
6 x0 p; X" d8 d L0 ~7 j3 Z) N4 J; ?( R6 V& w
# 閮望祆蝬脰楝仿蝭; x) ~% z# c5 C% t. F; [$ ] D
net.ipv4.ip_local_port_range = 2000 65535/ ^3 {0 i+ J+ g. ^
# a# ?, I! ]/ q3 W7 w* t5 ^0 G! q( o7 N- h2 c5 y
# 貿CP Time-Wait靽霅7 k7 M$ y3 {8 N
net.ipv4.tcp_rfc1337 = 1; I8 `+ S1 t' D) \ d' z" j! M
, c9 i4 n! B* [3 g) j) v* W' K* |( \+ i) R- @! U
# 雿撠 tcp_fin_timeout connection 閮剖" O+ O1 P7 J, B" ]" S$ H: A3 l
net.ipv4.tcp_fin_timeout = 15
, x: w) z- n* F
: O4 X6 |9 e3 u2 F, G9 x5 B0 d) u0 L) f/ |
# 雿蝺摮瘣餅閮剖
& k- d' `9 p& {net.ipv4.tcp_keepalive_time = 3003 a! }+ ^* [8 |9 V' Z7 S/ C
net.ipv4.tcp_keepalive_probes = 5# ?, r4 F3 G( i( `# t0 E$ R
net.ipv4.tcp_keepalive_intvl = 15
( w ~$ ~( s0 _- \- I7 `- k& b& T# S. \! z1 m
' j, W: |- J$ u$ p* e4 y) S$ \### 隤踵渡雯頝舀 ###
% I8 n# [2 f6 f
4 r5 H- v) T) J% ?8 c# Y/ s1 O5 B8 z( @$ T
# 閮剔Socket交嗥楨摮
. h0 W4 Q" F; Mnet.core.rmem_default = 31457280% n4 N, z2 i- t* e- L
, \ J( }; I! B/ Y5 h
' \% _& F' q# ` v! [
# 憭抒Socket交嗥楨摮
( }, X. L2 ^0 T) n4 N9 M* z, snet.core.rmem_max = 125829120 ], I! F0 E% h
9 P. R$ N/ L. h0 o
' M7 B9 R* X- v
# 閮剔Socket喲蝺拙; U& d, Z3 K6 f q- d' D+ C
net.core.wmem_default = 31457280- p7 i% G* T9 a/ j" j
1 ]/ b7 u. v q' A
2 E7 S& u1 a3 o7 G5 d% o# 憭抒Socket喲蝺拙
, J8 J5 J7 g: ~/ w. H9 x- A. R+ wnet.core.wmem_max = 125829126 H( |2 L' w# [0 a
5 a" Q7 k4 y! J: l! N1 k$ L7 x$ @9 M4 x; K# S
# 憭抒雯頝舫交
2 A9 [. c2 {6 N2 Ynet.core.somaxconn = 4096
5 N. E N* Y' y+ b
" x+ @ B& ` B4 B7 L5 U8 }
0 Y# M1 |" o3 n; n q# 憭抒雯頝舫亦backlog7 i, M4 J2 a; F9 v/ s
net.core.netdev_max_backlog = 65536
' y) b0 L( s" h5 j8 {4 s1 v0 H1 X: ~3 Q, r
4 x8 I5 ]9 h* D6 \1 v
# 憭扯園蝺拙憭折4 L' ~' ~9 u2 [6 n% K
net.core.optmem_max = 25165824% M* c1 L6 Z5 G1 V- v- c4 {0 S: u
/ ]5 o7 T' c# `* x2 d4 m* b9 i5 _2 ?2 D2 w
# Increase the maximum total buffer-space allocatable憭批臬蝺拙蝛粹憭抒蜇
- I: x4 W$ _ c! e$ d# This is measured in units of pages (4096 bytes)- P3 m# ^: R, _# K& ~- o( \
net.ipv4.tcp_mem = 65536 131072 262144
' e: M! K- F, ]* q/ Gnet.ipv4.udp_mem = 65536 131072 262144
: [, ^, ?# X; ~ W1 \9 [# O* j, E. C+ V) Q9 Y2 b; ^" T
2 I( Q* \( `/ h) f# 憭扯蝺拙臬蝛粹
+ h5 e/ e8 I7 O4 C o$ e. p+ Pnet.ipv4.tcp_rmem = 8192 87380 16777216
5 t2 v6 Y6 t) {8 L- b; Pnet.ipv4.udp_rmem_min = 16384
5 d- x( A) Z& M4 _# X
# s7 p: x) L9 _6 M2 i( [: U2 K7 {1 E: ]+ Z d+ z V# d) q) N' p4 c
# 憭批神亦楨摮臬蝛粹1 p3 {; Q% e( o6 Y$ B5 l
net.ipv4.tcp_wmem = 8192 65536 16777216
5 I) n F! u1 ? v0 Z! t: L+ `net.ipv4.udp_wmem_min = 16384; \+ i3 m6 a. o( P' O+ R! m, E" c5 d) B
+ x2 A- W h5 V( T9 j0 ~) f$ [4 k+ M9 j8 U. a g
# 憭含cp-time-wait獢嗅瘙賊隞仿脩陛DOS餅, G% M% @8 z7 b- [9 B
net.ipv4.tcp_max_tw_buckets = 1440000; Y( {# ~+ `3 `/ Z
net.ipv4.tcp_tw_recycle = 1
$ n: i1 J. Z* g. p5 a/ f' Ynet.ipv4.tcp_tw_reuse = 15 l, S3 \4 e2 F5 R) ?' }) f2 Q* j2 [
# V$ @& U' K! h( b$ l
2 e( h% g c- w; B2 I& F- T/ f摮瑼隞亦
6 M: n* x4 N9 ]- Y$ R" [" a" g#sysctl -p 頛亙歇霈9 @/ P9 X& I. d/ z$ y2 Z
$ D( j( `2 X6 Z7 y% f6 L; N
靘皞: G$ L6 U5 y, O. _9 t
5 x8 T. n8 U/ ?4 |$ A3 a, }
https://easyengine.io/tutorials/linux/sysctl-conf/3 q$ `; W4 o) W/ ^' z/ o/ A
摰g砍梯批捆閬蝛擃 888999999999 舐閬踝函嗅蝛 0 7 x0 s" |/ |2 {: v2 J1 R
- k0 z3 C e1 r9 k! h) m. K
$ ^4 \6 M' p6 s2 b" \/ K: o6 @# T
# U; J F' T6 F! U, i5 A6 w. h |
|