From 686c8c67c3cfa21f66dea987e65611f9dc412a80 Mon Sep 17 00:00:00 2001 From: Stefano Baghino Date: Wed, 3 Jun 2020 16:29:24 +0200 Subject: [PATCH 1/2] Introduce CLI option for input buffer size Also improves CLI help text for other back-pressure related options. changelog_begin [Sandbox] Allow to configure --input-buffer-size, which allows to tune the number of commands waiting to be submitted before the Sandbox applies back-pressure, run daml sandbox --help for more info. changelog_end --- .../com/digitalasset/platform/sandbox/cli/Cli.scala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala b/ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala index 1d234cf3c796..48cd9c097e46 100644 --- a/ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala +++ b/ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala @@ -266,14 +266,19 @@ object Cli { .optional() .action((value, config) => config.copy(commandConfig = config.commandConfig.copy(maxCommandsInFlight = value))) - .text("The maximum number of unconfirmed commands in flight in CommandService.") + .text("Maximum number of submitted commands waiting for completion for each party (only applied when using the CommandService). Overflowing this threshold will cause back-pressure, signaled by a RESOURCE_EXHAUSTED error code. Default is 256.") opt[Int]("max-parallel-submissions") .optional() .action((value, config) => config.copy(commandConfig = config.commandConfig.copy(maxParallelSubmissions = value))) - .text( - "The maximum number of parallel command submissions. Only applicable to sandbox-classic.") + .text("Maximum number of successfully interpreted commands waiting to be sequenced (applied only when running sandbox-classic). The threshold is shared across all parties, overflowing it will cause back-pressure, signaled by a RESOURCE_EXHAUSTED error code. Default is 512.") + + opt[Int]("input-buffer-size") + .optional() + .action((value, config) => + config.copy(commandConfig = config.commandConfig.copy(inputBufferSize = value))) + .text("The maximum number of commands waiting to be submitted for each party. Overflowing this threshold will cause back-pressure, signaled by a RESOURCE_EXHAUSTED error code. Default is 512.") opt[Long]("max-lf-value-translation-cache-entries") .optional() From 2c7480b649780b117148cf521f58e135a4e1cd4a Mon Sep 17 00:00:00 2001 From: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com> Date: Wed, 3 Jun 2020 16:50:53 +0200 Subject: [PATCH 2/2] Update ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala Co-authored-by: Samir Talwar --- .../main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala b/ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala index 48cd9c097e46..5c3551552746 100644 --- a/ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala +++ b/ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala @@ -272,7 +272,7 @@ object Cli { .optional() .action((value, config) => config.copy(commandConfig = config.commandConfig.copy(maxParallelSubmissions = value))) - .text("Maximum number of successfully interpreted commands waiting to be sequenced (applied only when running sandbox-classic). The threshold is shared across all parties, overflowing it will cause back-pressure, signaled by a RESOURCE_EXHAUSTED error code. Default is 512.") + .text("Maximum number of successfully interpreted commands waiting to be sequenced (applied only when running sandbox-classic). The threshold is shared across all parties. Overflowing it will cause back-pressure, signaled by a RESOURCE_EXHAUSTED error code. Default is 512.") opt[Int]("input-buffer-size") .optional()