Skip to content

Commit

Permalink
start server with more than one allowed RPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
jtattermusch committed May 9, 2016
1 parent 65ca9dc commit 26cc142
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/csharp/Grpc.Core/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -129,7 +130,13 @@ public void Start()
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();
}
}
}

Expand Down

0 comments on commit 26cc142

Please sign in to comment.