Skip to content

[feature](meta-service) Support querying and adjusting rpc qps limit on meta service - #42413

Merged
gavinchou merged 3 commits into
apache:masterfrom
Hastyshell:dynamic-ms-rate-limit
Nov 13, 2024
Merged

[feature](meta-service) Support querying and adjusting rpc qps limit on meta service#42413
gavinchou merged 3 commits into
apache:masterfrom
Hastyshell:dynamic-ms-rate-limit

Conversation

@Hastyshell

@HastyshellHastyshell commented Oct 24, 2024

Copy link
Copy Markdown
Collaborator

Proposed changes

Usage

  1. adjust limit
curl http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?${params}
EntryDescription
paramuint64 qps_limit
behaviorset qps_limit global default value
examplecurl http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000
EntryDescription
paramuint64 qps_limit, string rpc_name
behaviorset RPC specific qps_limit
examplecurl http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&rpc_name=get_cluster
EntryDescription
paramuint64 qps_limit, string rpc_name, string instance_id
behaviorset instance qps_limit for specific RPC
exampleccurl http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&rpc_name=get_cluster&instance_id="doris-0"
EntryDescription
paramuint64 qps_limit, string instance_id
behaviorset global qps_limit for specific instance
examplecurl http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&instance_id="doris-0"
  1. query limit
EntryDescription
paramnone
behaviorquery qps limit for all RPC interface
examplecurl http://ms_ip:ms_port/MetaService/http/v1/list_rate_limit

@doris-robot

Copy link
Copy Markdown

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -19,10 +19,13 @@

#include <brpc/server.h>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'brpc/server.h' file not found [clang-diagnostic-error]

#include<brpc/server.h>
^

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -17,8 +17,11 @@

#include "rate-limiter/rate_limiter.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'rate-limiter/rate_limiter.h' file not found [clang-diagnostic-error]

#include"rate-limiter/rate_limiter.h"
^

@Hastyshell
Hastyshellforce-pushed the dynamic-ms-rate-limit branch 2 times, most recently from cb4d256 to 063ca50CompareOctober 25, 2024 12:08
@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run buildall

@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run buildall

@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run buildall

@Hastyshell
Hastyshell marked this pull request as ready for review October 28, 2024 06:13
@Hastyshell
Hastyshell marked this pull request as draft October 29, 2024 12:13
@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run buildall

@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run buildall

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment threadcloud/src/meta-service/meta_service_http.cpp
Comment threadcloud/test/meta_service_http_test.cpp
@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run buildall

@Hastyshell
Hastyshell marked this pull request as ready for review November 1, 2024 01:53
@gavinchou

Copy link
Copy Markdown
Contributor

Add some usage examples in description.

@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run buildall

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment threadcloud/src/meta-service/meta_service_http.cpp
qps_limit_str, rpc_name, instance_id));
};

static auto parse_qps_limit =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems that abuse using lambdas

});
};

// for 8 element in true table of params, register processor cb

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part is confusing

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'll add some comments, just register different callback for different params pattern, and the "abuse" of lamda are just meant to adapt for this.

Comment threadcloud/src/rate-limiter/rate_limiter.cpp
Comment threadcloud/src/rate-limiter/rate_limiter.cpp
@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run buildall

@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run buildall

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Nov 13, 2024
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run compile

@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run cloud_p0

@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run p0

@Hastyshell

Copy link
Copy Markdown
CollaboratorAuthor

run external

@gavinchou
gavinchou merged commit 4783fc0 into apache:masterNov 13, 2024
github-actionsBot pushed a commit that referenced this pull request Nov 13, 2024
…on meta service (#42413)
## Proposed changes
Usage
1. adjust limit
```
curl http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?${params}
```
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit |
|behavior | set qps_limit global default value |
|example|```curl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000```|
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit, string rpc_name |
|behavior | set RPC specific qps_limit |
|example|curl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&rpc_name=get_cluster|
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit, string rpc_name, string instance_id |
|behavior | set instance qps_limit for specific RPC |
|example|```ccurl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&rpc_name=get_cluster&instance_id="doris-0"```|
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit, string instance_id |
|behavior | set global qps_limit for specific instance |
|example|```curl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&instance_id="doris-0"```|
2. query limit
| Entry | Description |
| ----------- | ----------- |
| param | none |
|behavior | query qps limit for all RPC interface |
|example|```curl
http://ms_ip:ms_port/MetaService/http/v1/list_rate_limit```|
dataroaring pushed a commit that referenced this pull request Nov 14, 2024
…on meta service (#42413)
## Proposed changes
Usage
1. adjust limit
```
curl http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?${params}
```
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit |
|behavior | set qps_limit global default value |
|example|```curl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000```|
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit, string rpc_name |
|behavior | set RPC specific qps_limit |
|example|curl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&rpc_name=get_cluster|
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit, string rpc_name, string instance_id |
|behavior | set instance qps_limit for specific RPC |
|example|```ccurl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&rpc_name=get_cluster&instance_id="doris-0"```|
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit, string instance_id |
|behavior | set global qps_limit for specific instance |
|example|```curl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&instance_id="doris-0"```|
2. query limit
| Entry | Description |
| ----------- | ----------- |
| param | none |
|behavior | query qps limit for all RPC interface |
|example|```curl
http://ms_ip:ms_port/MetaService/http/v1/list_rate_limit```|
gavinchou pushed a commit that referenced this pull request Nov 14, 2024
…c qps limit on meta service #42413 (#43884)
Cherry-picked from #42413
Co-authored-by: Siyang Tang <tangsiyang2001@foxmail.com>
dataroaring pushed a commit that referenced this pull request Nov 21, 2024
…ng (#44362)
UT failed with coredump in PR #42413 but was not detected by CI. Fix the
problem.
github-actionsBot pushed a commit that referenced this pull request Nov 21, 2024
…ng (#44362)
UT failed with coredump in PR #42413 but was not detected by CI. Fix the
problem.
@gavinchougavinchou mentioned this pull request Nov 26, 2024
HappenLee pushed a commit to HappenLee/incubator-doris that referenced this pull request Apr 24, 2026
…on meta service (apache#42413)
## Proposed changes
Usage
1. adjust limit
```
curl http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?${params}
```
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit |
|behavior | set qps_limit global default value |
|example|```curl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000```|
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit, string rpc_name |
|behavior | set RPC specific qps_limit |
|example|curl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&rpc_name=get_cluster|
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit, string rpc_name, string instance_id |
|behavior | set instance qps_limit for specific RPC |
|example|```ccurl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&rpc_name=get_cluster&instance_id="doris-0"```|
| Entry | Description |
| ----------- | ----------- |
| param | uint64 qps_limit, string instance_id |
|behavior | set global qps_limit for specific instance |
|example|```curl
http://ms_ip:ms_port/MetaService/http/v1/adjust_rate_limit?qps_limit=5000000&instance_id="doris-0"```|
2. query limit
| Entry | Description |
| ----------- | ----------- |
| param | none |
|behavior | query qps limit for all RPC interface |
|example|```curl
http://ms_ip:ms_port/MetaService/http/v1/list_rate_limit```|
HappenLee pushed a commit to HappenLee/incubator-doris that referenced this pull request Apr 24, 2026
…ng (apache#44362)
UT failed with coredump in PR apache#42413 but was not detected by CI. Fix the
problem.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.dev/3.0.3-mergedp0_creviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@Hastyshell@doris-robot@gavinchou@luwei16@dataroaring