Skip to content

Commit

Permalink
Increased queue limits (Consensys#8144)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
rolfyone authored Apr 3, 2024
1 parent 51dd3bf commit 3d91f17
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ the [releases page](https://github.com/Consensys/teku/releases).
### Breaking Changes

### Additions and Improvements
- 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.

### Bug Fixes
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public class Eth2NetworkConfiguration {

public static final int DEFAULT_ASYNC_P2P_MAX_QUEUE = DEFAULT_MAX_QUEUE_SIZE;

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

public static final int DEFAULT_ASYNC_BEACON_CHAIN_MAX_THREADS =
Math.max(Runtime.getRuntime().availableProcessors(), DEFAULT_VALIDATOR_EXECUTOR_THREADS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public interface AsyncRunnerFactory {

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package tech.pegasys.teku.cli.subcommand;

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

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

final TekuConfiguration tekuConfig = getTekuConfigurationFromArguments(args);

assertThat(tekuConfig.validatorClient().getValidatorConfig().getexecutorThreads()).isEqualTo(5);
assertThat(tekuConfig.validatorClient().getValidatorConfig().getexecutorThreads())
.isEqualTo(DEFAULT_VALIDATOR_EXECUTOR_THREADS);
assertThat(DEFAULT_VALIDATOR_EXECUTOR_THREADS).isGreaterThanOrEqualTo(5);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class ValidatorConfig {
public static final boolean DEFAULT_SHUTDOWN_WHEN_VALIDATOR_SLASHED_ENABLED = false;
public static final boolean DEFAULT_VALIDATOR_IS_LOCAL_SLASHING_PROTECTION_SYNCHRONIZED_ENABLED =
true;
public static final int DEFAULT_EXECUTOR_MAX_QUEUE_SIZE = 20_000;
public static final int DEFAULT_EXECUTOR_MAX_QUEUE_SIZE = 40_000;
public static final Duration DEFAULT_VALIDATOR_EXTERNAL_SIGNER_TIMEOUT = Duration.ofSeconds(5);
public static final int DEFAULT_VALIDATOR_EXTERNAL_SIGNER_CONCURRENT_REQUEST_LIMIT = 32;
public static final boolean DEFAULT_VALIDATOR_KEYSTORE_LOCKING_ENABLED = true;
Expand Down

0 comments on commit 3d91f17

Please sign in to comment.