Skip to content

Commit a3c0d21

Browse files
authored
pkg/settings/cresettings: restore and reconfigure Workflow[ExecutionConcurrency]Limits (#1943)
1 parent 60199ef commit a3c0d21

4 files changed

Lines changed: 30 additions & 15 deletions

File tree

pkg/settings/cresettings/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ flowchart
4646
GatewayHTTPGlobalRate[\GatewayHTTPGlobalRate/]:::rate
4747
GatewayHTTPPerNodeRate[\GatewayHTTPPerNodeRate/]:::rate
4848
end
49-
%% WorkflowLimit - Deprecated
5049
%% TODO unused
5150
%% PerOrg.ZeroBalancePruningTimeout
5251
@@ -61,10 +60,11 @@ flowchart
6160
end
6261
6362
subgraph Engine.init
64-
WorkflowExecutionConcurrencyLimit([WorkflowExecutionConcurrencyLimit]):::resource
65-
PerOwner.WorkflowExecutionConcurrencyLimit([PerOwner.WorkflowExecutionConcurrencyLimit]):::resource
63+
%% TODO move and replace with WorkflowLimit
64+
WorkflowLimit([WorkflowLimit]):::resource
65+
PerOwner.WorkflowLimit([PerOwner.WorkflowLimit]):::resource
6666
67-
WorkflowExecutionConcurrencyLimit-->PerOwner.WorkflowExecutionConcurrencyLimit
67+
WorkflowLimit-->PerOwner.WorkflowLimit
6868
end
6969
7070
subgraph Engine.runTriggerSubscriptionPhase
@@ -103,9 +103,16 @@ flowchart
103103
subgraph Engine.handleAllTriggerEvents
104104
PerWorkflow.TriggerEventQueueLimit[[PerWorkflow.TriggerEventQueueLimit]]:::queue
105105
PerWorkflow.TriggerEventQueueTimeout>PerWorkflow.TriggerEventQueueTimeout]:::time
106-
PerWorkflow.ExecutionConcurrencyLimit([PerWorkflow.ExecutionConcurrencyLimit]):::resource
106+
107+
subgraph multiExecutionConcurrencyLimiter
108+
WorkflowExecutionConcurrencyLimit([WorkflowExecutionConcurrencyLimit]):::resource
109+
PerOrg.WorkflowExecutionConcurrencyLimit([PerOrg.WorkflowExecutionConcurrencyLimit]):::resource
110+
PerOwner.WorkflowExecutionConcurrencyLimit([PerOwner.WorkflowExecutionConcurrencyLimit]):::resource
111+
PerWorkflow.ExecutionConcurrencyLimit([PerWorkflow.ExecutionConcurrencyLimit]):::resource
112+
WorkflowExecutionConcurrencyLimit-->PerOrg.WorkflowExecutionConcurrencyLimit-->PerOwner.WorkflowExecutionConcurrencyLimit-->PerWorkflow.ExecutionConcurrencyLimit
113+
end
107114
108-
PerWorkflow.TriggerEventQueueLimit-->PerWorkflow.TriggerEventQueueTimeout-->PerWorkflow.ExecutionConcurrencyLimit
115+
PerWorkflow.TriggerEventQueueLimit-->PerWorkflow.TriggerEventQueueTimeout-->multiExecutionConcurrencyLimiter
109116
end
110117
111118
subgraph Engine.startExecution

pkg/settings/cresettings/defaults.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"WorkflowLimit": "200",
3-
"WorkflowExecutionConcurrencyLimit": "200",
2+
"WorkflowLimit": "1000",
3+
"WorkflowExecutionConcurrencyLimit": "1000",
44
"GatewayIncomingPayloadSizeLimit": "1mb",
55
"GatewayVaultManagementEnabled": "true",
66
"VaultJWTAuthEnabled": "false",
@@ -29,9 +29,11 @@
2929
"VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit": "31.45728mb",
3030
"VaultMaxPerOracleUnexpiredBlobCount": "1000",
3131
"PerOrg": {
32+
"WorkflowExecutionConcurrencyLimit": "100",
3233
"ZeroBalancePruningTimeout": "24h0m0s"
3334
},
3435
"PerOwner": {
36+
"WorkflowLimit": "1000",
3537
"WorkflowExecutionConcurrencyLimit": "5",
3638
"VaultSecretsLimit": "100"
3739
},

pkg/settings/cresettings/defaults.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
WorkflowLimit = '200'
2-
WorkflowExecutionConcurrencyLimit = '200'
1+
WorkflowLimit = '1000'
2+
WorkflowExecutionConcurrencyLimit = '1000'
33
GatewayIncomingPayloadSizeLimit = '1mb'
44
GatewayVaultManagementEnabled = 'true'
55
VaultJWTAuthEnabled = 'false'
@@ -29,9 +29,11 @@ VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit = '31.45728mb'
2929
VaultMaxPerOracleUnexpiredBlobCount = '1000'
3030

3131
[PerOrg]
32+
WorkflowExecutionConcurrencyLimit = '100'
3233
ZeroBalancePruningTimeout = '24h0m0s'
3334

3435
[PerOwner]
36+
WorkflowLimit = '1000'
3537
WorkflowExecutionConcurrencyLimit = '5'
3638
VaultSecretsLimit = '100'
3739

pkg/settings/cresettings/settings.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ var DefaultGetter Getter
5252
var Config Schema
5353

5454
var Default = Schema{
55-
WorkflowLimit: Int(200),
56-
WorkflowExecutionConcurrencyLimit: Int(200),
55+
WorkflowLimit: Int(1000),
56+
WorkflowExecutionConcurrencyLimit: Int(1000),
5757
GatewayIncomingPayloadSizeLimit: Size(1 * config.MByte),
5858
GatewayVaultManagementEnabled: Bool(true),
5959
VaultJWTAuthEnabled: Bool(false),
@@ -118,9 +118,11 @@ var Default = Schema{
118118
VaultMaxPerOracleUnexpiredBlobCount: Int(1000),
119119

120120
PerOrg: Orgs{
121-
ZeroBalancePruningTimeout: Duration(24 * time.Hour),
121+
WorkflowExecutionConcurrencyLimit: Int(100),
122+
ZeroBalancePruningTimeout: Duration(24 * time.Hour),
122123
},
123124
PerOwner: Owners{
125+
WorkflowLimit: Int(1000),
124126
WorkflowExecutionConcurrencyLimit: Int(5),
125127

126128
// DANGER(cedric): Be extremely careful changing this vault limit as it acts as a default value
@@ -227,7 +229,7 @@ var Default = Schema{
227229
}
228230

229231
type Schema struct {
230-
WorkflowLimit Setting[int] `unit:"{workflow}"` // Deprecated
232+
WorkflowLimit Setting[int] `unit:"{workflow}"`
231233
WorkflowExecutionConcurrencyLimit Setting[int] `unit:"{workflow}"`
232234
GatewayIncomingPayloadSizeLimit Setting[config.Size]
233235
GatewayVaultManagementEnabled Setting[bool]
@@ -265,10 +267,12 @@ type Schema struct {
265267
PerWorkflow Workflows `scope:"workflow"`
266268
}
267269
type Orgs struct {
268-
ZeroBalancePruningTimeout Setting[time.Duration]
270+
WorkflowExecutionConcurrencyLimit Setting[int] `unit:"{workflow}"`
271+
ZeroBalancePruningTimeout Setting[time.Duration]
269272
}
270273

271274
type Owners struct {
275+
WorkflowLimit Setting[int] `unit:"{workflow}"`
272276
WorkflowExecutionConcurrencyLimit Setting[int] `unit:"{workflow}"`
273277
VaultSecretsLimit Setting[int] `unit:"{secret}"`
274278
}

0 commit comments

Comments
 (0)