zoukankan      html  css  js  c++  java
  • 【Go】http server 性能测试

    node秒java几街!pathon秒node几街 !go秒pathon几街!

    ab测试性能极佳的

    package main
    import (
     "fmt"
     "html/template"
     "net/http"
    )
    
    var i int;
    func main() {
    
        http.HandleFunc("/",index);
        http.ListenAndServe("localhost:811",nil);
     
    }
    
    func index(rw http.ResponseWriter,req *http.Request){
        i =i+1;
        fmt.Println(i);
        t, _ := template.ParseFiles("index.html")
        t.Execute(rw,nil)
    }


    C:Users>D:Desktopab.exe -n10000 -c100 http://localhost:811/
    This is ApacheBench, Version 2.3 <$Revision: 655654 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/

    Benchmarking localhost (be patient)
    Completed 1000 requests
    Completed 2000 requests
    Completed 3000 requests
    Completed 4000 requests
    Completed 5000 requests
    Completed 6000 requests
    Completed 7000 requests
    Completed 8000 requests
    Completed 9000 requests
    Completed 10000 requests
    Finished 10000 requests


    Server Software:
    Server Hostname: localhost
    Server Port: 811

    Document Path: /
    Document Length: 1185 bytes

    Concurrency Level: 100
    Time taken for tests: 12.368 seconds
    Complete requests: 10000
    Failed requests: 0
    Write errors: 0
    Total transferred: 13030000 bytes
    HTML transferred: 11850000 bytes
    Requests per second: 808.56 [#/sec] (mean)
    Time per request: 123.677 [ms] (mean)
    Time per request: 1.237 [ms] (mean, across all concurrent requests)
    Transfer rate: 1028.86 [Kbytes/sec] received

    Connection Times (ms)
    min mean[+/-sd] median max
    Connect: 0 0 0.5 0 37
    Processing: 1 123 29.6 115 347
    Waiting: 1 123 29.6 115 347
    Total: 2 123 29.6 115 347

    Percentage of the requests served within a certain time (ms)
    50% 115
    66% 122
    75% 127
    80% 133
    90% 153
    95% 197
    98% 222
    99% 229
    100% 347 (longest request)

  • 相关阅读:
    php DOC类型注释的用法
    Mysql 数据库更新错误
    Smarty初体验二 获取配置信息
    Smarty 模板初体验
    去网络视频广告方法——虽过时,但效果依然很好(亲测)
    织梦模板修改方法大全
    dede织梦:文章内容页调用
    织梦系统学习:文章页当前位置的写法(自认对SEO有用)
    ZOJ 3229 Shoot the Bullet
    URAL 1277 Cops and Thieves
  • 原文地址:https://www.cnblogs.com/viewcozy/p/4622780.html
Copyright © 2011-2022 走看看