惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security Archives - TechRepublic
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
Cisco Talos Blog
Cisco Talos Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
S
Secure Thoughts
H
Hacker News: Front Page
I
Intezer
Cyberwarzone
Cyberwarzone
T
Tor Project blog
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
T
Threatpost
T
Tenable Blog
NISL@THU
NISL@THU
AWS News Blog
AWS News Blog
阮一峰的网络日志
阮一峰的网络日志
T
Troy Hunt's Blog
E
Exploit-DB.com RSS Feed
V
Visual Studio Blog
W
WeLiveSecurity
腾讯CDC
The GitHub Blog
The GitHub Blog
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
V2EX - 技术
A
Arctic Wolf
N
Netflix TechBlog - Medium
S
Securelist
WordPress大学
WordPress大学
Schneier on Security
Schneier on Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Vercel News
Vercel News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
AI
AI
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
Help Net Security
Help Net Security
Google Online Security Blog
Google Online Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
G
Google Developers Blog
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cloudbric
Cloudbric
P
Palo Alto Networks Blog

Tornado

docker 多进程部署 tornado - V2EX Tornado 如何拿到传输的文件流 - V2EX Tornado 的异步 怎么写的 - V2EX tornado 下 ckeditor 图片上传问题 - V2EX Tornado 异步怎么写的? - V2EX tornado 怎么能确保端口挂了 服务也不会停止? - V2EX Tornado 路由有什么好方法,一个一个写太麻烦了,有没有根据 url 和注解匹配的方法呢 - V2EX Tornado V4.5 release pypy 拿到赞助之后出了支持 Python3.5 的版本 - V2EX 请教 tornado 文件上传问题 tornado 做后台服务,如果前端没有用 cookie. - V2EX tornado 优秀项目推荐 问一个 tornado 解决阻塞的方案问题? - V2EX tornaqiniu(基于 tornado 的异步七牛 sdk) tornado 并行异步,如何保证在只有部分请求成功后,结果依旧可用。 - V2EX nginx 反向代理 tornado,如何 location 首页u rl? - V2EX 问一个关于 tornado 异常处理的新手问题 - V2EX tornado 的 coroutine 能和自定义的装饰器一起使用吗?? - V2EX 阅读 Tornado 源码过程中的一个疑惑,求解答 - V2EX gtornado - tornado 中 pymysql, pymemcache, storm orm 支持库 Tornado 如何组织中大型项目,你们都是怎么样做的? tornado 跑不通,小白求帮忙 Tornado 4.3 发布 Tornado 官方怎么不好好维护一个 sql 的异步数据库驱动? 关于 tornado 阻塞的问题 tornado 的 mysql 异步驱动性能测试 pypy 之 tornado tornado 多个 url RequestHandler 类的 get_current_user() 方法覆写无效 tornado 动态添加 url 的问题 tornado 怎么利用'next'参数进行页面跳转 finish() called twice 阿里云 ECS 1CPU 1G 1Mbs 跑 tornado 开多少进程合适? tornado.locale.format_date()的日期汉化问题 Tornado 分页问题求解! Tornado 开发中出错调试如何像 PHP 一样? 新手完全不懂 tornado.concurrent.Future 有多少人 有付费学习 Tornado 的意愿,这是一个学习网站。 请问下 tornado 在 ios app 后台方面有成熟的实现吗? 新手求教关于 Tornado + SQLite 的两个问题 Tornado 4.1 关于优雅地部署 Tornado 新代码的一种方式 Tornado Template 如何获得 JavaScript 中的 var 变量? 学习 "Introduction to tornado" 提问 用 Tornado + Mongodb 开发要注意什么? 用 Tornado 做的网站,大家在写测试的时候,一般都是怎么做的呢? 分享本人基于 tornado 开发的应用层框架 Nginx 多端口运行 Tornado 如何获取当前端口 Tornado 框架如何写 MVC 模式?
Tornado 并发数很低,正常么? - V2EX
bluesky139 · 2016-01-14 · via Tornado

这是一个创建于 3804 天前的主题,其中的信息可能已经有所发展或是发生改变。

在 localhost 下测试,像 demo 一样, get 或 post 里面没有任何多余的耗时代码,直接返回。
得到的结果是每秒 200 多的并发数,这正常么?

目前系统是 win7 , CPU 是 E3 1231 ,
从任务管理器来看,似乎是单线程跑满了(因为进程的 CPU 占用率为 13 )。
各位用 tornado 的朋友也是同样的结果么? 还是说哪里有坑?

scys

1

scys      2016 年 1 月 14 日

测试 tornado ,不要在 windows 下,完全没有优化,只是个模型

bobuick

