-
Notifications
You must be signed in to change notification settings - Fork 1
/
tcp相关配置.html
31 lines (31 loc) · 1.67 KB
/
tcp相关配置.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html><html><head><meta charset="utf-8"><link rel="stylesheet" type="text/css" href="./css/github_new.css"><link rel="shortcut icon" href="favicon.png" type="image/x-icon"><!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-160306868-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-160306868-1');
</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5809313774160994"
crossorigin="anonymous"></script>
<title>tcp相关配置</title></head><body><h4>linux 内核参数</h4>
<ul>
<li>tcp_max_syn_backlog: 用于设置半连接队列(syn queue,内核中实现为一个哈希表)大小</li>
<li>somaxconn: 用于设置全连接队列(accept queue)大小</li>
<li>syncookies: 开启此参数可以再不使用半连接队列的情况下成功建立连接</li>
</ul>
<h4>用户参数</h4>
<ul>
<li>backlog: 用于设置全连接队列大小</li>
</ul>
<p>tcp_max_syn_backlog, somaxconn, backlog这三个参数的最小值就是半连接队列的最大长度</p>
<p>somaxconn和backlog的最小值就是全连接队列的最大长度</p>
<h4>临时修改内核参数命令</h4>
<div class="highlight highlight-source-shell"><pre class="notranslate">sudo sysctl -w net.core.somaxconn=4096</pre></div><hr><p>Mon Dec 6 10:39:41 2021</p><script src="https://utteranc.es/client.js"
repo="caixiangyue/caixiangyue.github.io"
issue-term="pathname"
theme="github-light"
crossorigin="anonymous"
async>
</script>
</body></html>