下一篇: 网站建设集团:设计人员只注意了门的美观

网站建设方法:可以忽略其他端口的连接数,直接以服务器的全部连接数来进行估算。
Foreign Address State
O.0.0.O:★
O圭27.0.0.1:8118 0.0.0.O:★
0 :'0 .-01- 0 ; 0: 2:2
0.0.0.0:★
LISTEN
LISTEN
LISTEN
■●■■■■●●■■■■■■■■■■■_
808/sshd
tcp 0
1041/cupsd
tcp 0
1196/redis-server
tcp 0
114 9/memcached
tcp6 0
808/sshd
tcp6 0
1041/cupsd
127.0.0:1:631 . . .0.0.0.0:*
127.0.0.1:6379 ' . . ' 0.0.0.0:7k
127.0.0.1:11211 0.0.0.0:*
O :::22
O ::1:631
LISTEN
LISTEN
LISTEN
LISTEN
LISTEN
netstat查看到的state是在统计和排障中最经常被关心的数据。通常我们会使用如下
shell命令来计算服务器当前的80端口网络连接数。
$ netstat -tan I awk '$4~/:80$/t++state [$NF] } END { for (key in state) print
key,"\t",state [key] l'
LAST_ACK
SYN_RECV
ESTABLISHED
FIN_WAIT1
FIN_WAIT2
CLOSING
TIME WAIT
1
14
79
28
3
5
1669
不过netstat命令速度比较慢,如果服务器是单一业务,则可以忽略其他端口的连接数,
netstat -st I grep conn
2816395 active connections openings
541941 passive connection openings
2014738 failed connection attempts
7999 connection resets received .
40 connections established
9818 connections reset due to unexpected data
' 2372 connections reset due to early user close
4895 connections aborted due to timeout .
中已经提到过vmstat,其输出中除了内存相关的数据以外,还有I/O的内容,
下一篇: 网站建设集团:设计人员只注意了门的美观