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

limit number of concurrent connections #57

Closed
jvehent opened this issue Nov 24, 2015 · 2 comments
Closed

limit number of concurrent connections #57

jvehent opened this issue Nov 24, 2015 · 2 comments

Comments

@jvehent
Copy link
Contributor

jvehent commented Nov 24, 2015

AWS applies a limit to the number of concurrent connections a given RDS database can accept. On the t2.medium we use for testing, that appears to be set to 120. We should limit how many connections the api and scanner are allowed to open using SetMaxOpenConns(), maybe by reusing the already present concurrency limit.

@0xdiba
Copy link
Contributor

0xdiba commented Nov 24, 2015

I don't know if SetMaxOpenConns() can help us much , because the api and the scanner are two different binaries so the only thing you can do is just guess and probably set something like ~60% of the open conns to the scanner and ~40% to the api.

More importantly in the scanner, if we pass those limits we might get errors for acknowledged scans.
Maybe a solution that uses DBStats to get the number of open connections to the database and start/postpone the scan depending on whether we are approaching the limit or not.

@jvehent
Copy link
Contributor Author

jvehent commented Dec 6, 2015

Why do you think we would get errors for acknowledged scans? I think if we pass the limit, the scanner will fail to run SELECT FOR UPDATE and thus not acknowledge the scan, so another scanner will pick it up. No?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants