-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add max_parallel parameter to MySQL backend. #2760
Add max_parallel parameter to MySQL backend. #2760
Conversation
Is there a reason not to do this with the permit pool and |
This limits the number of concurrent connections, so that vault does not die suddenly from "Too many connections". This can happen when e.g. vault starts up, and tries to load all the existing leases in parallel. At the time of writing this, the value ExpirationRestoreWorkerCount in vault/helper/consts/const.go is set to 64, meaning that if there are enough leases in the vault's DB, it will generate AT LEAST 64 concurrent connections to MySQL when loading the data during start-up. On certain configurations, e.g. smaller AWS RDS/Aurora instances, this will cause Vault to fail startup.
d533acd
to
b5c2456
Compare
@jefferai sure, didn't know about its existence. Reimplemented now with PermitTool and rebased. Although it seems a little bit slower, probably the lock is coarser than internal db/mysql one. |
That CI error does not seem related, seems like smth else in master is broken
|
@@ -42,6 +42,9 @@ storage "mysql" { | |||
- `tls_ca_file` `(string: "")` – Specifies the path to the CA certificate to | |||
connect using TLS. | |||
|
|||
- `max_parallel` `(string: "128")` – Specifies The maximum number of concurrent |
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.
s/The/the
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.
Looks great!
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 as well.
This limits the number of concurrent connections, so that vault does not die suddenly from "Too many connections".
This can happen when e.g. vault starts up, and tries to load all the existing leases in parallel. At the time of writing this, the value ExpirationRestoreWorkerCount is set to 64, meaning that if there are enough leases in the vault's DB, it will generate AT LEAST 64 concurrent connections to MySQL when loading the data during start-up. On certain configurations, e.g. smaller AWS RDS/Aurora instances, this will cause Vault to fail startup.