-
Notifications
You must be signed in to change notification settings - Fork 187
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
feat: limit concurrent processing of thumbnail requests #9199
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
a6e56c7
to
c30fae4
Compare
We need to add some text for the newly added thumbnail envvars in the thumbnails/readme.md, though I know you dont like writing stuff down 🤣 |
c30fae4
to
8c35a51
Compare
@mmattel done |
Changes in the readme look good, many thanks ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
To some extend this could/should be added to all services?
|
Not sure if we want to this. Some services might benefit from that. But do we need it for all services? Regardless, if we are aiming to use this is another service, it might make sense to call the envvar |
🤷 Maybe someone with ops experience can help to answer that ... @wkloucek |
We already agreed to use less envvars. The conclusion was: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add changelog. I'd also recommend to change the envvar name so we dont need to deprecate it later...
will do
OCIS_MAX_CONCURRENT_REQUESTS ? But this is currently wrong as it will not limit requests for all of OCIS - might be missleading? |
Yes thats true. So we have a tradeoff: Less Envvars <-> Better Envvar Naming. Really not sure whats better but I'd support team |
Since this PR is only for the thumbnails service we can start with the THUMBNAILS_MAX_CONCURRENT_REQUESTS. When we need throtlling for other services we can still introduce OCIS_MAX_CONCURRENT_REQUESTS. THUMBNAILS_MAX_CONCURRENT_REQUESTS will overrule it and still exist anyway. Stick to THUMBNAILS_MAX_CONCURRENT_REQUESTS |
8c35a51
to
e79d632
Compare
Quality Gate passedIssues Measures |
feat: limit concurrent processing of thumbnail requests
Str("response_status", dlRsp.Status). | ||
Msg("could not download thumbnail") | ||
renderError(w, r, errInternalError("could not download thumbnail")) | ||
renderError(w, r, newErrResponse(dlRsp.StatusCode, "could not download thumbnail")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sabredav does not have a dedicated TooManyRequests exception. So we don't need to try and invent something here or in the reva webdav error handling.
We could omit a body ... and we should send a retry after header ... in a different PR.
References: #9199 (feat: limit concurrent processing of thumbnail requests) Content fix: - If NO thumbnail is available, we return 404 (and not if it is avaialble) - Make the resolution list multi-lined again for improved readbility
Description
Creating thumbnails can be quite intensive with respect to memory and cpu consumption.
Limiting the number of concurrent requests can help to relax this situation.
In case a request is rejected
429/Too Many Requests
will be returned and clients can retry later.Motivation and Context
Make OCIS/ByCS robust ...
How Has This Been Tested?
THUMBNAILS_MAX_CONCURRENT_REQUESTS
to 1Screenshots (if appropriate):
Types of changes
Checklist: