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(query): add call stats functions #5646

Merged
merged 4 commits into from May 30, 2022

Conversation

everpcpc
Copy link
Member

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

Summary

Summary about this PR

Changelog

  • New Feature

Related Issues

Fixes #issue

@vercel
Copy link

vercel bot commented May 28, 2022

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

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) May 30, 2022 at 4:44AM (UTC)

@mergify
Copy link
Contributor

mergify bot commented May 28, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label May 28, 2022
@everpcpc everpcpc marked this pull request as ready for review May 28, 2022 11:27
@everpcpc everpcpc force-pushed the feat/call-stats branch 2 times, most recently from 48d2a80 to 9f495ba Compare May 29, 2022 01:53
@BohuTANG
Copy link
Member

Oops, .github/actions/check/action.yml Conflicting

@everpcpc
Copy link
Member Author

everpcpc commented May 30, 2022

ask @drmingdrmer for advice, are there any needs to limit request to meta?

@drmingdrmer
Copy link
Member

ask @drmingdrmer for advice, are there any needs to limit request to meta?

Yes, if it's possible. The estimated max throughput is about 30,000 writes per second for now.

@everpcpc
Copy link
Member Author

Yes, if it's possible. The estimated max throughput is about 30,000 writes per second for now.

The stats call is just read, no write at all. Would that make any difference?

@drmingdrmer
Copy link
Member

Yes, if it's possible. The estimated max throughput is about 30,000 writes per second for now.

The stats call is just read, no write at all. Would that make any difference?

A read does not need to replicate a raft-log or to persist anything on a disk. It would be cheaper.

If the total RPS is under 5,000 there should not be a concern.

@everpcpc
Copy link
Member Author

everpcpc commented May 30, 2022

Yes, if it's possible. The estimated max throughput is about 30,000 writes per second for now.

The stats call is just read, no write at all. Would that make any difference?

A read does not need to replicate a raft-log or to persist anything on a disk. It would be cheaper.

If the total RPS is under 5,000 there should not be a concern.

thx~
Currently the list_tables operation would result in a RPS of total table count. But we only need the table count. Would a list_id_value or list_keys call different from common read calls?
Moreover, would it be ok for meta to provide some api for stats grouped by prefix (such as tenant id) ?

@drmingdrmer
Copy link
Member

Would a list_id_value or list_keys call different from common read calls?

list_id_value can be implemented with a prefix-list RPC to metasrv.
list_keys can not be expressed with KVApi yet.

Moreover, would it be ok for meta to provide some api for stats grouped by prefix (such as tenant id) ?

metasrv does not know what the delimiter is for an application, although traditionally it is a slash /.
And maintaining the counts of every prefix will result in unnecessary write-amplification.

Thus IMHO, count by the prefix should be implemented on the application side:

When creating/dropping/undropping/renaming a table, also update a counter record.

@BohuTANG BohuTANG merged commit 59ab253 into datafuselabs:main May 30, 2022
@everpcpc everpcpc deleted the feat/call-stats branch May 30, 2022 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants