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

Add a slow flag to commands with heavy disk IO #2474

Closed
1 of 2 tasks
PragmaTwice opened this issue Aug 7, 2024 · 7 comments
Closed
1 of 2 tasks

Add a slow flag to commands with heavy disk IO #2474

PragmaTwice opened this issue Aug 7, 2024 · 7 comments
Assignees
Labels
enhancement type enhancement good first issue Good for newcomers help wanted Good for newcomers

Comments

@PragmaTwice
Copy link
Member

Search before asking

  • I had searched in the issues and found no similar issues.

Motivation

We can add a new command flag e.g. slow and apply it to all commands that can lead to heavy disk IO (rocksdb read/write).

Solution

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@PragmaTwice PragmaTwice added enhancement type enhancement help wanted Good for newcomers good first issue Good for newcomers labels Aug 7, 2024
@PokIsemaine
Copy link
Contributor

Is there any mechanism that will accompany this flag after it is added? And what is the metric for heavy disk IO?

@mapleFU
Copy link
Member

mapleFU commented Aug 14, 2024

Is there any mechanism that will accompany this flag after it is added?

Generally there're easier way and heavier way. Tagging can allow better techniques for scheduling, like independent io-task-pool or throttle for these tasks ( These techniques doesn't be implemented now, lol). Generally for user task "heavy request" might have a lower priority and avoid affect the light operations

And what is the metric for heavy disk IO?

No, lol, I guess this should be guessed by user and a bit hard to analysis, especially on zset or other heavy structure

@PragmaTwice
Copy link
Member Author

PragmaTwice commented Aug 14, 2024

And what is the metric for heavy disk IO?

A simple method is to check that if a command only involves a constant number of rocksdb read/writes, e.g. LPUSH, SET, HSET.

Otherwise it can be a time consuming operation, e.g. HGETALL, LINSERT... (the number of rocksdb read/writes is not constant, e.g. O(n), where n is a runtime variable like size of the data structure.)

@PragmaTwice
Copy link
Member Author

Is there any mechanism that will accompany this flag after it is added?

Like mentioned by @mapleFU , it has potential benefits for optimization and scheduling.

Also, we can generate some doc from it to let users know which commands are time-consuming.

@mapleFU
Copy link
Member

mapleFU commented Aug 14, 2024

Besides, the heavy disk "write" IO api might have higher risk on new Context api: #2332

@jonathanc-n
Copy link
Contributor

Can I be assigned this issue?

@git-hulk
Copy link
Member

@jonathanc-n Assigned, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement type enhancement good first issue Good for newcomers help wanted Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants