diff --git a/ledger/participant-integration-api/src/main/scala/platform/config/ParticipantConfig.scala b/ledger/participant-integration-api/src/main/scala/platform/config/ParticipantConfig.scala index 525dc61c694..d86ec4238d6 100644 --- a/ledger/participant-integration-api/src/main/scala/platform/config/ParticipantConfig.scala +++ b/ledger/participant-integration-api/src/main/scala/platform/config/ParticipantConfig.scala @@ -25,10 +25,12 @@ final case class ParticipantConfig( indexService: IndexServiceConfig = IndexServiceConfig(), indexer: IndexerConfig = IndexerConfig(), participantIdOverride: Option[Ref.ParticipantId] = None, + servicesThreadPoolSize: Int = ParticipantConfig.DefaultServicesThreadPoolSize, ) object ParticipantConfig { def defaultIndexJdbcUrl(participantId: Ref.ParticipantId): String = s"jdbc:h2:mem:$participantId;db_close_delay=-1;db_close_on_exit=false" val DefaultParticipantId: Ref.ParticipantId = Ref.ParticipantId.assertFromString("default") + val DefaultServicesThreadPoolSize: Int = Runtime.getRuntime.availableProcessors() } diff --git a/ledger/sandbox-on-x/reference.conf b/ledger/sandbox-on-x/reference.conf index ba3d35ce694..37d53b46521 100644 --- a/ledger/sandbox-on-x/reference.conf +++ b/ledger/sandbox-on-x/reference.conf @@ -572,6 +572,9 @@ ledger { # The size of the submission batch within parallel ingestion pipeline. submission-batch-size = 50 } + # The size of the thread pool underpinning internal services. Used for both the ledger api as well as + # the read and write services. When not set, the number of processors is used instead + # services-thread-pool-size = 50 } } diff --git a/ledger/sandbox-on-x/src/main/scala/com/daml/ledger/sandbox/SandboxOnXRunner.scala b/ledger/sandbox-on-x/src/main/scala/com/daml/ledger/sandbox/SandboxOnXRunner.scala index d3d239e512b..45558f09e44 100644 --- a/ledger/sandbox-on-x/src/main/scala/com/daml/ledger/sandbox/SandboxOnXRunner.scala +++ b/ledger/sandbox-on-x/src/main/scala/com/daml/ledger/sandbox/SandboxOnXRunner.scala @@ -90,7 +90,7 @@ object SandboxOnXRunner { timeServiceBackendO = configAdaptor.timeServiceBackend(participantConfig.apiServer) (stateUpdatesFeedSink, stateUpdatesSource) <- AkkaSubmissionsBridge() - servicesThreadPoolSize = Runtime.getRuntime.availableProcessors() + servicesThreadPoolSize = participantConfig.servicesThreadPoolSize servicesExecutionContext <- buildServicesExecutionContext(metrics, servicesThreadPoolSize) buildWriteServiceLambda = buildWriteService(