tornado和beego的helloworld性能对比
来源:互联网 发布:教育软件平台公司 编辑:程序博客网 时间:2024/06/08 11:19
测试环境:
windows10虚拟机vmware安装的ubuntu14.04
内存1g,处理器数量2个,每个处理器核心数量1个
测试工具apchebench(ab)
python版本:2.7
tornado版本4.3
go版本1.4
beego版本1.6
tornado helloworld:
import tornado.ioloopimport tornado.webclass MainHandler(tornado.web.RequestHandler): def get(self): self.write("hello,world")if __name__ == "__main__": app = tornado.web.Application(handlers=[(r"/",MainHandler)]) app.listen(8888) tornado.ioloop.IOLoop.current().start()
ab测试:ab -n 1000 -c 20 http://127.0.0.1:8888/
Benchmarking 127.0.0.1 (be patient)Completed 100 requestsCompleted 200 requestsCompleted 300 requestsCompleted 400 requestsCompleted 500 requestsCompleted 600 requestsCompleted 700 requestsCompleted 800 requestsCompleted 900 requestsCompleted 1000 requestsFinished 1000 requestsServer Software: TornadoServer/4.3Server Hostname: 127.0.0.1Server Port: 8888Document Path: /Document Length: 11 bytesConcurrency Level: 20Time taken for tests: 0.549 secondsComplete requests: 1000Failed requests: 0Total transferred: 204000 bytesHTML transferred: 11000 bytesRequests per second: 1821.49 [#/sec] (mean)Time per request: 10.980 [ms] (mean)Time per request: 0.549 [ms] (mean, across all concurrent requests)Transfer rate: 362.87 [Kbytes/sec] receivedConnection Times (ms) min mean[+/-sd] median maxConnect: 0 0 0.1 0 1Processing: 1 11 10.2 8 157Waiting: 1 11 10.2 8 157Total: 2 11 10.2 8 158Percentage of the requests served within a certain time (ms) 50% 8 66% 9 75% 10 80% 11 90% 21 95% 24 98% 29 99% 30 100% 158 (longest request)
package mainimport ( "github.com/astaxie/beego" )type MainController struct { beego.Controller}func (this *MainController) Get() { this.Ctx.WriteString("hello world")}func main() { beego.Router("/", &MainController{}) beego.Run()}
Benchmarking 127.0.0.1 (be patient)Completed 100 requestsCompleted 200 requestsCompleted 300 requestsCompleted 400 requestsCompleted 500 requestsCompleted 600 requestsCompleted 700 requestsCompleted 800 requestsCompleted 900 requestsCompleted 1000 requestsFinished 1000 requestsServer Software: beegoServer:1.6.1Server Hostname: 127.0.0.1Server Port: 8080Document Path: /Document Length: 11 bytesConcurrency Level: 20Time taken for tests: 0.099 secondsComplete requests: 1000Failed requests: 0Total transferred: 155000 bytesHTML transferred: 11000 bytesRequests per second: 10093.06 [#/sec] (mean)Time per request: 1.982 [ms] (mean)Time per request: 0.099 [ms] (mean, across all concurrent requests)Transfer rate: 1527.76 [Kbytes/sec] receivedConnection Times (ms) min mean[+/-sd] median maxConnect: 0 0 0.8 0 17Processing: 0 2 2.2 2 18Waiting: 0 1 0.7 2 18Total: 0 2 2.3 2 18WARNING: The median and mean for the waiting time are not within a normal deviation These results are probably not that reliable.Percentage of the requests served within a certain time (ms) 50% 2 66% 2 75% 2 80% 2 90% 2 95% 2 98% 17 99% 18 100% 18 (longest request)
可以看出,beego借着go语言的优势,性能比tornado高很多,而且代码看着也很简洁
0 0
- tornado和beego的helloworld性能对比
- 对比Tornado和Twisted
- 对比Tornado和Twisted
- 对比Tornado和Twisted
- 对比Tornado和Twisted
- tornado web异步框架 和 nodejs 的异步对比
- cherrypy和tornado性能分析
- ReentrantLock和内部锁的性能对比
- YII和qeephp 框架的性能对比
- Xen 和 KVM 的性能对比
- spymemcached和xmemcached的性能对比
- ReentrantLock和内部锁的性能对比
- SlimXml和TinyXml,RapidXml的性能对比
- jQuery和JavaScript 库的性能对比
- ORACLE:exits和in的性能对比
- ArrayList和LinkedList的操作性能对比
- SlimXml和TinyXml,RapidXml的性能对比
- 对比Swift和GlusterFS的读写性能
- PDO::ATTR_EMULATE_PREPARES
- android:设置密码隐藏与显示
- 多个Laravel项目的冲突问题
- 改变matlab2014a工程文件的位置
- RxSwift 入坑手册 Part0 - 基础概念
- tornado和beego的helloworld性能对比
- 拜占庭将军问题
- Openstack学习笔记(十五)-Horizon源代码学习笔记(五)
- Android打包APK的时候出现conversion to dalvik format failed with error 1错误!
- SparkTask未序列化(Tasknotserializable)问题分析
- Zookeeper分布式锁小示例
- C++作业 4
- Error:Cannot run program "svn" (in directory "E:\work\kuaisou_1.3.8\Hello"): CreateProcess error=2,
- Android坐标系分析