-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS putObject is very slow due to single byte reads in AwsChunkedDecodingInputStream #1115
Comments
@risdenk thanks for opening this issue. |
@afranken any luck w/ the releases? |
@risdenk finally got the release up and running again, just re-released the changes from January / February today. |
@risdenk just released 2.12.2 :) |
Thanks @afranken! |
Hi all, I'm still seeing slow uploads. This actually results in read timeout exception on upload of large files. We are using the latest (3.1.0) release. Are we sure this has been fixed @afranken ? As a workaround, you can set read timeout to infinite (not ideal). |
@JJRdec Could you please open a new ticket with a description on how to reproduce the issue? I just tested uploading a 1GB file:
The upload itself is really fast, at least locally when running S3Mock and copying a 1GB file to a bucket, it uploads with 250MB/s. Please keep in mind that S3Mock is meant to be used for local integration testing. |
AwsChunkedDecodingInputStream
only implements theread()
method which is one byte at a time.https://github.com/adobe/S3Mock/blame/main/server/src/main/java/com/adobe/testing/s3mock/util/AwsChunkedDecodingInputStream.java#L72
This results in slow uploads due to repeated one byte reads from the stream. A simple solution is to wrap the provided source InputStream with
BufferedInputStream
which avoids the repeated one byte reads.We have a test in Apache Solr that was taking 11s to due a 10mb file upload and after this simple change results in the test taking <1s. The simple change being replace
this.source = source
withthis.source = new BufferedInputStream(source);
inAwsChunkedDecodingInputStream
https://github.com/adobe/S3Mock/blame/main/server/src/main/java/com/adobe/testing/s3mock/util/AwsChunkedDecodingInputStream.java#L68
This shows a profiler running for the test and ~80% of the samples came from
![Screenshot 2023-04-05 at 13 20 20](https://user-images.githubusercontent.com/3384157/230157638-ac97544e-74b7-460e-9d7f-61f405f7e427.png)
AwsChunkedDecodingInputStream#read
The text was updated successfully, but these errors were encountered: