惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
Cloudbric
Cloudbric
G
GRAHAM CLULEY
S
Securelist
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Project Zero
Project Zero
Spread Privacy
Spread Privacy
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
T
Tailwind CSS Blog
博客园_首页
有赞技术团队
有赞技术团队
Simon Willison's Weblog
Simon Willison's Weblog
Stack Overflow Blog
Stack Overflow Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Latest news
Latest news
T
Tor Project blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Attack and Defense Labs
Attack and Defense Labs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
O
OpenAI News
J
Java Code Geeks
T
Tenable Blog
K
Kaspersky official blog
AWS News Blog
AWS News Blog
S
Security @ Cisco Blogs
The GitHub Blog
The GitHub Blog
T
Threatpost
月光博客
月光博客
H
Heimdal Security Blog
Security Latest
Security Latest
The Hacker News
The Hacker News
Y
Y Combinator Blog
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
C
Cisco Blogs
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
C
CERT Recently Published Vulnerability Notes
D
Docker
Google Online Security Blog
Google Online Security Blog
D
DataBreaches.Net
V
Visual Studio Blog
H
Help Net Security

博客园 - YZG

zigbee路由(报文实例) Zigbee系列(路由机制) Zigbee系列(end device) Zigbee系列(网络) Zigbee系列(概览) kallsyms , addr to symbol Linux checksum flag in kernel ubuntu apt-xxx 清空DNS缓存 shell loop shell 参数 power sequece grep 文件内容搜索 netif_receive_skb pt_prev why? virtual machine AVR地址空间 altera 与 xilinx fifo 时序的区别 如何在Linux下实现50万并发 对Linux下socket限制的理解
Linux tcp socket相关参数设置
YZG · 2011-04-03 · via 博客园 - YZG

内容主要从网络上摘抄的,稍作了一下整理

来源1:

http://www.cnblogs.com/alli/archive/2011/01/11/1932599.html

1.进程打开文件数限制

 ulimit –n   == ulimit –n 1000000

 这表示当前用户的每个进程最多允许同时打开1024个文件,这1024个文件中还得除去每个进程必然打开的标准输入,标准输出,标准错误,服务器监听socket,进程间通讯的unixsocket等文件,那么剩下的可用于客户端socket连接的文件数就只有大概1024-10=1014个左右。也就是说缺省情况下,基于Linux的通讯程序最多允许同时1014TCP并发连接。

 典型现象:当connect,accpet 1000个左右连接后开始失败。

2、网络内核对TCP连接的有关限制

2.1 端口号范围限制

 net.ipv4.ip_local_port_range = 1025 65000

 到同一个主机的连接,超过端口用完后就会失败,这就是我们经常在网上看到的,说客户端最多只能向服务器发起6万多个连接。

2.2 iptable netfilter

第二种无法建立TCP连接的原因可能是因为Linux网络内核的IP_TABLE防火墙对最大跟踪的TCP连接数有限制。此时程序会表现为在connect()调用中阻塞,如同死机,如果用tcpdump工具监视网络,也会发现根本没有TCP连接时客户端发SYN包的网络流量。

net.ipv4.ip_conntrack_max = 10240

3.进程号

cat /proc/sys/kernel/pid_max

But you can change that too; on a 32-bit machine that'd be 2**22 as an absolute upper limit,

so:% sudo bash -c 'echo 4194303 > /proc/sys/kernel/pid_max'

4. tcp 协议栈参数

 待续...