开发者

How do I set Tomcat response buffer size through configuration?

I want to change through configuration (afaik server.xml) the default response buffer size. The documentation states that this is possible using the "bufferSize" attribute inside the "Connector" element but this is not working. I also tried to change "socket.appWriteBufSize" and "socket.appReadBufSize" but no luck:

<Connector port="8080" protocol="HTTP/1.1" 
            connectionTimeout="20000"
    bufferSize="64000" 
    maxHttpHeaderSize="64000"
    socket.appWriteBufSize="64000"
    socket.appReadBufSize="64000"
    redirectPort="8443" />

Note that if I change th开发者_StackOverflow社区e response size from my java code (httpResponse.setBufferSize(64000)) it will work, but for good reason I want to use the standard tomcat configuration mechanism.

All tests were done using a freshly downloaded Tomcat.


So no way to fix this apparently. Took a look at the code, but apparently the buffer is contructed with a default size carved into the code.

So, the only way to solve this, is to use Response::setBufferSize() from your code.


Try the following setting in connector: socketBuffer="64000"


To use "socket.appWriteBufSize" and "socket.appReadBufSize" attribute, your connector must be NIO connector. Change the value of "protocol" attribute from "HTTP/1.1" to "org.apache.coyote.http11.Http11NioProtocol".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