golang net/http vs fasthttp 一瞥

1G内存 ubuntu 14.04 服务器共享cpu

net/http vs fasthttp

3132 ubuntu 20 0 128548 8300 1108 S 0.0 0.0 0:00.07 ball-server-lin

3132 ubuntu 20 0 1567624 76980 1384 S 0.0 0.1 0:01.50 ball-server-lin

 

 

3192 ubuntu 20 0 204212 8892 1080 S 0.0 0.0 0:00.04 ball-server

3192 ubuntu 20 0 1522076 96624 1384 S 0.0 0.2 0:01.39 ball-server

 

 

Benchmarking 127.0.0.1 (be patient)

Completed 100 requests

Completed 200 requests

Completed 300 requests

Completed 400 requests

Completed 500 requests

Finished 500 requests

 

 

Server Software:

Server Hostname: 127.0.0.1

Server Port: 8080

 

Document Path: /totalreports

Document Length: 1042418 bytes

 

Concurrency Level: 20

Time taken for tests: 4.349 seconds

Complete requests: 500

Failed requests: 0

Total transferred: 521249500 bytes

HTML transferred: 521209000 bytes

Requests per second: 114.98 [#/sec] (mean)

Time per request: 173.941 [ms] (mean)

Time per request: 8.697 [ms] (mean, across all concurrent requests)

Transfer rate: 117058.71 [Kbytes/sec] received

 

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 0.6 0 12

Processing: 5 173 109.5 186 547

Waiting: 4 160 109.6 182 546

Total: 5 173 109.6 186 547

 

Percentage of the requests served within a certain time (ms)

50% 186

66% 198

75% 205

80% 210

90% 354

95% 373

98% 496

99% 506

100% 547 (longest request)

Benchmarking 127.0.0.1 (be patient)

Completed 100 requests

Completed 200 requests

Completed 300 requests

Completed 400 requests

Completed 500 requests

Finished 500 requests

 

 

Server Software: fasthttp

Server Hostname: 127.0.0.1

Server Port: 8080

 

Document Path: /totalreports

Document Length: 1042418 bytes

 

Concurrency Level: 20

Time taken for tests: 4.270 seconds

Complete requests: 500

Failed requests: 0

Total transferred: 521280500 bytes

HTML transferred: 521209000 bytes

Requests per second: 117.09 [#/sec] (mean)

Time per request: 170.803 [ms] (mean)

Time per request: 8.540 [ms] (mean, across all concurrent requests)

Transfer rate: 119216.13 [Kbytes/sec] received

 

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 0.2 0 3

Processing: 7 170 112.5 188 452

Waiting: 7 166 113.1 186 449

Total: 7 170 112.6 188 452

 

Percentage of the requests served within a certain time (ms)

50% 188

66% 200

75% 210

80% 218

90% 364

95% 377

98% 405

99% 437

100% 452 (longest request)

 

从sqlite取30条记录,转json响应,数据量1m。

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值