参考的这里

压测工具

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. 第四部分:python性能技巧

    4.1 查询操作为主时,选择字典结构比list结构效率更高 4.2 取list的交集.并集.差集时,可借助set数据结构如listintersection = list(set(lista)& ...

  2. Sprint第二个冲刺(第四天)

    一.Sprint 计划会议: 第四次会议总结情况如下展示:昨天完成了美化按钮.增添图片的功能,今天在我们的努力下又完成了查看用户资料和底栏显示功能,由此可见我们团队的小伙伴都很厉害,也很勤奋.从燃尽图 ...

  3. 网络延迟查看器 Network latency view 1.4

    这是个用于查看网络延迟/ip/主机/地区的工具,内外网通吃,外网可通过这里下载csv以显示国家(地区) 可以自己决定winpcap或者原始套接字进行捕捉 如果只扫描内网推荐angryip 这是款发布在 ...

  4. TextView所有属性

    android:autoLink设置是否当文本为URL链接/email/电话号码/map时,文本显示为可点击的链接.可选值(none/web/email/phone/map/all) android: ...

  5. 应用上下文配置【AppConfig】

    从spring3.0开始,Spring将JavaConfig整合到核心模块,普通的POJO只需要标注@Configuration注解,就可以成为spring配置类,并通过在方法上标注@Bean注解的方 ...

  6. 虚拟化_KVM

    一.KVM介绍 1.KVM全称kernel vitual machine,是针对包含虚拟化扩展(InterVT或AMD-V)的x86硬件上的完全原生的虚拟化解决方案 2.KVM是以色列Qumranet ...

  7. Hive不支持非相等的join

    由于 hive 与传统关系型数据库面对的业务场景及底层技术架构都有着很大差异,因此,传统数据库领域的一些技能放到 Hive 中可能已不再适用.关于 hive 的优化与原理.应用的文章,前面也陆陆续续的 ...

  8. POJ 1195 Mobile phones(二维树状数组)

                                                                  Mobile phones Time Limit: 5000MS   Mem ...

  9. Mysql存储日期类型用int、timestamp还是datetime?

    通常存储时间用datetime类型,现在很多系统也用int存储时间,它们有什么区别?个人更喜欢使用int这样对于日期计算时比较好哦,下面我们一起来看到底那种会好些. int ().4个字节存储,INT ...

  10. [转] JAVA网站高并发解决方案

    http://blog.csdn.net/herrapfel/article/details/9630911