搬运一些网络调优的链接,搬运网络调优链接


找瓶颈:1.CPU 2.内存 3.网卡带宽 4.测试工具比如ab是否是瓶颈
https://groups.google.com/forum/#!topic/OpenResty/P4ld9CH9gcg

查看带宽:
nethogs: 按进程查看流量占用
iptraf: 按连接/端口查看流量
ifstat: 按设备查看流量
ethtool: 诊断工具
tcpdump: 抓包工具
ss: 连接查看工具
其他: dstat, slurm, nload, bmon
https://www.zhihu.com/question/19862245

Linux TCP/IP调优
https://tonydeng.github.io/2015/05/25/linux-tcpip-tuning/
http://yangrong.blog.51cto.com/6945369/1321594

Linux 建立 TCP 连接的超时时间分析
http://www.chengweiyang.cn/2017/02/18/linux-connect-timeout/

测Nginx速度的时候,这样调:
Just a little bit tuning in the kernel to allow higher limits

fs.file-max 9999999
fs.nr_open 9999999
net.core.netdev_max_backlog 4096
net.core.rmem_max 16777216
net.core.somaxconn 65535
net.core.wmem_max 16777216
net.ipv4.ip_forward 0
net.ipv4.ip_local_port_range 1025 65535
net.ipv4.tcp_fin_timeout 30
net.ipv4.tcp_keepalive_time 30
net.ipv4.tcp_max_syn_backlog 20480
net.ipv4.tcp_max_tw_buckets 400000
net.ipv4.tcp_no_metrics_save 1
net.ipv4.tcp_syn_retries 2
net.ipv4.tcp_synack_retries 2
net.ipv4.tcp_tw_recycle 1
net.ipv4.tcp_tw_reuse 1
vm.min_free_kbytes 65536
vm.overcommit_memory 1
https://gist.github.com/hgfischer/7965620

实战配置高QPS服务器(Nginx+Tomcat)
http://www.cnblogs.com/echovalley/archive/2013/04/02/2994634.html

tcp_tw_reuse、tcp_tw_recycle 使用场景及注意事项
http://www.cnblogs.com/lulu/p/4149312.html

The manpage of netstat has a brief description of each state:
https://askubuntu.com/questions/538443/whats-the-difference-between-port-status-listening-time-wait-close-wait
ESTABLISHED
The socket has an established connection.
SYN_SENT
The socket is actively attempting to establish a connection.
SYN_RECV
A connection request has been received from the network.
FIN_WAIT1
The socket is closed, and the connection is shutting down.
FIN_WAIT2
Connection is closed, and the socket is waiting for a shutdown
from the remote end.
TIME_WAIT
The socket is waiting after close to handle packets still in the
network.
CLOSE The socket is not being used.
CLOSE_WAIT
The remote end has shut down, waiting for the socket to close.
LAST_ACK
The remote end has shut down, and the socket is closed. Waiting
for acknowledgement.
LISTEN The socket is listening for incoming connections. Such sockets
are not included in the output unless you specify the
–listening (-l) or –all (-a) option.
CLOSING
Both sockets are shut down but we still don’t have all our data
sent.
UNKNOWN
The state of the socket is unknown.

C1000k
http://www.ideawu.net/blog/tag/c1000k
https://www.urbanairship.com/blog/linux-kernel-tuning-for-c500k

man
http://man7.org/linux/man-pages/man7/tcp.7.html
http://man7.org/linux/man-pages/man7/socket.7.html

相关内容

    暂无相关文章