vertx-web: Http file upload became extremely slow

Version

4.0.3

Context

http file upload in 4.0.3 became extremely slow vs 3.9.5. for example, it takes 6 minutes(!) to upload a 130M file on v4 vs 5 seconds on v3 (same machine, same client)

another thing i paid attention to that might be related: with v3 the uploaded file size is growing during the upload. (tracking running ls -l on a linux box recurrently or applicatively using periodic task ). with v4 the a small chunk of the size of tens of bytes is written and the file size doesn’t change until it’s fully written

Do you have a reproducer?

https://gist.github.com/ashertarno/8a10272b9e02a224f52bdfd2954ec0f8

Steps to reproduce

  1. Run the gist above with vertx 4.0.3
  2. Upload a file, for example using curl: curl -X POST http://[::1]:8080/fileupload -H "Content-Type: multipart/form-data" -F "upload_file=@/home/atarno/file_for_upload.tgz"
  3. Server will print something like this in the console:

File size: 124 after 1.493 s File size: 124 after 2.647 s File size: 124 after 3.487 s File size: 124 after 4.527 s File size: 124 after 5.682 s File size: 124 after 6.369 s File uploaded. Size: 16721922 Upload time 6.415 s

  1. Run the same gist with vertx 3.9.5
  2. Upload the same file
  3. Server will print something like this in the console:

File size: 6579021 after 1.062 s File uploaded. Size: 16721922 Upload time 1.170 s

  1. The bigger the uploaded file, the larger the time gap between the versions will be. With a 135M file I reach 6 minutes vs 5 seconds

Extra

CentOS8.1 java11

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (13 by maintainers)

Most upvoted comments

latest Netty 4.1 branch makes the issue go away, so this shall be resolved with an upgrade to 4.1.64.Final

no, 3.9.8 will be released soon with Netty 4.1.65.Final that fixes the issue.

On Tue, Jun 8, 2021 at 9:37 PM bfreuden @.***> wrote:

@vietj https://github.com/vietj Vert.x 3.9.7 is also affected by this problem (uses Netty 4.1.60.Final), should I open a bug?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vert-x3/vertx-web/issues/1937#issuecomment-857053095, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCSPMWC2U6ZCIDQHQZTTRZWPHANCNFSM44C3HXPQ .

4.1.0.Beta1 (released) comes with a fork of the 4.1.64 HTTP post request decoder and fixes this issue until 4.1.64.Final is available.

On Sun, May 9, 2021 at 2:31 PM Asher Tarnopolski @.***> wrote:

@vietj https://github.com/vietj thanks, julien. so generally it is pending netty’s release of 4.1.64?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vert-x3/vertx-web/issues/1937#issuecomment-835798012, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCUWTLIWYMSJYV7PB5TTMZ6DNANCNFSM44C3HXPQ .

the test depends on the data.

e.g if you run the same test with a file that only contains 0, all will perform equally well.

On Wed, May 5, 2021 at 4:13 PM Francesco Nigro @.***> wrote:

@vietj https://github.com/vietj

with Netty 4.1.49.Final it takes 122ms to complete … with Netty 4.1.64.Final-SNAPSHOT it takes 117ms to complete

I was expecting a further improvement, looking at other users results, see netty/netty#11175 (comment) https://github.com/netty/netty/issues/11175#issuecomment-828000345

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vert-x3/vertx-web/issues/1937#issuecomment-832721981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCQL75CQ64C37HAFKSDTMFHBJANCNFSM44C3HXPQ .

it seems related to Netty HttpPostRequestDecoder implementation, still investigating.

I can indeed observe that, it seems an issue in vertx-core, I’m investigating