网络知识

1. iptable的使用

  四个表:

  1. filter:包过滤
  2. nat:网络地址转换
  3. mangle:包重构
  4. raw:数据跟踪处理

  链:

  1. prerouting: 对数据包作路由选择前应用此链中的规则(记住!所有的数据包进来的时侯都先由这个链处理)
  2. input: 进来的数据包应用此规则链中的策略
  3. output: 外出的数据包应用此规则链中的策略
  4. postrouting: 对数据包作路由选择后应用此链中的规则(记住!所有的数据包出来的时侯都先由这个链处理)
  5. forward: 转发数据包时应用此规则链中的策略

  当一个数据包从外网进来时:要经过prerouting --> input --> output --> postrouting

  当一个数据包从本机发起时:要经过 --> output --> postrouting

 

 

service time:

python:

  without nginx

Server Software:        nginx/1.10.3
Server Hostname:        119.23.231.141
Server Port:            8888

Document Path:          /weimingliu
Document Length:        25 bytes

Concurrency Level:      100
Time taken for tests:   52.387 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      1830000 bytes
HTML transferred:       250000 bytes
Requests per second:    190.89 [#/sec] (mean)
Time per request:       523.870 [ms] (mean)
Time per request:       5.239 [ms] (mean, across all concurrent requests)
Transfer rate:          34.11 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        6  148 301.5     14    5024
Processing:     7  260 1054.6    143   28546
Waiting:        7  254 1054.9     85   28546
Total:         14  408 1099.5    267   28553

Percentage of the requests served within a certain time (ms)
  50%    267
  66%    408
  75%    434
  80%    450
  90%    716
  95%   1240
  98%   2463
  99%   3278
 100%  28553 (longest request)
View Code

  with nginx

Server Software:        gunicorn/20.0.4
Server Hostname:        119.23.231.141
Server Port:            30080

Document Path:          /weimingliu
Document Length:        25 bytes

Concurrency Level:      100
Time taken for tests:   55.593 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      1770000 bytes
HTML transferred:       250000 bytes
Requests per second:    179.88 [#/sec] (mean)
Time per request:       555.934 [ms] (mean)
Time per request:       5.559 [ms] (mean, across all concurrent requests)
Transfer rate:          31.09 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        6  175 333.1     38    7066
Processing:     7  269 1009.6    170   28548
Waiting:        7  253 1007.1    145   28548
Total:         14  444 1065.8    294   28568

Percentage of the requests served within a certain time (ms)
  50%    294
  66%    419
  75%    459
  80%    487
  90%   1028
  95%   1333
  98%   1684
  99%   3196
 100%  28568 (longest request)
View Code

 

go:

  without nginx

Server Software:
Server Hostname:        119.23.231.141
Server Port:            30080

Document Path:          /weimingliu
Document Length:        10 bytes

Concurrency Level:      100
Time taken for tests:   43.342 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      1270000 bytes
HTML transferred:       100000 bytes
Requests per second:    230.73 [#/sec] (mean)
Time per request:       433.415 [ms] (mean)
Time per request:       4.334 [ms] (mean, across all concurrent requests)
Transfer rate:          28.62 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        6  174 374.2    126    7288
Processing:     6  201 533.5    187   15247
Waiting:        6  197 533.6    182   15247
Total:         12  376 659.3    371   15289

Percentage of the requests served within a certain time (ms)
  50%    371
  66%    418
  75%    431
  80%    438
  90%    488
  95%   1039
  98%   1548
  99%   3161
 100%  15289 (longest request)
View Code

  with nginx

Server Software:        nginx/1.10.3
Server Hostname:        119.23.231.141
Server Port:            8888

Document Path:          /weimingliu
Document Length:        10 bytes

Concurrency Level:      100
Time taken for tests:   53.412 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      1770000 bytes
HTML transferred:       100000 bytes
Requests per second:    187.22 [#/sec] (mean)
Time per request:       534.120 [ms] (mean)
Time per request:       5.341 [ms] (mean, across all concurrent requests)
Transfer rate:          32.36 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        6  167 440.3     90   15298
Processing:     6  261 1445.7    157   29088
Waiting:        6  257 1445.9    150   29088
Total:         13  427 1513.7    294   29112

Percentage of the requests served within a certain time (ms)
  50%    294
  66%    401
  75%    435
  80%    446
  90%    664
  95%   1262
  98%   1661
  99%   3353
 100%  29112 (longest request)
View Code

 

posted on 2020-05-10 19:34  stupid_one  阅读(131)  评论(0编辑  收藏  举报

导航