Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
af218f5b
Commit
af218f5b
authored
Aug 01, 2018
by
TousakaRin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add maximum and minimum limite for reserved_concurrency
parent
ea5151d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
auto_concurrency_limiter.cpp
src/brpc/policy/auto_concurrency_limiter.cpp
+16
-0
No files found.
src/brpc/policy/auto_concurrency_limiter.cpp
View file @
af218f5b
...
@@ -46,6 +46,14 @@ DEFINE_int32(auto_cl_reserved_concurrency, 0,
...
@@ -46,6 +46,14 @@ DEFINE_int32(auto_cl_reserved_concurrency, 0,
"faster the maximum concurrency grows until the server is fully loaded."
"faster the maximum concurrency grows until the server is fully loaded."
"When the value is less than or equal to 0, square root of current "
"When the value is less than or equal to 0, square root of current "
"concurrency is used."
);
"concurrency is used."
);
DEFINE_int32
(
auto_cl_min_reserved_concurrency
,
10
,
"Minimum value of reserved concurrency, When the value is less than "
"or equal to 0, the minimum value of the reserved concurrency is not "
"limited."
);
DEFINE_int32
(
auto_cl_max_reserved_concurrency
,
40
,
"Maximum value of reserved concurrency, When the value is less than "
"or equal to 0, the maximum value of the reserved concurrency is not "
"limited."
);
DEFINE_int32
(
auto_cl_reset_count
,
30
,
DEFINE_int32
(
auto_cl_reset_count
,
30
,
"The service's latency will be re-measured every `reset_count' windows."
);
"The service's latency will be re-measured every `reset_count' windows."
);
...
@@ -205,6 +213,14 @@ int32_t AutoConcurrencyLimiter::UpdateMaxConcurrency(int64_t sampling_time_us) {
...
@@ -205,6 +213,14 @@ int32_t AutoConcurrencyLimiter::UpdateMaxConcurrency(int64_t sampling_time_us) {
if
(
reserved_concurrency
<=
0
)
{
if
(
reserved_concurrency
<=
0
)
{
reserved_concurrency
=
std
::
ceil
(
std
::
sqrt
(
_max_concurrency
));
reserved_concurrency
=
std
::
ceil
(
std
::
sqrt
(
_max_concurrency
));
}
}
if
(
FLAGS_auto_cl_min_reserved_concurrency
>
0
)
{
reserved_concurrency
=
std
::
max
(
FLAGS_auto_cl_min_reserved_concurrency
,
reserved_concurrency
);
}
if
(
FLAGS_auto_cl_max_reserved_concurrency
>
0
)
{
reserved_concurrency
=
std
::
min
(
FLAGS_auto_cl_max_reserved_concurrency
,
reserved_concurrency
);
}
int32_t
next_max_concurrency
=
int32_t
next_max_concurrency
=
std
::
ceil
(
_ema_peak_qps
*
_min_latency_us
/
1000000.0
);
std
::
ceil
(
_ema_peak_qps
*
_min_latency_us
/
1000000.0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment