多语言展示
当前在线:537今日阅读:23今日分享:25

Backlog的基本概念

backlog的值是网络连接过程中,某种状态的队列的长度;如果并发过高,那么会导致backlog的队列占满,服务器就会丢掉传进来的其他连接,然后就会出现客户端连接失败的情形;Now it(Backlog) specifies the queue length for completely established sockets waiting to be accepted, instead of the number of incomplete connection requests.  (backlog是指  一个队列的长度,这个队列是用来容纳已经成功建立连接的socket,对应参数是  net.core.somaxconn , 表现出来的故障一般是 反应缓慢. )The maximum length of the queue for incomplete sockets can be set using the tcp_max_syn_backlog sysctl.When syncookies are enabled there is no logical maximum length and this sysctl setting is ignored.(   tcp_max_syn_backlog  这个参数是控制半连接的队列的长度;这个表现出来的故障是: 无法建立连接。   在启用syncookie机制的情况下,这个参数是被忽略的)如果通过 netstat -s  显示的统计信息中有 类似   SYNS to LISTEN sockets ignored 的信息,表示连接队列被占满...netdev_max_backlog   表示网卡设备的backlog, 因为网卡接收数据包的速度远大于内核处理这些数据包的速度,所以,就出现了网卡设备的backlog.
推荐信息