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
638d4342
Commit
638d4342
authored
Aug 13, 2018
by
TousakaRin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix code style, add new gflags: server_max_concurrency
parent
1a4489f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
client.cpp
example/auto_concurrency_limiter/client.cpp
+1
-1
server.cpp
example/auto_concurrency_limiter/server.cpp
+8
-6
No files found.
example/auto_concurrency_limiter/client.cpp
View file @
638d4342
...
...
@@ -33,7 +33,7 @@ DEFINE_int32(timeout_ms, 3000, "RPC timeout in milliseconds");
DEFINE_int32
(
max_retry
,
0
,
"Max retries(not including the first RPC)"
);
DEFINE_int32
(
case_interval
,
20
,
"Intervals for different test cases"
);
DEFINE_int32
(
client_qps_change_interval_us
,
50000
,
"The interval for client changes the sending speed"
);
"The interval for client changes the sending speed"
);
DEFINE_string
(
case_file
,
""
,
"File path for test_cases"
);
void
DisplayStage
(
const
test
::
Stage
&
stage
)
{
...
...
example/auto_concurrency_limiter/server.cpp
View file @
638d4342
...
...
@@ -30,9 +30,11 @@
DEFINE_int32
(
logoff_ms
,
2000
,
"Maximum duration of server's LOGOFF state "
"(waiting for client to close connection before server stops)"
);
DEFINE_int32
(
server_bthread_concurrency
,
4
,
"For compute max qps"
);
DEFINE_int32
(
server_sync_sleep_us
,
2500
,
"For compute maximum qps"
);
// max qps = 1000 / 2.5 * 4 = 1600
DEFINE_int32
(
server_bthread_concurrency
,
4
,
"Configuring the value of bthread_concurrency, For compute max qps, "
);
DEFINE_int32
(
server_sync_sleep_us
,
2500
,
"Usleep time, each request will be executed once, For compute max qps"
);
// max qps = 1000 / 2.5 * 4
DEFINE_int32
(
control_server_port
,
9000
,
""
);
DEFINE_int32
(
echo_port
,
9001
,
"TCP Port of echo server"
);
...
...
@@ -41,8 +43,8 @@ DEFINE_string(case_file, "", "File path for test_cases");
DEFINE_int32
(
latency_change_interval_us
,
50000
,
"Intervalt for server side changes the latency"
);
DEFINE_int32
(
server_max_concurrency
,
0
,
"Echo Server's max_concurrency"
);
DEFINE_bool
(
use_usleep
,
false
,
"EchoServer uses ::usleep or bthread_usleep to simulate latency "
"when processing requests"
);
"EchoServer uses ::usleep or bthread_usleep to simulate latency "
"when processing requests"
);
bthread
::
TimerThread
g_timer_thread
;
...
...
@@ -221,7 +223,7 @@ public:
const
test
::
TestCase
&
test_case
=
_case_set
.
test_case
(
_case_index
++
);
_echo_service
->
SetTestCase
(
test_case
);
brpc
::
ServerOptions
options
;
// options.max_concurrency = 15
;
options
.
max_concurrency
=
FLAGS_server_max_concurrency
;
_server
.
MaxConcurrencyOf
(
"test.EchoService.Echo"
)
=
test_case
.
max_concurrency
();
_server
.
Start
(
FLAGS_echo_port
,
&
options
);
...
...
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