Apache Tomcat-9.0.16 将属性“maxConcurrentStreamExecution”设置为“100”未找到匹配的属性

问题描述 投票:0回答:1

我有一个支持http2的tomcat配置,根据9.0.16文档,如果未指定,将使用默认值20。

所以,我只想将 maxConcurrentStreamExecution 和 maxConcurrentStream 增加到 100 或 200,所以我按照上面提到的文档进行配置

我的连接器配置如下,

<Connector port="9191" 
           URIEncoding="UTF-8"
           sslImplementationName="org.apache.tomcat.util.net.openssl.OpenSSLImplementation"
           protocol="org.apache.coyote.http11.Http11Nio2Protocol"
           maxThreads="50000"
           SSLEnabled="true"
           compressibleMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml" 
           compression="on"
           minSpareThreads="25" 
           noCompressionUserAgents="gozilla, traviata"
           scheme="https"
           secure="true"
           keystoreFile="conf/keystoreFile.keystore"
           keystorePass="password">
    <UpgradeProtocol compression="on"
                     maxConcurrentStreamExecution="100"
                     maxConcurrentStreams="100"
                     className="org.apache.coyote.http2.Http2Protocol">
    </UpgradeProtocol>
</Connector>

但是,在检查 tomcat 日志时,我可以看到一条警告

注意:选择了 JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi /sun.rmi.transport=全部未命名

2019 年 2 月 27 日 19:16:34.595 警告 [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} 将属性“maxConcurrentStreamExecution”设置为“100”未找到匹配属性。

2019 年 2 月 27 日 19:16:34.603 警告 [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} 将属性“maxConcurrentStreams”设置为“100”未找到匹配属性。

2019 年 2 月 27 日 19:16:34.679 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器版本名称:Apache Tomcat/9.0.16

2019 年 2 月 27 日 19:16:34.679 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器构建:2019 年 2 月 4 日 16:30:29 UTC

2019 年 2 月 27 日 19:16:34.680 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器版本号:9.0.16.0

2019 年 2 月 27 日 19:16:34.680 信息 [主要] org.apache.catalina.startup.VersionLoggerListener.log 操作系统名称:Linux

2019 年 2 月 27 日 19:16:34.680 信息 [主要] org.apache.catalina.startup.VersionLoggerListener.log 操作系统版本:4.4.0-141-generic

2019 年 2 月 27 日 19:16:34.681 信息 [主要] org.apache.catalina.startup.VersionLoggerListener.log 架构:amd64

正如你所看到的,tomcat 抛出了 not find amatching property 警告,

但是这个配置对于我提高服务器的吞吐量是必要的,因为我的服务器将处理大量的http2多路复用的post请求

雄猫:9.0.16, JDK:OpneJDK_10.0.1, 操作系统:Ubunut/Centos

请让我知道我错在哪里以及如何正确配置它以正确使用属性

蒂亚

java apache tomcat http2 tomcat9
1个回答
1
投票

使用新下载的 Apache Tomcat 9.0.16 和您提供的

Connector
元素对其进行测试,对我来说没有错误或警告。向
UpgradeProtocol
元素属性添加故意拼写错误(如
<UpgradeProtocol maxConcurrentStreamExecutionTest="100".../>
)会导致以下警告:

警告:匹配 [服务器/服务/连接器/UpgradeProtocol] 失败 将属性 [maxConcurrentStreamExecutionTest] 设置为 [100]

将此与您的警告日志消息进行比较:

2019 年 2 月 27 日 19:16:34.595 警告 [主要] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} 设置属性 'maxConcurrentStreamExecution' 为 '100' 未找到匹配 财产。

表示您错误地将这些属性添加到

<Connector/>
元素而不是
<UpgradeProtocol/>
元素。这也意味着您问题中提供的
Connector
元素不是为您的服务器配置的(唯一)元素。

© www.soinside.com 2019 - 2024. All rights reserved.