参考的这里

压测工具

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. 使用容器控制器控制另外两个控制器的view交换

    建三个UIViewController 的子控制器,其中一个为根控制器,另外两个控制器的视图作为切换对象 AppDelegate中代码 //AppDelegate.h中代码 #import <U ...

  2. 灰度图像的自动阈值分割(Otsu 法)(转载)

    灰度图像的自动阈值分割(Otsu 法) 机器视觉领域许多算法都要求先对图像进行二值化.这种二值化操作阈值的选取非常重要.阈值选取的不合适,可能得到的结果就毫无用处.今天就来讲讲一种自动计算阈值的方法. ...

  3. P168 实战练习(权限修饰符)

    创建Game类,运行代码如下: package org.hanqi.pn0120; public class Game { private String name; private String ca ...

  4. Linux系统编程@多线程编程(一)

    多线程编程 涉及操作系统原理概念 时间片 进程状态 上下文: 对进程来说,就是进程的执行环境,具体就是各个变量和数据,包括所有的寄存器变量.打开的文件.内存信息等. 进程的写时复制:由于一般 fork ...

  5. 代码备份:处理 SUN397 的代码,将其分为 80% 训练数据 以及 20% 的测试数据

    处理SUN397 的代码,将其分为80% 训练数据以及20% 的测试数据 2016-07-27 1 %% Code for Process SUN397 Scene Classification 2 ...

  6. Nginx安全配置研究

    x00 测试环境 ? 1 2 3 操作系统:CentOS6.5 Web服务器:Nginx1.4.6 Php版本:Php5.4.26 0x01 Nginx介绍 nginx本身不能处理PHP,它只是个we ...

  7. windows的页自映射机制

    windows下由于启用了页机制,所有软件层面的地址操作都是VA,通过descriptor(base address(32bit))+offset得到的线性地址并不直接对应物理地址,而是经过页转换机构 ...

  8. Python使用MySQL数据库的方法以及一个实例

    使用环境:Windows+python3.4+MySQL5.5+Navicat 一.创建连接 1.准备工作,想要使用Python操作MySQL,首先需要安装MySQL-Python的包,在Python ...

  9. SecureCRT注册机使用方法

    SecureCRT_7.3注册机激活步骤如下: 1)准备工作 安装好SecureCRT软件, 下载并得到该注册机. 2)保持SecureCRT软件关闭(运行的话会提示你正在运行的,关闭就好). 3)将 ...

  10. SQL存储过程相关信息查看转

    原文地址:http://www.cnblogs.com/minideas/archive/2009/10/29/1591891.html   --1.查看所有存储过程与函数      exec sp_ ...