Skip to content

Commit 3d91f17

Browse files
authored
Increased queue limits (Consensys#8144)
* Increased queue limits Also increased executor threads based on CPU, but the minimum remains 5, and it may increase to 12 if there are enough cpus. - Executor queue increased to 40_000 - Default queue increased to 10_000 Signed-off-by: Paul Harris <[email protected]>
1 parent 51dd3bf commit 3d91f17

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ the [releases page](https://github.com/Consensys/teku/releases).
1212
### Breaking Changes
1313

1414
### Additions and Improvements
15+
- Increased the executor queue default maximum size to 40_000 (previously 20_000), and other queues to 10_000 (previously 5_000). If you have custom settings for these queues, check to ensure they're still required.
1516

1617
### Bug Fixes

Diff for: ethereum/networks/src/main/java/tech/pegasys/teku/networks/Eth2NetworkConfiguration.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ public class Eth2NetworkConfiguration {
6060

6161
public static final int DEFAULT_ASYNC_P2P_MAX_QUEUE = DEFAULT_MAX_QUEUE_SIZE;
6262

63-
public static final int DEFAULT_VALIDATOR_EXECUTOR_THREADS = 5;
63+
// at least 5, but happily up to 12
64+
public static final int DEFAULT_VALIDATOR_EXECUTOR_THREADS =
65+
Math.max(5, Math.min(Runtime.getRuntime().availableProcessors(), 12));
6466

6567
public static final int DEFAULT_ASYNC_BEACON_CHAIN_MAX_THREADS =
6668
Math.max(Runtime.getRuntime().availableProcessors(), DEFAULT_VALIDATOR_EXECUTOR_THREADS);

Diff for: infrastructure/async/src/main/java/tech/pegasys/teku/infrastructure/async/AsyncRunnerFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
public interface AsyncRunnerFactory {
1919

20-
public static final int DEFAULT_MAX_QUEUE_SIZE = 5000;
20+
int DEFAULT_MAX_QUEUE_SIZE = 10_000;
2121
int DEFAULT_THREAD_PRIORITY = Thread.NORM_PRIORITY;
2222
Pattern ASYNC_RUNNER_NAME_PATTERN = Pattern.compile("[a-zA-Z][a-zA-Z0-9_]*");
2323

Diff for: teku/src/test/java/tech/pegasys/teku/cli/subcommand/ValidatorClientCommandTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
package tech.pegasys.teku.cli.subcommand;
1515

1616
import static org.assertj.core.api.Assertions.assertThat;
17+
import static tech.pegasys.teku.networks.Eth2NetworkConfiguration.DEFAULT_VALIDATOR_EXECUTOR_THREADS;
1718

1819
import com.google.common.io.Resources;
1920
import java.net.URI;
@@ -180,7 +181,9 @@ public void clientExecutorThreadsShouldBeDefaultValue() {
180181

181182
final TekuConfiguration tekuConfig = getTekuConfigurationFromArguments(args);
182183

183-
assertThat(tekuConfig.validatorClient().getValidatorConfig().getexecutorThreads()).isEqualTo(5);
184+
assertThat(tekuConfig.validatorClient().getValidatorConfig().getexecutorThreads())
185+
.isEqualTo(DEFAULT_VALIDATOR_EXECUTOR_THREADS);
186+
assertThat(DEFAULT_VALIDATOR_EXECUTOR_THREADS).isGreaterThanOrEqualTo(5);
184187
}
185188

186189
@Test

Diff for: validator/api/src/main/java/tech/pegasys/teku/validator/api/ValidatorConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class ValidatorConfig {
5353
public static final boolean DEFAULT_SHUTDOWN_WHEN_VALIDATOR_SLASHED_ENABLED = false;
5454
public static final boolean DEFAULT_VALIDATOR_IS_LOCAL_SLASHING_PROTECTION_SYNCHRONIZED_ENABLED =
5555
true;
56-
public static final int DEFAULT_EXECUTOR_MAX_QUEUE_SIZE = 20_000;
56+
public static final int DEFAULT_EXECUTOR_MAX_QUEUE_SIZE = 40_000;
5757
public static final Duration DEFAULT_VALIDATOR_EXTERNAL_SIGNER_TIMEOUT = Duration.ofSeconds(5);
5858
public static final int DEFAULT_VALIDATOR_EXTERNAL_SIGNER_CONCURRENT_REQUEST_LIMIT = 32;
5959
public static final boolean DEFAULT_VALIDATOR_KEYSTORE_LOCKING_ENABLED = true;

0 commit comments

Comments
 (0)