-
Notifications
You must be signed in to change notification settings - Fork 20
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
[MISC] Add experimental max_connections config #472
Conversation
df9ce4c
to
b48fb11
Compare
b48fb11
to
ff5fa50
Compare
@@ -1468,7 +1468,7 @@ def _restart(self, event: RunWithLock) -> None: | |||
return | |||
|
|||
try: | |||
for attempt in Retrying(wait=wait_fixed(3), stop_after_delay=stop_after_delay(300)): | |||
for attempt in Retrying(wait=wait_fixed(3), stop=stop_after_delay(300)): |
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.
Typo™
# Use config value if set, calculate otherwise | ||
if self.config.experimental_max_connections: | ||
max_connections = self.config.experimental_max_connections | ||
else: | ||
max_connections = max(4 * os.cpu_count(), 100) | ||
|
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.
Doing this only here would trigger a restart on deploy with experimental_max_connections
. I can also inject it in the config file, by changing the internal library, but I would rather keep it KISS.
experimental_max_connections: | ||
type: int | ||
description: | | ||
[EXPERIMENTAL] Force set max_connections. |
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.
Should we add some kind of validation here?
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.
should we maybe enforce an upper limit?
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's a footgun config.
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!
Adds experimental support for force setting max_connections.