Make more backtest parallele and run bundle health only on instance 1
This commit is contained in:
@@ -176,10 +176,7 @@ var host = hostBuilder
|
|||||||
var workerId = Environment.GetEnvironmentVariable("WORKER_ID") ??
|
var workerId = Environment.GetEnvironmentVariable("WORKER_ID") ??
|
||||||
configuration["BacktestComputeWorker:WorkerId"] ??
|
configuration["BacktestComputeWorker:WorkerId"] ??
|
||||||
$"{Environment.MachineName}-{taskSlot}";
|
$"{Environment.MachineName}-{taskSlot}";
|
||||||
services.Configure<BacktestComputeWorkerOptions>(options =>
|
services.Configure<BacktestComputeWorkerOptions>(options => { options.WorkerId = workerId; });
|
||||||
{
|
|
||||||
options.WorkerId = workerId;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Configure GeneticComputeWorker options
|
// Configure GeneticComputeWorker options
|
||||||
services.Configure<GeneticComputeWorkerOptions>(
|
services.Configure<GeneticComputeWorkerOptions>(
|
||||||
@@ -189,10 +186,7 @@ var host = hostBuilder
|
|||||||
var geneticWorkerId = Environment.GetEnvironmentVariable("GENETIC_WORKER_ID") ??
|
var geneticWorkerId = Environment.GetEnvironmentVariable("GENETIC_WORKER_ID") ??
|
||||||
configuration["GeneticComputeWorker:WorkerId"] ??
|
configuration["GeneticComputeWorker:WorkerId"] ??
|
||||||
$"{Environment.MachineName}-genetic-{taskSlot}";
|
$"{Environment.MachineName}-genetic-{taskSlot}";
|
||||||
services.Configure<GeneticComputeWorkerOptions>(options =>
|
services.Configure<GeneticComputeWorkerOptions>(options => { options.WorkerId = geneticWorkerId; });
|
||||||
{
|
|
||||||
options.WorkerId = geneticWorkerId;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Register the backtest compute worker if enabled
|
// Register the backtest compute worker if enabled
|
||||||
var isBacktestWorkerEnabled = configuration.GetValue<bool>("WorkerBacktestCompute", false);
|
var isBacktestWorkerEnabled = configuration.GetValue<bool>("WorkerBacktestCompute", false);
|
||||||
@@ -210,7 +204,7 @@ var host = hostBuilder
|
|||||||
|
|
||||||
// Register the bundle backtest health check worker if enabled
|
// Register the bundle backtest health check worker if enabled
|
||||||
var isBundleHealthCheckEnabled = configuration.GetValue<bool>("WorkerBundleBacktestHealthCheck", false);
|
var isBundleHealthCheckEnabled = configuration.GetValue<bool>("WorkerBundleBacktestHealthCheck", false);
|
||||||
if (isBundleHealthCheckEnabled)
|
if (isBundleHealthCheckEnabled && taskSlot == "1")
|
||||||
{
|
{
|
||||||
services.AddHostedService<BundleBacktestHealthCheckWorker>();
|
services.AddHostedService<BundleBacktestHealthCheckWorker>();
|
||||||
}
|
}
|
||||||
|
|||||||
26
src/Managing.Workers/appsettings.Production.json
Normal file
26
src/Managing.Workers/appsettings.Production.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"WorkerBacktestCompute": true,
|
||||||
|
"BacktestComputeWorker": {
|
||||||
|
"MaxConcurrentPerUser": 8,
|
||||||
|
"MaxConcurrentPerInstance": 30,
|
||||||
|
"JobPollIntervalSeconds": 5,
|
||||||
|
"HeartbeatIntervalSeconds": 30,
|
||||||
|
"StaleJobTimeoutMinutes": 10
|
||||||
|
},
|
||||||
|
"WorkerGeneticCompute": true,
|
||||||
|
"GeneticComputeWorker": {
|
||||||
|
"MaxConcurrentGenetics": 1,
|
||||||
|
"JobPollIntervalSeconds": 5,
|
||||||
|
"HeartbeatIntervalSeconds": 30,
|
||||||
|
"StaleJobTimeoutMinutes": 10
|
||||||
|
},
|
||||||
|
"PostgreSql": {
|
||||||
|
"ConnectionString": "Host=kaigen-db.kaigen.managing.live;Port=5432;Database=managing;Username=postgres;Password=2ab5423dcca4aa2d"
|
||||||
|
},
|
||||||
|
"InfluxDb": {
|
||||||
|
"Url": "https://influx-db.kaigen.managing.live",
|
||||||
|
"Organization": "managing-org",
|
||||||
|
"Token": "ROvQoZ1Dg5jiKDFxB0saEGqHC3rsLkUNlPL6_AFbOcpNjMieIv8v58yA4v5tFU9sX9LLvXEToPvUrxqQEMaWDw=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"WorkerBacktestCompute": true,
|
"WorkerBacktestCompute": true,
|
||||||
"BacktestComputeWorker": {
|
"BacktestComputeWorker": {
|
||||||
"MaxConcurrentPerUser": 8,
|
"MaxConcurrentPerUser": 15,
|
||||||
"MaxConcurrentPerInstance": 30,
|
"MaxConcurrentPerInstance": 60,
|
||||||
"JobPollIntervalSeconds": 5,
|
"JobPollIntervalSeconds": 5,
|
||||||
"HeartbeatIntervalSeconds": 30,
|
"HeartbeatIntervalSeconds": 30,
|
||||||
"StaleJobTimeoutMinutes": 10
|
"StaleJobTimeoutMinutes": 10
|
||||||
|
|||||||
Reference in New Issue
Block a user