-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Question: moto_service s3 becoming slow and timing out as tests continue #2288
Comments
(cross-posting to SO here) |
For the most part, moto will store S3 files in memory. It looks like anything greater than 16MB, we will flush to disk. If you continue to write files under 16MB to moto s3, then the slowness would make sense. A couple options:
|
That did help with the speed issues! Thanks. I wonder if that 16mb number could be configurable, as well as the total memory used before flushing all files to disk? |
Yeah, we can make the individual file size to flush configurable, but we don't have an easy way to make this global. If anyone has time to make a PR to do that, I would be happy to accept, but otherwise am going to close this out for now. Let me know if there is anything else! |
I have a test suite of ~1000 tests. Previously we were using the mock_s3 decorator which only worked because our "integration tests" just imported modules from other services and mocked their functionality. This was always been undesirable but has not been a priority to fix until recently.
I'm attempting to use moto in standalone server mode, hackily starting the service in conftest.py using
As the tests progress, any calls to the s3 client become slower and slower, until finally I get
ReadTimeoutError: Read timeout on endpoint URL: "http://localbox:5000/my-bucket/my/key/file.tar"
Running those tests individually causes all of them to pass.
I don't really know where to begin debugging this or understanding the issue, or how to provide more information. Could someone please help identify the problem?
The text was updated successfully, but these errors were encountered: