Skip to content
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

Avoid reconciling many objects on the same database at the same time #110

Open
chlunde opened this issue Oct 27, 2022 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@chlunde
Copy link
Contributor

chlunde commented Oct 27, 2022

What problem are you facing?

For smaller RDS instances, we see CPU spikes when many provider-sql objects are reconciled at the same time. This can affect applications using the same database

How could Crossplane help solve your problem?

Avoid reconciling all objects in a burst. For example:

  • Connection reuse/pooling
  • Max N objects per hostname reconciled at the same time
  • Add jitter to spread reconciles
  • Add poll interval flag

https://pkg.go.dev/database/sql#Open

The returned DB is safe for concurrent use by multiple goroutines and maintains its own pool of idle connections. Thus, the Open function should be called just once. It is rarely necessary to close a DB.

There's also:
https://pkg.go.dev/database/sql#DB.SetMaxOpenConns

@chlunde chlunde added the enhancement New feature or request label Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant