解决问题的记录【一】TCP连接过多导致新连接创建失败

        工作中项目在现场跑的过程中遇到的问题,8080端口TCP连接轻松破万,导致运行的过程中有概率无法初始化socket问题。知识学习和问题排查的过程如下:

1.DOS查看网络端口情况的命令

在这里我们使用命令netstat -ano > c:\netstatus.txt 将网络情况输出到文件中。

  协议  本地地址          外部地址        状态           PID
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       3600
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       876
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:623            0.0.0.0:0              LISTENING       3260
  TCP    0.0.0.0:902            0.0.0.0:0              LISTENING       3636
  TCP    0.0.0.0:912            0.0.0.0:0              LISTENING       3636
  TCP    0.0.0.0:2425           0.0.0.0:0              LISTENING       9436
  TCP    0.0.0.0:3316           0.0.0.0:0              LISTENING       3312
  TCP    0.0.0.0:3389           0.0.0.0:0              LISTENING       1408
  TCP    0.0.0.0:5001           0.0.0.0:0              LISTENING       3040
  TCP    0.0.0.0:5002           0.0.0.0:0              LISTENING       3040
  TCP    0.0.0.0:5357           0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:7501           0.0.0.0:0              LISTENING       2712
  TCP    0.0.0.0:8001           0.0.0.0:0              LISTENING       3040
  TCP    0.0.0.0:8003           0.0.0.0:0              LISTENING       2052
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       12476
  TCP    0.0.0.0:8101           0.0.0.0:0              LISTENING       2052
  TCP    0.0.0.0:9001           0.0.0.0:0              LISTENING       3040
  TCP    0.0.0.0:9003           0.0.0.0:0              LISTENING       2052
  TCP    0.0.0.0:9911           0.0.0.0:0              LISTENING       5540
  TCP    0.0.0.0:9984           0.0.0.0:0              LISTENING       3040
  TCP    0.0.0.0:9985           0.0.0.0:0              LISTENING       2052
  TCP    0.0.0.0:9988           0.0.0.0:0              LISTENING       12476
  TCP    0.0.0.0:16992          0.0.0.0:0              LISTENING       3260
  TCP    0.0.0.0:30985          0.0.0.0:0              LISTENING       9436
  TCP    0.0.0.0:49152          0.0.0.0:0              LISTENING       572
  TCP    0.0.0.0:49153          0.0.0.0:0              LISTENING       1012
  TCP    0.0.0.0:49154          0.0.0.0:0              LISTENING       692
  TCP    0.0.0.0:49156          0.0.0.0:0              LISTENING       596
  TCP    0.0.0.0:50153          0.0.0.0:0              LISTENING       11032
  TCP    0.0.0.0:54889          0.0.0.0:0              LISTENING       15092
  TCP    0.0.0.0:57296          0.0.0.0:0              LISTENING       11032
  TCP    0.0.0.0:61028          0.0.0.0:0              LISTENING       684
  TCP    0.0.0.0:61033          0.0.0.0:0              LISTENING       5148
  TCP    10.82.13.155:80        10.82.13.155:52739     ESTABLISHED     3600
  TCP    10.82.13.155:80        10.82.13.155:52883     ESTABLISHED     3600
  TCP    10.82.13.155:139       0.0.0.0:0              LISTENING       4
  TCP    10.82.13.155:9988      10.82.13.155:60400     ESTABLISHED     12476
  TCP    10.82.13.155:9988      10.82.13.155:60515     ESTABLISHED     12476
  TCP    10.82.13.155:15100     0.0.0.0:0              LISTENING       8216
  TCP    10.82.13.155:15101     0.0.0.0:0              LISTENING       8216
  TCP    10.82.13.155:15101     10.82.13.222:10150     ESTABLISHED     8216
  TCP    10.82.13.155:23095     10.82.13.222:15101     ESTABLISHED     8216
  TCP    10.82.13.155:49462     10.82.1.7:5200         ESTABLISHED     11032
  TCP    10.82.13.155:49470     10.82.1.7:5201         ESTABLISHED     11032
  TCP    10.82.13.155:51190     101.201.173.115:80     ESTABLISHED     5336
  TCP    10.82.13.155:51358     101.201.173.115:80     ESTABLISHED     10316
  TCP    10.82.13.155:51400     10.82.1.3:49159        ESTABLISHED     2032
  TCP    10.82.13.155:51629     101.201.173.115:80     ESTABLISHED     5336
  TCP    10.82.13.155:51705     101.201.173.115:80     ESTABLISHED     2768
  TCP    10.82.13.155:51766     101.201.173.115:80     ESTABLISHED     10252
  TCP    10.82.13.155:51848     101.201.173.115:80     ESTABLISHED     10252
  TCP    10.82.13.155:52476     162.247.242.20:443     ESTABLISHED     10252
  TCP    10.82.13.155:52545     101.201.173.115:80     ESTABLISHED     2868
  TCP    10.82.13.155:52581     101.201.173.115:80     ESTABLISHED     2868
  TCP    10.82.13.155:52585     101.201.173.115:80     ESTABLISHED     2868
  TCP    10.82.13.155:52720     101.201.173.115:80     ESTABLISHED     10316
  TCP    10.82.13.155:52739     10.82.13.155:80        ESTABLISHED     2768
  TCP    10.82.13.155:52883     10.82.13.155:80        ESTABLISHED     2768
  TCP    10.82.13.155:53358     101.201.170.241:80     TIME_WAIT       0
  TCP    10.82.13.155:53359     101.201.170.241:80     TIME_WAIT       0
  TCP    10.82.13.155:53396     120.55.251.98:80       LAST_ACK        5336
  TCP    10.82.13.155:53430     203.208.39.231:443     TIME_WAIT       0
  TCP    10.82.13.155:53512     10.82.1.5:8000         ESTABLISHED     5840
  TCP    10.82.13.155:53582     10.82.25.22:8082       TIME_WAIT       0
  TCP    10.82.13.155:53604     14.215.177.38:443      CLOSE_WAIT      2768
  TCP    10.82.13.155:53605     14.215.177.38:443      CLOSE_WAIT      2768
  TCP    10.82.13.155:53606     14.215.177.37:443      ESTABLISHED     2768
  TCP    10.82.13.155:53607     14.215.177.37:443      CLOSE_WAIT      2768
  TCP    10.82.13.155:53609     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53610     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53611     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53612     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53613     14.215.177.38:443      CLOSE_WAIT      2768
  TCP    10.82.13.155:53614     14.215.177.38:443      CLOSE_WAIT      2768
  TCP    10.82.13.155:53618     14.215.177.38:443      CLOSE_WAIT      2768
  TCP    10.82.13.155:53619     14.215.177.38:443      CLOSE_WAIT      2768
  TCP    10.82.13.155:53620     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53621     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53622     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53623     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53624     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53625     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53626     220.170.182.33:443     CLOSE_WAIT      2768
  TCP    10.82.13.155:53630     14.215.177.37:443      CLOSE_WAIT      2768
  TCP    10.82.13.155:53631     14.215.177.37:443      CLOSE_WAIT      2768
  TCP    10.82.13.155:53633     14.215.177.38:80       LAST_ACK        10252
  TCP    10.82.13.155:53636     10.82.0.10:89          LAST_ACK        10252
  TCP    10.82.13.155:53637     10.82.0.10:89          LAST_ACK        10252
  TCP    10.82.13.155:53657     220.181.57.215:80      ESTABLISHED     5336
  TCP    10.82.13.155:53658     220.181.57.215:80      ESTABLISHED     5336
  TCP    10.82.13.155:53659     124.232.157.92:80      ESTABLISHED     5336
  TCP    10.82.13.155:53660     124.232.157.92:80      ESTABLISHED     5336
  TCP    10.82.13.155:53661     124.232.157.120:80     ESTABLISHED     5336
  TCP    10.82.13.155:53662     124.232.157.120:80     ESTABLISHED     5336
  TCP    10.82.13.155:53663     124.232.157.120:80     ESTABLISHED     5336
  TCP    10.82.13.155:53664     124.232.157.120:80     ESTABLISHED     5336
  TCP    10.82.13.155:53665     124.232.157.120:80     ESTABLISHED     5336
  TCP    10.82.13.155:53666     124.232.157.120:80     ESTABLISHED     5336
  TCP    10.82.13.155:53667     124.232.157.122:80     CLOSE_WAIT      5336
  TCP    10.82.13.155:53668     124.232.157.122:80     ESTABLISHED     5336
  TCP    10.82.13.155:53670     220.170.182.48:80      CLOSE_WAIT      5336
  TCP    10.82.13.155:53671     220.170.182.48:80      CLOSE_WAIT      5336
  TCP    10.82.13.155:53714     106.75.75.228:80       ESTABLISHED     2868
  TCP    10.82.13.155:53716     10.82.25.22:8082       TIME_WAIT       0
  TCP    10.82.13.155:53720     47.94.71.34:80         LAST_ACK        10316
  TCP    10.82.13.155:53721     47.94.71.34:80         ESTABLISHED     10316
  TCP    10.82.13.155:53724     10.82.1.8:135          ESTABLISHED     3080
  TCP    10.82.13.155:53725     10.82.1.8:49155        ESTABLISHED     3080
  TCP    10.82.13.155:53726     10.82.1.15:5688        ESTABLISHED     3080
  TCP    10.82.13.155:53743     10.82.1.8:135          TIME_WAIT       0
  TCP    10.82.13.155:53744     10.82.1.8:49155        ESTABLISHED     692
  TCP    10.82.13.155:53761     106.75.91.237:80       ESTABLISHED     10316
  TCP    10.82.13.155:57836     10.82.13.55:445        ESTABLISHED     4
  TCP    10.82.13.155:58996     10.82.25.251:3316      ESTABLISHED     10280
  TCP    10.82.13.155:60400     10.82.13.155:9988      ESTABLISHED     3040
  TCP    10.82.13.155:60515     10.82.13.155:9988      ESTABLISHED     2052
  TCP    10.82.13.155:61624     10.82.1.3:445          ESTABLISHED     4
  TCP    10.82.13.155:61625     10.82.1.2:445          ESTABLISHED     4
  TCP    127.0.0.1:943          0.0.0.0:0              LISTENING       1428
  TCP    127.0.0.1:3316         127.0.0.1:60336        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60337        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60338        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60339        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60340        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60341        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60342        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60343        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60344        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60345        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60346        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60347        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60348        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60349        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60350        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60351        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60352        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60353        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60354        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60355        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60356        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60357        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60358        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60359        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60360        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60361        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60362        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60363        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60364        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60365        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60366        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60367        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60368        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60369        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60370        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60371        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60372        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60373        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60374        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60375        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60376        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60377        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60378        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60379        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60380        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60381        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60382        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60383        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60384        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60385        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60386        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60460        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60461        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60462        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60463        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60464        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60465        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60466        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60467        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60468        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60469        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60470        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60471        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60472        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60473        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60474        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60475        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60476        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60477        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60478        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60479        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60480        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60481        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60482        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60483        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60484        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60485        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60486        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60487        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60488        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60489        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60490        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60491        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60492        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60493        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60494        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60495        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60496        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60497        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60498        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60499        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60500        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60501        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60502        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60503        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60504        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60505        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60506        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60507        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60508        ESTABLISHED     3312
  TCP    127.0.0.1:3316         127.0.0.1:60509        ESTABLISHED     3312
  TCP    127.0.0.1:4506         0.0.0.0:0              LISTENING       1428
  TCP    127.0.0.1:4506         127.0.0.1:62056        ESTABLISHED     1428
  TCP    127.0.0.1:8080         127.0.0.1:53574        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53585        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53588        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53593        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53595        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53603        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53616        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53646        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53650        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53651        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53674        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53677        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53681        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53685        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53686        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53694        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53697        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53701        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53706        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53708        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53718        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53727        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53733        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53736        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53741        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53746        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53752        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53756        TIME_WAIT       0
  TCP    127.0.0.1:8080         127.0.0.1:53759        ESTABLISHED     12476
  TCP    127.0.0.1:8080         127.0.0.1:53764        TIME_WAIT       0
  TCP    127.0.0.1:9088         0.0.0.0:0              LISTENING       6060
  TCP    127.0.0.1:9911         127.0.0.1:53586        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53589        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53590        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53594        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53602        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53608        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53617        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53629        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53647        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53649        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53652        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53673        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53675        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53678        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53680        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53682        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53684        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53690        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53693        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53696        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53698        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53700        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53702        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53707        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53715        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53717        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53722        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53730        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53732        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53735        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53738        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53745        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53747        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53749        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53754        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53755        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53758        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53763        TIME_WAIT       0
  TCP    127.0.0.1:9911         127.0.0.1:53766        TIME_WAIT       0
  TCP    127.0.0.1:10501        0.0.0.0:0              LISTENING       2052
  TCP    127.0.0.1:10501        127.0.0.1:61174        ESTABLISHED     2052
  TCP    127.0.0.1:10502        0.0.0.0:0              LISTENING       2052
  TCP    127.0.0.1:10502        127.0.0.1:61175        ESTABLISHED     2052
  TCP    127.0.0.1:40000        127.0.0.1:40001        ESTABLISHED     3080
  TCP    127.0.0.1:40001        127.0.0.1:40000        ESTABLISHED     3080
  TCP    127.0.0.1:49460        127.0.0.1:49461        ESTABLISHED     11032
  TCP    127.0.0.1:49461        127.0.0.1:49460        ESTABLISHED     11032
  TCP    127.0.0.1:49468        127.0.0.1:49469        ESTABLISHED     11032
  TCP    127.0.0.1:49469        127.0.0.1:49468        ESTABLISHED     11032
  TCP    127.0.0.1:53583        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53587        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53592        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53599        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53615        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53629        127.0.0.1:9911         TIME_WAIT       0
  TCP    127.0.0.1:53639        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53648        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53656        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53676        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53679        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53683        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53691        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53695        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53699        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53703        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53712        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53719        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53731        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53734        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53742        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53747        127.0.0.1:9911         TIME_WAIT       0
  TCP    127.0.0.1:53748        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53753        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53757        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:53759        127.0.0.1:8080         ESTABLISHED     3600
  TCP    127.0.0.1:53765        127.0.0.1:54889        CLOSE_WAIT      12476
  TCP    127.0.0.1:54889        127.0.0.1:53583        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53587        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53592        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53599        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53615        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53639        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53648        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53656        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53676        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53679        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53683        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53691        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53695        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53699        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53703        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53712        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53719        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53731        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53734        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53742        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53748        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53753        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53757        FIN_WAIT_2      15092
  TCP    127.0.0.1:54889        127.0.0.1:53765        FIN_WAIT_2      15092
  TCP    127.0.0.1:60284        127.0.0.1:60285        ESTABLISHED     15092
  TCP    127.0.0.1:60285        127.0.0.1:60284        ESTABLISHED     12476
  TCP    127.0.0.1:60336        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60337        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60338        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60339        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60340        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60341        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60342        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60343        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60344        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60345        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60346        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60347        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60348        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60349        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60350        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60351        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60352        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60353        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60354        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60355        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60356        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60357        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60358        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60359        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60360        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60361        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60362        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60363        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60364        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60365        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60366        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60367        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60368        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60369        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60370        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60371        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60372        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60373        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60374        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60375        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60376        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60377        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60378        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60379        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60380        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60381        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60382        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60383        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60384        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60385        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60386        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60410        127.0.0.1:60412        ESTABLISHED     12476
  TCP    127.0.0.1:60412        127.0.0.1:60410        ESTABLISHED     12476
  TCP    127.0.0.1:60418        127.0.0.1:60419        ESTABLISHED     12476
  TCP    127.0.0.1:60419        127.0.0.1:60418        ESTABLISHED     12476
  TCP    127.0.0.1:60434        127.0.0.1:60435        ESTABLISHED     12476
  TCP    127.0.0.1:60435        127.0.0.1:60434        ESTABLISHED     12476
  TCP    127.0.0.1:60437        127.0.0.1:60438        ESTABLISHED     12476
  TCP    127.0.0.1:60438        127.0.0.1:60437        ESTABLISHED     12476
  TCP    127.0.0.1:60460        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60461        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60462        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60463        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60464        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60465        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60466        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60467        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60468        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60469        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60470        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60471        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60472        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60473        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60474        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60475        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60476        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60477        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60478        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60479        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60480        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60481        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60482        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60483        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60484        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60485        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60486        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60487        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60488        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60489        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60490        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60491        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60492        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60493        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60494        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60495        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60496        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60497        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60498        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60499        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60500        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60501        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60502        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60503        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60504        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60505        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60506        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60507        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60508        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60509        127.0.0.1:3316         ESTABLISHED     12476
  TCP    127.0.0.1:60510        127.0.0.1:60511        ESTABLISHED     12476
  TCP    127.0.0.1:60511        127.0.0.1:60510        ESTABLISHED     12476
  TCP    127.0.0.1:61174        127.0.0.1:10501        ESTABLISHED     2052
  TCP    127.0.0.1:61175        127.0.0.1:10502        ESTABLISHED     2052
  TCP    127.0.0.1:61205        0.0.0.0:0              LISTENING       3260
  TCP    127.0.0.1:62056        127.0.0.1:4506         ESTABLISHED     2648
  TCP    [::]:135               [::]:0                 LISTENING       876
  TCP    [::]:445               [::]:0                 LISTENING       4
  TCP    [::]:623               [::]:0                 LISTENING       3260
  TCP    [::]:3316              [::]:0                 LISTENING       3312
  TCP    [::]:3389              [::]:0                 LISTENING       1408
  TCP    [::]:5357              [::]:0                 LISTENING       4
  TCP    [::]:8080              [::]:0                 LISTENING       12476
  TCP    [::]:9988              [::]:0                 LISTENING       12476
  TCP    [::]:16992             [::]:0                 LISTENING       3260
  TCP    [::]:49152             [::]:0                 LISTENING       572
  TCP    [::]:49153             [::]:0                 LISTENING       1012
  TCP    [::]:49154             [::]:0                 LISTENING       692
  TCP    [::]:49156             [::]:0                 LISTENING       596
  TCP    [::]:54889             [::]:0                 LISTENING       15092
  TCP    [::]:61028             [::]:0                 LISTENING       684
  TCP    [::]:61033             [::]:0                 LISTENING       5148
  TCP    [::1]:61204            [::]:0                 LISTENING       4792
  TCP    [::1]:61206            [::1]:61208            ESTABLISHED     3260
  TCP    [::1]:61208            [::1]:61206            ESTABLISHED     3260
  UDP    0.0.0.0:123            *:*                                    500
  UDP    0.0.0.0:500            *:*                                    596
  UDP    0.0.0.0:2425           *:*                                    9436
  UDP    0.0.0.0:3702           *:*                                    500
  UDP    0.0.0.0:3702           *:*                                    500
  UDP    0.0.0.0:3702           *:*                                    2552
  UDP    0.0.0.0:3702           *:*                                    2552
  UDP    0.0.0.0:4500           *:*                                    596
  UDP    0.0.0.0:5061           *:*                                    2052
  UDP    0.0.0.0:5355           *:*                                    1408
  UDP    0.0.0.0:8502           *:*                                    3040
  UDP    0.0.0.0:8503           *:*                                    2768
  UDP    0.0.0.0:8504           *:*                                    2768
  UDP    0.0.0.0:8967           *:*                                    3040
  UDP    0.0.0.0:8967           *:*                                    2052
  UDP    0.0.0.0:9981           *:*                                    2052
  UDP    0.0.0.0:9981           *:*                                    3040
  UDP    0.0.0.0:10000          *:*                                    3040
  UDP    0.0.0.0:10001          *:*                                    2052
  UDP    0.0.0.0:10002          *:*                                    2052
  UDP    0.0.0.0:20000          *:*                                    3040
  UDP    0.0.0.0:37025          *:*                                    2052
  UDP    0.0.0.0:50153          *:*                                    11032
  UDP    0.0.0.0:51644          *:*                                    500
  UDP    0.0.0.0:54837          *:*                                    500
  UDP    0.0.0.0:56716          *:*                                    2552
  UDP    0.0.0.0:57296          *:*                                    11032
  UDP    10.82.13.155:137       *:*                                    4
  UDP    10.82.13.155:138       *:*                                    4
  UDP    10.82.13.155:1900      *:*                                    2552
  UDP    10.82.13.155:49475     *:*                                    2552
  UDP    127.0.0.1:1900         *:*                                    2552
  UDP    127.0.0.1:49476        *:*                                    2552
  UDP    127.0.0.1:56347        *:*                                    1120
  UDP    127.0.0.1:57564        *:*                                    692
  UDP    127.0.0.1:57566        *:*                                    1408
  UDP    [::]:123               *:*                                    500
  UDP    [::]:500               *:*                                    596
  UDP    [::]:3702              *:*                                    2552
  UDP    [::]:3702              *:*                                    500
  UDP    [::]:3702              *:*                                    500
  UDP    [::]:3702              *:*                                    2552
  UDP    [::]:4500              *:*                                    596
  UDP    [::]:5355              *:*                                    1408
  UDP    [::]:51645             *:*                                    500
  UDP    [::]:54838             *:*                                    500
  UDP    [::]:56717             *:*                                    2552
  UDP    [::1]:1900             *:*                                    2552
  UDP    [::1]:49474            *:*                                    2552
  UDP    [fe80::95ec:92b1:5cc6:151%12]:546  *:*                                    1012
  UDP    [fe80::95ec:92b1:5cc6:151%12]:1900  *:*                                    2552
  UDP    [fe80::95ec:92b1:5cc6:151%12]:49473  *:*                                    2552

任务管理器 的进程中可以根据对应的PID可以找到对应的进程的.
State显示是

LISTENING时表示处于侦听状态,就是说该端口是开放的
ESTABLISHED的意思是建立连接。表示两台机器正在通信。
CLOSE_WAIT 对方主动关闭连接或者网络 异常导致连接中断
TIME_WAIT 我方主动调用close()断开连接,收到对方确认后状态变为TIME_WAIT
因此我们需要重点关注的是ESTABLISHED状态.

实际上现场的TIME_WAIT数量达到了2w以上,即是每个请求都被快速处理,但是我方服务器没有及时释放连接。



2.排查服务器释放连接相关知识: 

windows服务器收到对方确认close状态后变为TIME_WAIT,默认240S后回收连接

所以是服务器在这240s接收到的tcp连接请求非常多,处理这个问题有两个方面,一个方面是将默认延迟回收端口连接时间缩短。另一个方面是找出请求的来源。

3.1,将默认240s回收连接改为30(最小值) 或者 60s 具体做法是将注册表中的默认值改掉。

1.最大TCP连接数      TcpNumConnections
2.TCP关闭延迟时间    TCPTimedWaitDelay    (30-240)s
3.最大动态端口数   MaxUserPort  (Default = 5000, Max = 65534)

4.2 此处排查请求的来源根据自己项目情况。比如我现在的情况是

8080端口的tcp连接数非常多。但是我关闭nginx服务器时,连接可以在短时间内全部降下来,我们可以确定是HTTP协议的连接导致TCP涨上去的。

通过学习HTTP长连接和短连接的知识,通过head中keep-alive的http连接是问题的来源。

再接下来排查访问nginx的应用。此处通过关闭应用进程排查。通过逐个查找可以查到具体的应用。


最后说下原因:由于做前后端的分离,前端需要向后端查询通知(get方式、长连接),这个查询的异常处理最近一段时间改过(由于这个线程必须要一直查询不能中断,所以就算一场了也继续查询)。问题出在这里,在特定情况下服务器会返回前端异常,此时前端收到异常又马上以相同的参数请求服务器,形成了一个死循环在短时间内创建了非常多的HTTP连接。故8080端口TCP连接爆涨。


PS http是应用层协议,传输层走tcp,网络层走IP





你可能感兴趣的:(解决问题的记录【一】TCP连接过多导致新连接创建失败)