apache / apache/incubator-pegasus

Feature enhancement: throttling by the count of kvs

Open
#797 3 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
C++
Stars
2.1k
Forks
328
PR merge metrics
No merged PRs in 30d

Description

Now, write request can be throttled by qps or size, read request can be throttled by qps.
But there are some weaknesses of qps or size:

- If throttling by qps,one request may contain different size of data, it's hard to control the pressure.
- If throttling by size, it's difficult for users to calculate the required quota, and it can't be used for read request.

Therefore,we added a new throttling based on the count of kvs.In some scenarios, it may be better than the current way.
Advantage as below:

- More accurate control
- More intuitive to users
- Both read and write requests can be used

**Implementation principle:**
In message_ header#msg_context, add a new variable kv_count, which is used to record how many kvs are included in the request.The server will perform throttling according to the value of kv_count.

But for some requests, such as multiget by range, scan, etc, may not be supported very good.Because it is difficult to calculate the real count of kvs on the client side.In this case, I think we can perform throttling in pegasus instead of rdsn.
For scan, maybe we can set kv_count by batch_size of scan.(not implemented yet)

Contributor guide

Open the contributing guide

Research direction

Start by tracing message_header#msg_context and the existing qps or size throttling paths in rdsn and Pegasus. Review how multiget by range and scan requests determine their kv counts, including the proposed scan batch_size approach. Done means the supported read and write requests can be throttled by kv_count and the behavior of unsupported request types is defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.