2

bobuick      2016 年 1 月 14 日

什么压力工具, 什么参数,在本机么,要发全一点

aisk

3

aisk      2016 年 1 月 14 日

Windows 下好像只支持 select ,肯定不会快了。

phithon

4

phithon      2016 年 1 月 14 日

楼上说的对, windows 下只是 select ,最慢的异步模型。

bluesky139

5

bluesky139      2016 年 1 月 14 日

@scys
@aisk
@phithon
@bobuick
刚在 mac 下试了下,也一样。压力工具是 JMeter.

并发数是我自己统计的,代码如下:
access = 0
def PrintDown():
global access
print 'access', access
access = 0
Timer(1, PrintDown, ()).start()
Timer(1, PrintDown, ()).start()

class MainHandler(tornado.web.RequestHandler):
def post(self):
global access
access = access + 1
self.write('')

结果如下:
access 161
access 142
access 169
access 139
access 168
access 136

scys

6

scys      2016 年 1 月 14 日

为啥不跑在 linux/bsd 下?

lecher

7

lecher      2016 年 1 月 14 日 via Android

这份代码是阻塞的。请自行加上异步处理的装饰器。

phithon

8

phithon      2016 年 1 月 14 日

楼上正解。楼主你在异步框架里写阻塞的内容,当然慢了~

wy315700

9

wy315700      2016 年 1 月 14 日

并发和 QPS 不是一个概念

sujin190

10

sujin190      2016 年 1 月 14 日

cpu 跑满了么?这简单的,四核四进程的话 qps 可以到两万不成问题,单进程七八千 qps 也无压力

neoblackcap

11

neoblackcap      2016 年 1 月 15 日

@bluesky139 OS X 下的 IO 复用也是烂,OS X 下面的可不是 kqueue ,肯定也是不行的。像 Tornado 这样的异步框架,都是基于 epoll/kqueue 的,没有这些系统调用,快不起来。

还有就是不能用标准库里面的 time 这些库,这些库调用的时候都会堵塞 IOloop ,肯定快不了。

mengskysama

12

mengskysama      2016 年 1 月 15 日 via Android

yield gen.sleep(0.5)

dai269619118

13

dai269619118      2016 年 1 月 15 日

tornado 是单进程的
可以多开几个
用 nginx 做反向代理

bluesky139

15

bluesky139      2016 年 1 月 15 日

@scys
@neoblackcap
我现在移到了 linux 下( CPU i5-4278U ,这个尾巴带 U 的 CPU 会不会太垃圾了?),结果:
access 1278
access 1335
access 1229

@lecher
@phithon
这两位是指 Timer 里面会锁 access 么?
我现在改成了这样:
class MainHandler(tornado.web.RequestHandler):
executor = ThreadPoolExecutor(20000)
@tornado.web.asynchronous
@tornado.gen.coroutine
def get(self):
ret = yield self.get_async('')
self.write('end.' + str(ret))
self.finish()

@run_on_executor
def get_async(self, p):
global access
access = access + 1
return 5
结果:
access 339
access 263
access 310
话说这个怎么弄比较好?

@dai269619118
暂时先不考虑多实例的问题,先把单个提起来再说。

chuangbo

17

chuangbo      2016 年 1 月 15 日

异步框架是要 IO 压力高的时候优势才大。

neoblackcap

18

neoblackcap      2016 年 1 月 15 日

@sujin190 根据网上的反应来看, OS X 的 kqueue 应该是跟 FreeBSD 的不太一样,记得当初看到的说法是 OS X 网络性能烂,但到底是不是因为 IO 复用部分的系统调用烂呢,这个我就不清楚了。

不过根据大家针对高级 IO 接口的比较来看, OS X 就没被比较过,看过的评测都是 BSD/kqueue, Linux/epoll, Windows/IOCP 。因此根据我的推断,应该是 OS X 的 kqueue 实现是残废的或者是它其他网络部分实现是残废的。

此处引用自 Tornado 的官方文档 http://www.tornadoweb.org/en/stable/index.html

Platforms: Tornado should run on any Unix-like platform, although for the best performance and scalability only Linux (with epoll) and BSD (with kqueue) are recommended for production deployment (even though Mac OS X is derived from BSD and supports kqueue, its networking performance is generally poor so it is recommended only for development use). Tornado will also run on Windows, although this configuration is not officially supported and is recommended only for development use.

neoblackcap

19

neoblackcap      2016 年 1 月 15 日

@bluesky139 要测试的话,请去看官方的测试例子,记得 Tornado 就提供一个类似 Time 的非堵塞库。专门给大家测试用的。多读文档,你会发现很多问题文档里面就有写了