首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OS对Ubuntu的Python异步性能

OS对Ubuntu的Python异步性能
EN

Stack Overflow用户
提问于 2016-08-09 18:39:49
回答 1查看 242关注 0票数 1

我在OS上的Python异步性能有一些问题。我有16 X.的Macbook pro 2015。但在OS (El Capitan)上无法获得与Ubuntu相同的性能。即使考虑到我正在使用OS主机运行VM (迷幻药,4gb RAM)中的Ubuntu。

OS基准测试与wrk:wrk -t8 -d 10s -c 300 http://127.0.0.1:9090 ⏎ Running 10s test @ http://127.0.0.1:9090 8 threads and 300 connections Thread Stats Avg Stdev Max +/- Stdev Latency 628.63us 1.45ms 16.32ms 89.46% Req/Sec 696.05 834.65 5.51k 88.89% 19498 requests in 10.08s, 361.78KB read Socket errors: connect 0, read 20482, write 0, timeout 0 Requests/sec: 1934.40 Transfer/sec: 35.89KB

Ubuntu:

wrk -t8 -d 10s -c 300 http://127.0.0.1:9090 Running 10s test @ http://127.0.0.1:9090 8 threads and 300 connections Thread Stats Avg Stdev Max +/- Stdev Latency 5.49ms 14.33ms 408.97ms 99.22% Req/Sec 3.58k 1.41k 8.42k 70.91% 204333 requests in 10.06s, 3.70MB read Socket errors: connect 0, read 3, write 977, timeout 0 Requests/sec: 20311.64 Transfer/sec: 376.88KB

服务器代码:https://gist.github.com/ssbb/5f6c2c043880e0e917c3254d06c52a7e

Ubuntu上的ulimit -ahttps://gist.github.com/ssbb/e468b3ede5470da25699e4da4506b77c

OS X上的ulimit -ahttps://gist.github.com/ssbb/f2a846975069a1d62a313790ad8d26ce

OS X上的sysctl -ahttps://gist.github.com/ssbb/c78d5da7ae9e3670175f643309cf9f6b

Ubuntu上的sysctl -ahttps://gist.github.com/ssbb/9a00cc3856135369b16ddc0083d2bc88

为什么我在Ubuntu/OS之间有如此大的差异?我还试图在Arch Linux (不是VM,只是第二个OS)上运行这个服务器,并获得与OS相同的结果。

Ubuntu有一些TCP堆栈的“黑客”吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-10 07:06:36

MacOSX的网络栈实现速度较慢,这是众所周知的事实。

我不知道为什么Arch Linux比您的机器上的Ubuntu慢。网络堆栈是由linux内核本身实现的,具有相同内核版本的linux发行版应该具有几乎相同的性能。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38858144

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档