Skip to content
Snippets Groups Projects
Commit 419934af authored by Alex Polcyn's avatar Alex Polcyn
Browse files

increase max thread pool size in benchmarks and fix shutdown ordering

parent c5d447eb
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,7 @@ module GRPC ...@@ -54,6 +54,7 @@ module GRPC
DEFAULT_MAX_WAITING_REQUESTS = 60 DEFAULT_MAX_WAITING_REQUESTS = 60
# Default poll period is 1s # Default poll period is 1s
# Used for grpc server shutdown and thread pool shutdown timeouts
DEFAULT_POLL_PERIOD = 1 DEFAULT_POLL_PERIOD = 1
# Signal check period is 0.25s # Signal check period is 0.25s
...@@ -124,10 +125,10 @@ module GRPC ...@@ -124,10 +125,10 @@ module GRPC
return if @running_state != :running return if @running_state != :running
transition_running_state(:stopping) transition_running_state(:stopping)
end end
@pool.shutdown
@pool.wait_for_termination(@poll_period)
deadline = from_relative_time(@poll_period) deadline = from_relative_time(@poll_period)
@server.close(deadline) @server.close(deadline)
@pool.shutdown
@pool.wait_for_termination
end end
def running_state def running_state
......
...@@ -63,7 +63,9 @@ class BenchmarkServer ...@@ -63,7 +63,9 @@ class BenchmarkServer
cred = :this_port_is_insecure cred = :this_port_is_insecure
end end
# Make sure server can handle the large number of calls in benchmarks # Make sure server can handle the large number of calls in benchmarks
@server = GRPC::RpcServer.new(pool_size: 100, max_waiting_requests: 100) # TODO: @apolcyn, if scenario config increases total outstanding
# calls then will need to increase the pool size too
@server = GRPC::RpcServer.new(pool_size: 1024, max_waiting_requests: 1024)
@port = @server.add_http2_port("0.0.0.0:" + port.to_s, cred) @port = @server.add_http2_port("0.0.0.0:" + port.to_s, cred)
@server.handle(BenchmarkServiceImpl.new) @server.handle(BenchmarkServiceImpl.new)
@start_time = Time.now @start_time = Time.now
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment