参考的这里

压测工具

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. HttpResponse的Close和End 区别

    转载自:http://blog.sina.com.cn/s/blog_702c390c0100mlhi.html 最近启用了IIS上的压缩功能,但是测试系统上某模块变得不可用了.该模块采用AJAX技术 ...

  2. win7将 esc与 capslock 互换

    一天手软,于是买了一个机械键盘.cherry g80-3494 红轴各方面都不错就是有一个问题我经常用vim,其中esc.及F键区离主键盘区实在是太远了. 习惯于vim模式的人都有一种懒症,就是手指非 ...

  3. [转载]在Android C/C++层添加LOG调试

    原文地址:C/C++层添加LOG调试">在Android C/C++层添加LOG调试作者:谢轩昂 在Android C/C++层添加LOG调试,并且在Logcat中输出的方法 第一步: ...

  4. char类型与Unicode的编码

    Java的char型是非常独特的,占用两个字节,因为Java中char型采用了Unicode编码. 要理解这个问题,我们必须要理解什么是Unicode. 世界上存在着多种编码方式,同一个二进制数字可以 ...

  5. boot/setup.S

    !!    setup.S        Copyright (C) 1991, 1992 Linus Torvalds!! setup.s is responsible for getting th ...

  6. LeetCode() Minimun Size Subarray Sum

    别人的代码 class Solution { public: int minSubArrayLen(int s, vector<int>& nums) { int l, r, cu ...

  7. JAVA常用系统函数

    1.System.out.println("显示信息"); // 显示内容,并自动换行 2.Syetem.out.print("显示信息"); // 显示内容, ...

  8. FZU-2105 Digits Count (两种标记成段更新)

    题目大意:给n个0~15之间的数,有3种更新操作,1种询问操作.3种更新操作是:1.让某个闭区间的所有数字与一个0~15之间的数字进行逻辑与运算:2.让某个闭区间的所有数字与一个0~15之间的数字进行 ...

  9. hdu1827 强连通

    题意:一个人需要联系其他所有人,已知他自己联系每个人的花费,并且他可以联系某个人再让他联系他能联系到的人,给出一系列关系表示 A 能够联系 B.问他最少需要联系多少人,花费多少钱 首先,建成一个有向图 ...

  10. Linux驱动设计——字符杂项设备

    杂项设备 linux里面的misc杂项设备是主设备号为10的驱动设备,misc设备其实也就是特殊的字符设备,可自动生成设备节点. 定义头文件<linux/miscdevice.h>   杂 ...