服务器:

阿里云ECS:1核1G内存,CentOS6.5 x64

返回内容:

{"ErrInfo":{"ErrCode":0,"ErrMsg":""},"Result":{"CurrentTime":"2015-10-06 09:46:26"}}

在直接用time.Now()返回时间,大约是4550qps,见:Web性能研究-ab压力测试

用从redis中请求返回结果:

[root@iZ23n2t9gynZ ~]# ab -n 200000 -c 200 http://127.0.0.1:9090/api/System.GetTime
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 127.0.0.1 (be patient)
Completed 20000 requests
Completed 40000 requests
Completed 60000 requests
Completed 80000 requests
Completed 100000 requests
Completed 120000 requests
Completed 140000 requests
Completed 160000 requests
Completed 180000 requests
Completed 200000 requests
Finished 200000 requests

Server Software:
Server Hostname: 127.0.0.1
Server Port: 9090

Document Path: /api/System.GetTime
Document Length: 84 bytes

Concurrency Level: 200
Time taken for tests: 55.742 seconds
Complete requests: 200000
Failed requests: 1816
(Connect: 0, Receive: 0, Length: 1816, Exceptions: 0)
Write errors: 0
Total transferred: 40176392 bytes
HTML transferred: 16776392 bytes
Requests per second: 3587.96 [#/sec] (mean)
Time per request: 55.742 [ms] (mean)
Time per request: 0.279 [ms] (mean, across all concurrent requests)
Transfer rate: 703.86 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 18 161.9 0 7000
Processing: 0 37 13.2 37 2114
Waiting: 0 37 13.2 37 2114
Total: 1 55 162.8 37 7041

Percentage of the requests served within a certain time (ms)
50% 37
66% 38
75% 39
80% 39
90% 41
95% 43
98% 55
99% 1038
100% 7041 (longest request)

golang 性能的更多相关文章

  1. 通过 profiling 定位 golang 性能问题 - 内存篇 原创 张威虎 滴滴技术 2019-08-02

    通过 profiling 定位 golang 性能问题 - 内存篇 原创 张威虎 滴滴技术 2019-08-02

  2. Golang 性能优化实战

    小结: 1. 性能查看工具 pprof,trace 及压测工具 wrk 或其他压测工具的使用要比较了解. 代码逻辑层面的走读非常重要,要尽量避免无效逻辑. 对于 golang 自身库存在缺陷的,可以寻 ...

  3. golang 性能调优分析工具 pprof (上)

    一.golang 程序性能调优 在 golang 程序中,有哪些内容需要调试优化? 一般常规内容: cpu:程序对cpu的使用情况 - 使用时长,占比等 内存:程序对cpu的使用情况 - 使用时长,占 ...

  4. golang 性能调优分析工具 pprof(下)

    golang 性能调优分析工具 pprof(上)篇, 这是下篇. 四.net/http/pprof 4.1 代码例子 1 go version go1.13.9 把上面的程序例子稍微改动下,命名为 d ...

  5. golang 性能优化分析:benchmark 结合 pprof

    前面 2 篇 golang 性能优化分析系列文章: golang 性能优化分析工具 pprof (上) golang 性能优化分析工具 pprof (下) 一.基准测试 benchmark 简介 在 ...

  6. Golang性能调优入门

    如何利用golang自带的profile工具进行应用程序的性能调优,前一段时间我做的日志分析系统在线上遇到了一个问题,就是分任务的系统down机了,日志处理延迟了10几个小时,这个时候任务分发系统重启 ...

  7. golang 性能剖析pprof

    作为一个golang coder,使用golang编写代码是基本的要求. 能够写出代码,并能够熟悉程序执行过程中各方面的性能指标,则是更上一层楼. 如果在程序出现性能问题的时候,可以快速定位和解决问题 ...

  8. Golang性能分析与优化

    在公司的分享,去除了相关的敏感信息.

  9. 2019年,Golang开始吊打Java性能了!!!

    最近要同事debug性能,不经意间发现现在Golang性能开始吊打Java了!!!感觉Go发展神速!! 之前Go和Java基本是平手,甚至还有较大差距,请见https://www.cnblogs.co ...

随机推荐

  1. c# 字符串转化成声音 分类: C# 2014-09-24 12:20 316人阅读 评论(0) 收藏

    说明: (1)支持Window 7系统,但是xp系统智能朗读英文和数字: (2)添加引用 Interop.SpeechLib.dll; (3)使用时调用StringToVoice(str)即可. us ...

  2. Windows Live Writer的Markdown插件MarkdownInLiveWriter支持语法高亮了

    我前几天开发的Windows Live Writer的Markdown的插件MarkdownInLiveWriter支持语法高亮了.参见下图: 基本上就是把我的另一个插件CodeInLiveWrite ...

  3. 用ChooseALicense帮自己选一个开源license,然后用AddALicense给自己的github自动加上license文件

    在我之前的一篇博客里面介绍过tl;drLegal ——开源软件license的搜索引擎,可以很方便的查询各种license,并且给出了很简洁的解释.今天又发现了另外一个帮助你选择你的开源软件licen ...

  4. Mybatis 打开连接池和关闭连接池性能对比

    1  创建数据库表 -- phpMyAdmin SQL Dump -- version 4.2.11 -- http://www.phpmyadmin.net -- -- Host: localhos ...

  5. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(2)-easyui构建前端页面框架[附源码]

    原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(2)-easyui构建前端页面框架[附源码] 开始,我们有了一系列的解决方案,我们将动手搭建新系统吧. 用 ...

  6. hadoop处理Excel通话记录

    前面我们所写mr程序的输入都是文本文件,但真正工作中我们难免会碰到需要处理其它格式的情况,下面以处理excel数据为例 1.项目需求 有刘超与家庭成员之间的通话记录一份,存储在Excel文件中,如下面 ...

  7. iOS-系统定位功能

    ios系统定位 前期准备 系统定位功能,需要用到框架:CoreLocation/CoreLocation.h, 然后导入文件#import <CoreLocation/CoreLocation. ...

  8. @PostConstruct与@PreDestroy

    从Java EE 5规范开始,Servlet中增加了两个影响Servlet生命周期的注解(Annotion):@PostConstruct和@PreDestroy.这两个注解被用来修饰一个非静态的vo ...

  9. OSI七层模型理解

    物理层功能1,为数据端设备提供传送数据的通路 功能2,传输数据 接口.传输介质.信号的传输.网络设备 有线介质:双绞线(普通的网线),光纤. 无线介质:无线电.微波.激光.红外线. 例如手机.电视接收 ...

  10. 关于XML(一)。

    关于XML 什么是XML? XML是可扩展标记语言.类似于HTML,XML的宗旨是旨在传输数据,而非显示数据.其标签没有预定义,您需要自行定义标签.XML具有自我描述性,是W3C的推荐标准. XML与 ...