web几个高性能框架的简单测试
参考的这里
压测工具
wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello
测试代码
package main
import (
"strconv"
"time"
"github.com/kataras/iris"
"github.com/gin-gonic/gin"
"net/http"
"os"
"github.com/labstack/echo"
"github.com/labstack/echo/engine/standard"
) func makeIrisServer(timeDuration int){
api := iris.New() api.Party("rest").Get("/hello", func(c *iris.Context) {
//api.Get("/rest/hello", func(c *iris.Context) {
if timeDuration > {
time.Sleep(time.Duration(timeDuration) * time.Millisecond)
}
c.Write("Hello world")
}) api.Listen(":8080")
} func makeEchoServer(timeDuration int) {
api := echo.New()
api.GET("/rest/hello", func(c echo.Context) error {
if timeDuration > {
time.Sleep(time.Duration(timeDuration) * time.Millisecond)
}
return c.String(http.StatusOK, "Hello, World")
}) api.Run(standard.New(":8080"))
} func makeGinServer(timeDuration int){
gin.SetMode(gin.ReleaseMode) //关闭日志
//router := gin.Default()
router := gin.New() router.GET("/rest/hello", func(c *gin.Context) {
if timeDuration > {
time.Sleep(time.Duration(timeDuration) * time.Millisecond)
}
c.String(http.StatusOK, "hello world")
}) router.Run(":8080")
} func main() { sleepTime, _ := strconv.Atoi(os.Args[]) //makeIrisServer(sleepTime)
//makeGinServer(sleepTime)
makeEchoServer(sleepTime)
}
iris
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .85ms .59ms .74ms 95.48%
Req/Sec .50k 421.36 .09k 83.79%
requests in .09s, .12MB read
Requests/sec: 55744.97
Transfer/sec: .55MB
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .07ms .46ms .15ms 68.94%
Req/Sec 459.16 39.35 580.00 70.85%
requests in .07s, .74MB read
Requests/sec: 7302.65
Transfer/sec: .99MB
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .20ms .84ms .79ms 62.15%
Req/Sec 57.67 5.37 116.00 97.15%
requests in .10s, .74MB read
Requests/sec: 917.96
Transfer/sec: .30KB
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .01s .46ms .01s 64.12%
Req/Sec 5.27 1.58 38.00 99.57%
requests in .09s, .06KB read
Requests/sec: 92.52
Transfer/sec: .83KB
gin
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .33ms .91ms .31ms 92.11%
Req/Sec .25k .86k .52k 81.88%
requests in .10s, .97MB read
Requests/sec: 51708.60
Transfer/sec: .31MB
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .83ms .96ms .34ms 73.74%
Req/Sec 468.89 44.26 590.00 57.39%
requests in .11s, .41MB read
Requests/sec: 7457.75
Transfer/sec: .91MB
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .77ms .82ms .78ms 66.52%
Req/Sec 57.10 5.86 116.00 96.34%
requests in .07s, .32MB read
Requests/sec: 903.81
Transfer/sec: .98KB
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .00s .08ms .01s 62.46%
Req/Sec 5.21 0.41 6.00 79.31%
requests in .09s, .00KB read
Requests/sec: 92.52
Transfer/sec: .57KB
echo
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .47ms .21ms .28ms 91.91%
Req/Sec .21k .89k .60k 82.53%
requests in .10s, .11MB read
Requests/sec: 51069.64
Transfer/sec: .28MB
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .62ms .86ms .19ms 74.89%
Req/Sec 476.33 41.71 590.00 58.02%
requests in .09s, .05MB read
Requests/sec: 7575.22
Transfer/sec: .93MB
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .16ms .88ms .46ms 63.02%
Req/Sec 57.33 5.38 103.00 96.94%
requests in .09s, .37MB read
Requests/sec: 909.37
Transfer/sec: .56KB
./server
Running 30s test @ http://127.0.0.1:8080/rest/hello
threads and connections
Thread Stats Avg Stdev Max +/- Stdev
Latency .00s .99ms .01s 62.32%
Req/Sec 5.29 1.39 30.00 99.14%
requests in .10s, .72KB read
Requests/sec: 92.50
Transfer/sec: .65KB
web几个高性能框架的简单测试的更多相关文章
- ssm框架junit简单测试_我写
第一步:导入相关jar包 主要是 junit包,和spring-test包 <dependecy> <groupId>junit</groupId> <art ...
- struts2+hibernate+spring注解版框架搭建以及简单测试(方便脑补)
为了之后学习的日子里加深对框架的理解和使用,这里将搭建步奏简单写一下,目的主要是方便以后自己回来脑补: 1:File--->New--->Other--->Maven--->M ...
- struts2+hibernate+spring配置版框架搭建以及简单测试(方便脑补)
为了之后学习的日子里加深对框架的理解和使用,这里将搭建步奏简单写一下,目的主要是方便以后自己回来脑补: 1:File--->New--->Other--->Maven--->M ...
- TensorFire:WEB端的高性能神经网络框架
TensorFire:WEB端的高性能神经网络框架 摘要: 近日,一种专门用于在网页内执行神经网络算法的JavaScript库——TensorFire引起了人们的关注,这种JavaScript库在浏览 ...
- 【IDEA】单元测试:项目中引入JUnit测试框架+Mock简单了解
一.Junit 使用和说明: 参考:单元测试第三弹--使用JUnit进行单元测试-HollisChuang's Blog http://www.hollischuang.com/archives/17 ...
- php简单测试slim框架的功能
php简单测试slim框架的功能 监听主路径/ $app->get( '/', function () { $template = <<<EOT<!DOCTYPE htm ...
- 【AMAD】splinter -- 用于测试web app的python框架
简介 动机 作用 用法 热度分析 个人评分 简介 Splinter1是一个开源工具,使用Python编写,用于测试web apps.它可以用来对浏览器实现自动化操作,比如访问URLs,和按钮等交互. ...
- Web API核查表:设计、测试、发布API时需思考的43件事[转]
Web API核查表:设计.测试.发布API时需思考的43件事 当设计.测试或发布一个新的Web API时,你是在一个原有的复杂系统上构建新的系统.那么至少,你也要建立在HTTP上,而HTTP则是 ...
- Net系列框架-Dapper+简单三层架构
Net系列框架-Dapper+简单三层架构 工作将近6年多了,工作中也陆陆续续学习和搭建了不少的框架,后续将按由浅入深的方式,整理出一些框架源码,所有框架源码本人都亲自调试通过,如果有问题,欢迎联系我 ...
随机推荐
- Linux常用命令整理 - imsoft.cnblogs
su 用户名 在不退出登陆的情况下,切换到另外一个人的身份如果用户名缺省,则切换到root状态会提示输入密码,密码不回显的. 在用su命令切换root用户时,使用“-”选项,这样可以将root的环境变 ...
- raido 赋值第一次成功,然后就赋值不显示
$("#id").attr("checked",true); //显示出现问题,第一次成功 $("#id").prop("chec ...
- 无线路由器wds桥接技术+丢包率
半根毛线http://www.cnblogs.com/hsd-/ 今天下午鼓捣了一下无线路由的wds桥接 算是计算机网络的作业 码来分享一下 1.首先设置主路由 我的主路由是斐讯4线 路由ip为192 ...
- PHP新手入门1——表单
注:本身是Android,Android之前是java.但公司后台PHP特别多.就好奇php后台是怎么通过一个url给我数据的(完全不懂php).于是就学呗.学习系列随笔第一人称是一个Android小 ...
- POJ2125 Destroying The Graph (最小点权覆盖集)(网络流最小割)
Destroying The Graph Time Limit: 2000MS Memo ...
- 深入理解javascript的闭包
闭包(closure)是Javascript语言的一个难点,也是它的特色,很多高级应用都要依靠闭包实现. 一.变量的作用域 要理解闭包,首先必须理解Javascript特殊的变量作用域. 变量的作用域 ...
- UBUNTU下SUBLIME TEXT3的安装+破解+汉化+中文输入
一.Sublime Text3的下载安装 建议直接去官网下载最新版deb安装包:http://www.sublimetext.com/3 二.Sublime Text3的破解 3114版 -– BEG ...
- How to Configure the Gradient Boosting Algorithm
How to Configure the Gradient Boosting Algorithm by Jason Brownlee on September 12, 2016 in XGBoost ...
- caffe 训练时,出现错误:Check failed: error == cudaSuccess (4 vs. 0) unspecified launch failure
I0415 15:03:37.603461 27311 solver.cpp:42] Solver scaffolding done.I0415 15:03:37.603549 27311 solve ...
- VS产生sdf和ipch文件太大处理方案
方法: 工具-->选项-->文本编辑器-->C/C++-->高级-->回退位置,把始终使用回退位置设置为true,回退位置已在使用,不警告也设置为true,回退位置设置为 ...