Add ability to override the service pool size [DPP-1306] (#15653)

* Add ability to override the service pool size

* don't set the value in the reference.conf
This commit is contained in:
mziolekda 2022-11-24 11:09:54 +01:00 committed by GitHub
parent 9cee266479
commit 9a12bb8b67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -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()
}

View File

@ -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
}
}

View File

@ -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(