Bug 56348 - ReadListener reading stream on different thread very slow
ReadListener reading stream on different thread very slow
Status: RESOLVED FIXED
Product: Tomcat 8
Classification: Unclassified
Component: Catalina
8.0.5
PC Linux
: P2 normal (vote)
: ----
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2014-04-04 14:10 UTC by Yann Simon
Modified: 2014-04-23 21:11 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yann Simon 2014-04-04 14:10:57 UTC
In a ReadListener, if the servlet input stream is read with another thread as the servlet thread, the upload is very slow.

The following sample application reproduces the problem:
https://github.com/yanns/servlet31_async/tree/async-perf

/upload2 reads the input stream in the servlet thread
/upload forks a new thread that reads the servlet input stream

My measurements:

With tomcat 8.0.5
/upload: 2 minutes
/upload2: 3,8 s

It is expected that /upload is more slow that /upload2, but not with that difference.

The same tests with jetty:
/upload: 9,5 s
/upload2: 3,7s
Comment 1 Mark Thomas 2014-04-23 21:11:38 UTC
Thanks for the report and the test case. This has been fixed in 8.0.x for 8.0.6 onwards.