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
- Run the gist above with vertx 4.0.3
- 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" - 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
- Run the same gist with vertx 3.9.5
- Upload the same file
- 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
- 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)
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:
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:
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:
it seems related to Netty
HttpPostRequestDecoderimplementation, still investigating.I can indeed observe that, it seems an issue in vertx-core, I’m investigating