On 09/03/2021 20:57, DevNull wrote:
Apache Tomcat Version 9.0.43


Hello

In an application showing hundreds of thumbnail images at the same time, about a hundred thumbnails are loaded but the rest are not. Some posts claim it may be due to the http2 connection closing due to too much overhead.

I've tried to set overheadDataThreshold="0"  in server.xml but I see no change in number of loaded images.

Is there any other configuration I should try?

Worth setting the other overhead* attributes listed at http://tomcat.apache.org/tomcat-9.0-doc/config/http2.html to zero as well.

Un-commenting the HTTP/2 debug logging in CATALINA_BASE/conf/logging.properties and re-testing might provide some additional information.

Mark



I've tried running the same code in Jetty 10.0.1 and got it working by increasing the http2 rate control limit.


Please see stacktrace and server.xml below.

Server side, I get exceptions for each thumbnail that is not loaded. From catalina.log:

09-Mar-2021 05:51:32.635 FINE [https-jsse-nio-443-exec-28] org.apache.coyote.AbstractProcessor.setErrorState Error state [CLOSE_NOW] reported while processing request         org.apache.coyote.CloseNowException: org.apache.coyote.http2.StreamException: Connection [{0}], Stream [{1}], This stream is not writable                 at org.apache.coyote.http2.Stream$StreamOutputBuffer.end(Stream.java:941)                 at org.apache.coyote.http2.Http2OutputBuffer.end(Http2OutputBuffer.java:71)                 at org.apache.coyote.http2.StreamProcessor.finishResponse(StreamProcessor.java:209)                 at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:389)                 at org.apache.coyote.http2.StreamProcessor.service(StreamProcessor.java:429)                 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)                 at org.apache.coyote.http2.StreamProcessor.process(StreamProcessor.java:74)                 at org.apache.coyote.http2.StreamRunnable.run(StreamRunnable.java:35)                 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)                 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)                 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                 at java.base/java.lang.Thread.run(Thread.java:835)
        Caused by: org.apache.coyote.http2.StreamException: Connection [{0}], Stream [{1}], This stream is not writable                 at org.apache.coyote.http2.Stream.doStreamCancel(Stream.java:247)                 at org.apache.coyote.http2.Http2UpgradeHandler.reserveWindowSize(Http2UpgradeHandler.java:856)                 at org.apache.coyote.http2.Stream$StreamOutputBuffer.flush(Stream.java:900)                 at org.apache.coyote.http2.Stream$StreamOutputBuffer.doWrite(Stream.java:819)                 at org.apache.coyote.http2.Http2OutputBuffer.doWrite(Http2OutputBuffer.java:59)
                 at org.apache.coyote.Response.doWrite(Response.java:601)
                at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:339)                 at org.apache.catalina.connector.OutputBuffer.appendByteArray(OutputBuffer.java:746)                 at org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:675)                 at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:386)                 at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:364)                 at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:96)                 at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:123)                 at skintaby.imgar.server.web.ImageArchiveServlet.getBinary(ImageArchiveServlet.java:460)                 at skintaby.imgar.server.web.ImageArchiveServlet.doGet(ImageArchiveServlet.java:127)                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)                 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)                 at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)                 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346)                 at org.apache.coyote.http2.StreamProcessor.service(StreamProcessor.java:404)
                 ... 7 more


server.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />   <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />   <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />   <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />   <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

   <Service name="Catalina">
     <Connector port="443"
protocol="org.apache.coyote.http11.Http11NioProtocol"
sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
                maxThreads="150"
                SSLEnabled="true" >
       <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol"
                        overheadDataThreshold="0" />
       <SSLHostConfig honorCipherOrder="false">
         <Certificate certificateKeystoreFile ="keystore"
                      certificateKeystorePassword ="qwerty"/>
       </SSLHostConfig>
     </Connector>

     <Engine name="Catalina" defaultHost="localhost">
       <Host name="localhost"  appBase="webapps"
             unpackWARs="true" autoDeploy="true">
         <Valve className="org.apache.catalina.valves.AccessLogValve"
                directory="log"
                prefix="localhost_access_log"
                suffix=".txt"
                pattern="%h %l %u %t &quot;%r&quot; %s %b" />
       </Host>
     </Engine>
   </Service>
</Server>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to