-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Unbounded Memory Allocation in http::body
#155
Comments
http::body
http::body
Further investigation has made me realise that my use case is streaming through (PutObject request). I actually found that my memory bloat issue was caused by the signature check being forced to bring the body of the request into memory. Unless I am mistaken, for a Single Chunk upload, it is not possible to verify the signature without first reading the entire body, meaning reading it into memory or disk. This is quite sad if you want to keep a low footprint 😢 I did, however, find that s3s is unnecessarily bringing the entire body into memory when the request's |
I have been thinking about this for some time now. One possible solution could be to implement opportunistic checks, assuming that the signature is correct, and returning an error only when the last chunk is read. This approach would significantly reduce latency for PUT operations, especially in proxy mode. |
This solution is reasonable but I'm worried about the side effects. Attackers may be able to cost more resources than memory if they can execute PUT operations until the last chunk. We still need to limit this case. We can investigate how other storage servers solve this problem. |
I know you're aware that
http::body
, here, allows unbounded allocation.Has any effort been spent on attempting to remove this allocation and allow streaming through the s3s interface? I may be able to spend some effort to help resolve this issue, but I'm not quite sure where to start at the moment.
The text was updated successfully, but these errors were encountered: