mirror of
https://github.com/corda/corda.git
synced 2025-06-01 23:20:54 +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 {
|
private fun makeStateMachineExecutorService(): ExecutorService {
|
||||||
|
log.info("Multi-threaded state machine manager with ${configuration.enterpriseConfiguration.tuning.flowThreadPoolSize} threads.")
|
||||||
return Executors.newFixedThreadPool(
|
return Executors.newFixedThreadPool(
|
||||||
configuration.enterpriseConfiguration.tuning.flowThreadPoolSize,
|
configuration.enterpriseConfiguration.tuning.flowThreadPoolSize,
|
||||||
ThreadFactoryBuilder().setNameFormat("flow-executor-%d").setThreadFactory(::FastThreadLocalThread).build()
|
ThreadFactoryBuilder().setNameFormat("flow-executor-%d").setThreadFactory(::FastThreadLocalThread).build()
|
||||||
@ -193,6 +194,7 @@ D""".trimStart()
|
|||||||
cordappLoader.appClassLoader
|
cordappLoader.appClassLoader
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
log.info("Single-threaded state machine manager with 1 thread.")
|
||||||
return super.makeStateMachineManager(database)
|
return super.makeStateMachineManager(database)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,11 @@ object ConfigHelper {
|
|||||||
val smartDevMode = CordaSystemUtils.isOsMac() || (CordaSystemUtils.isOsWindows() && !CordaSystemUtils.getOsName().toLowerCase().contains("server"))
|
val smartDevMode = CordaSystemUtils.isOsMac() || (CordaSystemUtils.isOsWindows() && !CordaSystemUtils.getOsName().toLowerCase().contains("server"))
|
||||||
val devModeConfig = ConfigFactory.parseMap(mapOf("devMode" to smartDevMode))
|
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 systemOverrides = systemProperties().cordaEntriesOnly()
|
||||||
val environmentOverrides = systemEnvironment().cordaEntriesOnly()
|
val environmentOverrides = systemEnvironment().cordaEntriesOnly()
|
||||||
val finalConfig = configOverrides
|
val finalConfig = configOverrides
|
||||||
@ -60,6 +65,7 @@ object ConfigHelper {
|
|||||||
.withFallback(databaseConfig) //for database integration tests
|
.withFallback(databaseConfig) //for database integration tests
|
||||||
.withFallback(appConfig)
|
.withFallback(appConfig)
|
||||||
.withFallback(devModeConfig) // this needs to be after the appConfig, so it doesn't override the configured devMode
|
.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)
|
.withFallback(defaultConfig)
|
||||||
.resolve()
|
.resolve()
|
||||||
|
|
||||||
|
@ -238,7 +238,8 @@ class DriverDSLImpl(
|
|||||||
"rpcSettings.adminAddress" to rpcAdminAddress.toString(),
|
"rpcSettings.adminAddress" to rpcAdminAddress.toString(),
|
||||||
"useTestClock" to useTestClock,
|
"useTestClock" to useTestClock,
|
||||||
"rpcUsers" to if (users.isEmpty()) defaultRpcUserList else users.map { it.toConfig().root().unwrapped() },
|
"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
|
) + czUrlConfig + customOverrides
|
||||||
val config = NodeConfig(ConfigHelper.loadConfig(
|
val config = NodeConfig(ConfigHelper.loadConfig(
|
||||||
baseDirectory = baseDirectory(name),
|
baseDirectory = baseDirectory(name),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user