简体   繁体   English

Tornado中的并发静态文件处理是否受阻?

[英]Concurrent static file handling in Tornado is blocking?

I have a webserver which among other things serves static files. 我有一个网络服务器,除其他功能外还提供静态文件。 From this http://tools.pingdom.com report, it seems something is blocking when serving several files at the same time to the same client? 从此http://tools.pingdom.com报告来看,似乎在同一时间向同一客户端同时提供多个文件时出现阻塞?

The wait-time increases for each image: 每个图像的等待时间增加:

在此处输入图片说明

Report: http://tools.pingdom.com/fpt/dgrKAX/http://arkgis.org/DIQAB7 报告: http//tools.pingdom.com/fpt/dgrKAX/http//arkgis.org/DIQAB7

Why is this? 为什么是这样? The files are served with the default tornado.web.StaticFileHandler class, but this is not the behaviour that I expected! 这些文件与默认的tornado.web.StaticFileHandler类一起提供,但这不是我所期望的行为! We have a need for speed! 我们需要速度!

What can I do to fix this? 我该怎么做才能解决此问题?

EDIT: 编辑:

I've now set up a nginx front-end — but I actually get the same increasing connect times in pingdom.com. 现在,我已经设置了一个nginx前端-但实际上,在pingdom.com中得到的连接时间却越来越长。 Am I reading the report wrong? 我看错报告了吗? Is this due to something client-side? 这是由于客户端引起的吗? Or is my nginx configured wrong? 还是我的Nginx配置错误?

Report with nginx front-end: 使用Nginx前端进行报告:

在此处输入图片说明

Use nginx. 使用nginx。

File access in Python is blocking, so the Tornado IOLoop is going to be blocked while reading from disk. Python中的文件访问受阻,因此从磁盘读取时,Tornado IOLoop将被阻止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM