参考的这里

压测工具

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几个高性能框架的简单测试的更多相关文章

  1. ssm框架junit简单测试_我写

    第一步:导入相关jar包 主要是 junit包,和spring-test包 <dependecy> <groupId>junit</groupId> <art ...

  2. struts2+hibernate+spring注解版框架搭建以及简单测试(方便脑补)

    为了之后学习的日子里加深对框架的理解和使用,这里将搭建步奏简单写一下,目的主要是方便以后自己回来脑补: 1:File--->New--->Other--->Maven--->M ...

  3. struts2+hibernate+spring配置版框架搭建以及简单测试(方便脑补)

    为了之后学习的日子里加深对框架的理解和使用,这里将搭建步奏简单写一下,目的主要是方便以后自己回来脑补: 1:File--->New--->Other--->Maven--->M ...

  4. TensorFire:WEB端的高性能神经网络框架

    TensorFire:WEB端的高性能神经网络框架 摘要: 近日,一种专门用于在网页内执行神经网络算法的JavaScript库——TensorFire引起了人们的关注,这种JavaScript库在浏览 ...

  5. 【IDEA】单元测试:项目中引入JUnit测试框架+Mock简单了解

    一.Junit 使用和说明: 参考:单元测试第三弹--使用JUnit进行单元测试-HollisChuang's Blog http://www.hollischuang.com/archives/17 ...

  6. php简单测试slim框架的功能

    php简单测试slim框架的功能 监听主路径/ $app->get( '/', function () { $template = <<<EOT<!DOCTYPE htm ...

  7. 【AMAD】splinter -- 用于测试web app的python框架

    简介 动机 作用 用法 热度分析 个人评分 简介 Splinter1是一个开源工具,使用Python编写,用于测试web apps.它可以用来对浏览器实现自动化操作,比如访问URLs,和按钮等交互. ...

  8. Web API核查表:设计、测试、发布API时需思考的43件事[转]

    Web API核查表:设计.测试.发布API时需思考的43件事   当设计.测试或发布一个新的Web API时,你是在一个原有的复杂系统上构建新的系统.那么至少,你也要建立在HTTP上,而HTTP则是 ...

  9. Net系列框架-Dapper+简单三层架构

    Net系列框架-Dapper+简单三层架构 工作将近6年多了,工作中也陆陆续续学习和搭建了不少的框架,后续将按由浅入深的方式,整理出一些框架源码,所有框架源码本人都亲自调试通过,如果有问题,欢迎联系我 ...

随机推荐

  1. AspxGridView

    转:出处 http://i.cnblogs.com/EditPosts.aspx?opt=1 AspxGridView点滴 1:页码设置 <SettingsPager>         & ...

  2. 自定义动画方法 animate()

    animate方法的语法结构为: animate(params,speed,callback); 参数说明: (1) params:一个包含样式属性及值的映射,比如{property:'value1' ...

  3. jQuery停止动画和判断是否处于动画状态

    1.停止元素的动画 stop([clearQueue][,gotoEnd]); 参数clearQHCHC和gotoEnd都足町选的参数,为Boolean值(ture或flase).clearQueue ...

  4. c#---部分;把数组或者结构体存入集合里,然后再从集合中取出之后,输出;foreach既可以用到提取数组重点额数据,也可以提取集合中的数据(前提是集合中的元素是相同数据类型)

    1.输入班级人数,统计每个人的姓名,性别,年龄:集合与数组 //Console.Write("请输入班级人数:"); //int a = int.Parse(Console.Rea ...

  5. JAG Practice Contest for ACM-ICPC Asia Regional 2016

    2016弱校联盟十一专场10.3 传送门 B. Help the Princess! 计算皇后和士兵谁先到达出口即可. C. We don't wanna work! 两个优先队列维护工作中积极性最小 ...

  6. UVa 1583 Digit Generator --- 水题+打表

    UVa 1583 题目大意:如果x加上x的各个数字之和得到y,那么称x是y的生成元. 给定数字n,求它的最小生成元 解题思路:可以利用打表的方法,提前计算出以i为生成元的数,设为d,并保存在a[d]中 ...

  7. centos 6.4/redhat 6.4 安装gitlab

    一,把所有包升级到最新版本 yum -y upgrade 二,安装最新版ruby 2.1.5 步骤http://my.oschina.net/duolus/blog/348353 三,安装官方给出的o ...

  8. VC++多线程编程

    一.问题的提出 编写一个耗时的单线程程序: 新建一个基于对话框的应用程序SingleThread,在主对话框IDD_SINGLETHREAD_DIALOG添加一个按钮,ID为IDC_SLEEP_SIX ...

  9. javascript对时间的校验操作

    function check() { var startTime=$("#sTime").val(); var endTime=$("#eTime").val( ...

  10. 如何用OCR图文识别软件在文档里复制内容

    ABBYY FineReader 12是一款OCR图文识别软件,可从文档中复制文本.图片和表格,粘贴到其他应用程序中.无需识别整个文档(关于ABBYY FineReader识别文档的文章,请参考解析A ...