mirror of
https://github.com/corda/corda.git
synced 2025-03-19 18:45:28 +00:00
ENT-1953 enterprise tuning config (#1057)
* ENT-1953 enterprise tuning config * Keep flowThreadPoolSize at 1 for integration tests as some expect certain ordering it seems. * Log thread count for SMM
This commit is contained in:
parent
84cdf22e5f
commit
2fe5bae8a7
@ -173,6 +173,7 @@ D""".trimStart()
|
||||
}
|
||||
|
||||
private fun makeStateMachineExecutorService(): ExecutorService {
|
||||
log.info("Multi-threaded state machine manager with ${configuration.enterpriseConfiguration.tuning.flowThreadPoolSize} threads.")
|
||||
return Executors.newFixedThreadPool(
|
||||
configuration.enterpriseConfiguration.tuning.flowThreadPoolSize,
|
||||
ThreadFactoryBuilder().setNameFormat("flow-executor-%d").setThreadFactory(::FastThreadLocalThread).build()
|
||||
@ -193,6 +194,7 @@ D""".trimStart()
|
||||
cordappLoader.appClassLoader
|
||||
)
|
||||
} else {
|
||||
log.info("Single-threaded state machine manager with 1 thread.")
|
||||
return super.makeStateMachineManager(database)
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,11 @@ object ConfigHelper {
|
||||
val smartDevMode = CordaSystemUtils.isOsMac() || (CordaSystemUtils.isOsWindows() && !CordaSystemUtils.getOsName().toLowerCase().contains("server"))
|
||||
val devModeConfig = ConfigFactory.parseMap(mapOf("devMode" to smartDevMode))
|
||||
|
||||
// Detect the number of cores
|
||||
val coreCount = Runtime.getRuntime().availableProcessors()
|
||||
val multiThreadingConfig = configOf("enterpriseConfiguration.tuning.flowThreadPoolSize" to (coreCount * 4).toString(),
|
||||
"enterpriseConfiguration.tuning.rpcThreadPoolSize" to (coreCount).toString())
|
||||
|
||||
val systemOverrides = systemProperties().cordaEntriesOnly()
|
||||
val environmentOverrides = systemEnvironment().cordaEntriesOnly()
|
||||
val finalConfig = configOverrides
|
||||
@ -60,6 +65,7 @@ object ConfigHelper {
|
||||
.withFallback(databaseConfig) //for database integration tests
|
||||
.withFallback(appConfig)
|
||||
.withFallback(devModeConfig) // this needs to be after the appConfig, so it doesn't override the configured devMode
|
||||
.withFallback(multiThreadingConfig) // this needs to be after the appConfig, so it doesn't override the configured threading.
|
||||
.withFallback(defaultConfig)
|
||||
.resolve()
|
||||
|
||||
|
@ -238,7 +238,8 @@ class DriverDSLImpl(
|
||||
"rpcSettings.adminAddress" to rpcAdminAddress.toString(),
|
||||
"useTestClock" to useTestClock,
|
||||
"rpcUsers" to if (users.isEmpty()) defaultRpcUserList else users.map { it.toConfig().root().unwrapped() },
|
||||
"verifierType" to verifierType.name
|
||||
"verifierType" to verifierType.name,
|
||||
"enterpriseConfiguration.tuning.flowThreadPoolSize" to "1"
|
||||
) + czUrlConfig + customOverrides
|
||||
val config = NodeConfig(ConfigHelper.loadConfig(
|
||||
baseDirectory = baseDirectory(name),
|
||||
|
Loading…
x
Reference in New Issue
Block a user