Apache Tomcat-9.0.16 将 属性 'maxConcurrentStreamExecution' 设置为 '100' 没有找到匹配的 属性

Apache Tomcat-9.0.16 Setting property 'maxConcurrentStreamExecution' to '100' did not find a matching property

我有一个支持 http2 的 tomcat 配置,并且根据 9.0.16 documentation,如果未指定,将使用默认值 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 日志时,我可以看到一条警告

NOTE: Picked up 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=ALL-UNNAMED

27-Feb-2019 19:16:34.595 WARNING [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxConcurrentStreamExecution' to '100' did not find a matching property.

27-Feb-2019 19:16:34.603 WARNING [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxConcurrentStreams' to '100' did not find a matching property.

27-Feb-2019 19:16:34.679 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/9.0.16

27-Feb-2019 19:16:34.679 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 4 2019 16:30:29 UTC

27-Feb-2019 19:16:34.680 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.16.0

27-Feb-2019 19:16:34.680 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux

27-Feb-2019 19:16:34.680 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.4.0-141-generic

27-Feb-2019 19:16:34.681 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64

如您所见,tomcat 抛出 找不到匹配的 属性 警告,

但是这个配置对于​​我增加我的服务器的吞吐量是必要的,它将处理大量的 http2 多路复用 post 请求

Tomcat : 9.0.16, JDK: OpneJDK_10.0.1, OS: Ubunut/Centos

请告诉我我错在哪里以及如何正确配置它以正确使用属性

TIA

使用新下载的 Apache Tomcat 9.0.16 和您提供的 Connector 元素对其进行测试,对我来说没有错误或警告。故意向 UpgradeProtocol 元素属性添加错字,如 <UpgradeProtocol maxConcurrentStreamExecutionTest="100".../> 会导致以下警告:

WARNING: Match [Server/Service/Connector/UpgradeProtocol] failed to set property [maxConcurrentStreamExecutionTest] to [100]

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

27-Feb-2019 19:16:34.595 WARNING [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxConcurrentStreamExecution' to '100' did not find a matching property.

表示您错误地将这些属性添加到 <Connector/> 元素而不是 <UpgradeProtocol/> 元素。这也意味着您问题中提供的 Connector 元素不是为您的服务器配置的(唯一)元素。