Skip to content
Snippets Groups Projects
Commit 26cc1427 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

start server with more than one allowed RPCs

parent 65ca9dca
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,7 @@ namespace Grpc.Core
/// </summary>
public class Server
{
const int InitialAllowRpcTokenCount = 10;
static readonly ILogger Logger = GrpcEnvironment.Logger.ForType<Server>();
readonly AtomicCounter activeCallCounter = new AtomicCounter();
......@@ -129,7 +130,13 @@ namespace Grpc.Core
startRequested = true;
handle.Start();
AllowOneRpc();
// Starting with more than one AllowOneRpc tokens can significantly increase
// unary RPC throughput.
for (int i = 0; i < InitialAllowRpcTokenCount; i++)
{
AllowOneRpc();
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment