简体   繁体   English

Apache Tomcat将使用非阻塞HTTP协议关闭文件下载的连接

[英]Apache Tomcat will close connection on file download with non blocking http protocol

Per default the protocol in server.xml is configured as protocol="HTTP/1.1" . 默认情况下,server.xml中的协议配置为protocol =“ HTTP / 1.1” with newer tomcat versions this will use a non blocking protocol if possible. 对于较新的tomcat版本,如果可能,它将使用非阻塞协议。

Problem: Setup Tomcat (8.0.28) with default settings. 问题:使用默认设置安装Tomcat(8.0.28)。 Copy a file in a webapp eg webapps/root and download the file with limited speed to simulate a slow modem download. 在webapp(例如webapps / root)中复制文件,并以有限的速度下载文件,以模拟缓慢的调制解调器下载。

wget http://xxx.xxx.xxx.xxx:8080/xxxxxxx/7.zip --limit-rate=1k

Connection will be closed always after 6minutes and 24seconds 连接将始终在6分钟和24秒后关闭

Saving to: ‘7.zip’
7.zip               0%[                      ] 767.99K  1.00KB/s   in 6m 24s
2015-10-28 17:27:39 (1024 B/s) - Connection closed at byte 786426. Retrying.

if i change the protocol to (blocking): 如果我将协议更改为(阻止):

  protocol="org.apache.coyote.http11.Http11Protocol"

everything is fine and the download will complete with slow speed. 一切都很好,下载将以缓慢的速度完成。

What could be the issue? 可能是什么问题?

It is a known limitiation with the new apache protocols. 这是新apache协议的已知局限性。

The only solution to have a stable connection below 64kb/sec is to change the settings: socket.txBufSize (smaller) and connection timeout (higher). 低于64kb / sec的稳定连接的唯一解决方案是更改设置:socket.txBufSize(较小)和连接超时(较高)。 for more details check: https://bz.apache.org/bugzilla/show_bug.cgi?id=58565 有关更多详细信息,请检查: https : //bz.apache.org/bugzilla/show_bug.cgi?id=58565

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

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