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

rqlite /status can be slow to respond with rqlite is under load #1645

Open
otoolep opened this issue Jan 30, 2024 · 4 comments
Open

rqlite /status can be slow to respond with rqlite is under load #1645

otoolep opened this issue Jan 30, 2024 · 4 comments

Comments

@otoolep
Copy link
Member

otoolep commented Jan 30, 2024

Under load /status can be slow, sometimes too slow for monitoring purposes. I suspect it's the DB layer.

One option could be to wait only for n seconds from DB layer, or examine the queries in the DB layer to determine which might be particularly slow with rqlite is under load.

@mauri870
Copy link
Contributor

Is it strictly required that the stats are always up-to-date upon calling /status? If a small delay is acceptable we could cache this for a couple seconds.

@mauri870
Copy link
Contributor

For the slow queries part, we could instrument the sql.Driver with an interceptor that logs the executed queries with the time spent. That could aid in debugging.

@otoolep
Copy link
Member Author

otoolep commented Jan 31, 2024

Actually, I'm thinking about caching some of the stats.

As for your slow query log, yes, that is a feature I'm interested in. Do you have a good, clean, pattern to implement?

@mauri870
Copy link
Contributor

Actually, I'm thinking about caching some of the stats.

As for your slow query log, yes, that is a feature I'm interested in. Do you have a good, clean, pattern to implement?

Caching seems a simple and effective solution for this.

Tracing sql queries is a well requested feature for database/sql(golang/go#18080), but I believe no one is looking into this, there is not even an official proposal yet.

There are third-party libraries that implement this, such as:

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