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

feat: seperate running_queries_count and active_sessions_count in /v1/status #12384

Merged

Conversation

flaneur2020
Copy link
Member

@flaneur2020 flaneur2020 commented Aug 8, 2023

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

I'm using /v1/status in to detect inactive query instances. There're few cases about the running_queries_count > 0 but they are actually in "Idle" state. If a query instance is full of Idle sessions, it's actually safe to shutdown it to reduce cost.

This PR filtered out the Idle sessions in the running_queries_count field, and added another active_sessions_count field to represent the active connections count.


This change is Reviewable

@vercel
Copy link

vercel bot commented Aug 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
databend ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2023 6:48am

@flaneur2020 flaneur2020 marked this pull request as ready for review August 8, 2023 06:55
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Aug 8, 2023
@BohuTANG BohuTANG requested a review from zhang2014 August 8, 2023 08:37
@BohuTANG BohuTANG merged commit 7ed0933 into databendlabs:main Aug 9, 2023
andylokandy pushed a commit to andylokandy/databend that referenced this pull request Nov 27, 2023
…/status (databendlabs#12384)

* do not include idle session in runing_queries_count

* add ProcessInfoState

* tune comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants