-
Notifications
You must be signed in to change notification settings - Fork 63
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
Set /pdf requests per node 8 to 4, adds retry. #402
Conversation
Decreases the per node concurrent requests from 8 to 4. Increases the time to build from 3 to 6 min.
@@ -262,6 +278,31 @@ def path_to_bucket_key(pdf) -> str: | |||
raise ValueError(f"Cannot convert PDF path {pdf} to a GS key") | |||
|
|||
|
|||
@retry.Retry(predicate=retry.if_exception_type(PDF_RETRY_EXCEPTIONS)) | |||
def get_pdf(session, pdf_url) -> None: |
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.
Moves the GET /pdf out to use a retry on it.
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.
It'd be nice if the log messages could record the time it took to make each PDF, but we can add that tomorrow.
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.
These changes look good to me.
Keep in mind, when not in redirect mode, that other requests will also trigger compilations. This may result in some 503 errors.
The 503 handling currently does not appear to do anything to slow things down. Will not be an issue when requests and max processes are in sync. Other user requests may result in compilations and 503 errors.
The There is no mechanism in place in this code for slowing down beyond that. I think this should be fine since returning the 503 from /pdf is should be low cost and low load. |
This:
Both retry's use the default settings: initial delay of 1 sec, max delay of 60 sec, multiplier of 2 and a timeout of 120 sec.
The docs say timeout is "Timeout: the maximum duration of time after which a certain operation must terminate (successfully or with an error). The countdown begins right after an operation was started. For example, if an operation was started at 09:24:00 with timeout of 75 seconds, it must terminate no later than 09:25:15."