webman下数据库压测和webman-admin下数据库压测差距很大

咸鱼不咸

问题描述

在本地压测,都是相同的数据库查询条件,在webman下和webman-admin下差距非常大,是哪里配置有问题吗?

$product = UnionProduct::where('type',$type)->paginate($limit);

都是一样的查询条件,在webman下面2000+,而放在webman-admin插件下面,能达到2w+,是我哪里设置有问题吗?
webman 下面

ab -n10000 -c200 -k http://127.0.0.1:8787/api/v1/product

Server Software:        workerman
Server Hostname:        127.0.0.1
Server Port:            8787

Document Path:          /api/v1/product
Document Length:        1744 bytes

Concurrency Level:      200
Time taken for tests:   3.789 seconds
Complete requests:      10000
Failed requests:        0
Keep-Alive requests:    10000
Total transferred:      18600000 bytes
HTML transferred:       17440000 bytes
Requests per second:    2639.10 [#/sec] (mean)
Time per request:       75.784 [ms] (mean)
Time per request:       0.379 [ms] (mean, across all concurrent requests)
Transfer rate:          4793.67 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       9
Processing:     0   74 335.3     40    3761
Waiting:        0   74 335.3     40    3761
Total:          0   74 335.3     40    3761

Percentage of the requests served within a certain time (ms)
  50%     40
  66%     45
  75%     48
  80%     50
  90%     53
  95%     60
  98%     64
  99%   1727
 100%   3761 (longest request)

webman-admin 下面

ab -n10000 -c200 -k http://127.0.0.1:8787/app/admin/product

Server Software:        workerman
Server Hostname:        127.0.0.1
Server Port:            8787

Document Path:          /app/admin/product
Document Length:        82 bytes

Concurrency Level:      200
Time taken for tests:   0.460 seconds
Complete requests:      10000
Failed requests:        0
Keep-Alive requests:    10000
Total transferred:      2920000 bytes
HTML transferred:       820000 bytes
Requests per second:    21732.37 [#/sec] (mean)
Time per request:       9.203 [ms] (mean)
Time per request:       0.046 [ms] (mean, across all concurrent requests)
Transfer rate:          6197.12 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       9
Processing:     0    9  25.5      7     440
Waiting:        0    9  25.5      7     440
Total:          0    9  25.5      7     440

Percentage of the requests served within a certain time (ms)
  50%      7
  66%      9
  75%     10
  80%     10
  90%     11
  95%     13
  98%     14
  99%     15
 100%    440 (longest request)

看起来传输的字节大了很多,但是没明白怎么回事,跪求大神指点一下!

687 2 0
2个回答

walkor 打赏

webman-admin请求一般需要登录,你的ab压测是未登录状态,返回大小是82 bytes,应该是没请求到数据库,跳转到登录了

W

学习了

  • 暂无评论
年代过于久远,无法发表回答
×
🔝