From 75ae87afdda25c808539fb45fbf18b483904ee65 Mon Sep 17 00:00:00 2001 From: Sital Kedia Date: Tue, 28 Feb 2023 17:53:18 -0800 Subject: [PATCH] [Previewnet] Configuration tuning to achieve high TPS (#6825) --- config/src/config/consensus_config.rs | 8 ++++---- config/src/config/execution_config.rs | 2 +- config/src/config/network_config.rs | 2 +- config/src/config/state_sync_config.rs | 6 +++--- config/src/config/storage_config.rs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/src/config/consensus_config.rs b/config/src/config/consensus_config.rs index d205d3d66b85c..996071cac3192 100644 --- a/config/src/config/consensus_config.rs +++ b/config/src/config/consensus_config.rs @@ -6,7 +6,7 @@ use crate::config::{QuorumStoreConfig, SafetyRulesConfig}; use serde::{Deserialize, Serialize}; use std::path::PathBuf; -pub(crate) const MAX_SENDING_BLOCK_TXNS_QUORUM_STORE_OVERRIDE: u64 = 4000; +pub(crate) const MAX_SENDING_BLOCK_TXNS_QUORUM_STORE_OVERRIDE: u64 = 10000; #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] #[serde(default, deny_unknown_fields)] @@ -62,12 +62,12 @@ impl Default for ConsensusConfig { // defaulting to under 0.5s to broadcast the proposal to 100 validators // over 1gbps link max_sending_block_bytes: 600 * 1024, // 600 KB - max_sending_block_bytes_quorum_store_override: 5 * 1024 * 1024, // 5MB - max_receiving_block_txns: 10000, + max_sending_block_bytes_quorum_store_override: 10 * 1024 * 1024, // 10MB + max_receiving_block_txns: 1.5 * MAX_SENDING_BLOCK_TXNS_QUORUM_STORE_OVERRIDE, max_receiving_block_txns_quorum_store_override: 2 * MAX_SENDING_BLOCK_TXNS_QUORUM_STORE_OVERRIDE, max_receiving_block_bytes: 3 * 1024 * 1024, // 3MB - max_receiving_block_bytes_quorum_store_override: 6 * 1024 * 1024, // 6MB + max_receiving_block_bytes_quorum_store_override: 15 * 1024 * 1024, // 15MB max_pruned_blocks_in_mem: 100, mempool_executed_txn_timeout_ms: 1000, mempool_txn_pull_timeout_ms: 1000, diff --git a/config/src/config/execution_config.rs b/config/src/config/execution_config.rs index 70129243d6f25..294f0164f6b73 100644 --- a/config/src/config/execution_config.rs +++ b/config/src/config/execution_config.rs @@ -48,7 +48,7 @@ impl Default for ExecutionConfig { genesis: None, genesis_file_location: PathBuf::new(), // Parallel execution by default. - concurrency_level: 8, + concurrency_level: 24, num_proof_reading_threads: 32, paranoid_type_verification: true, paranoid_hot_potato_verification: true, diff --git a/config/src/config/network_config.rs b/config/src/config/network_config.rs index 0b1ccd9ca6262..f2386b54fa20f 100644 --- a/config/src/config/network_config.rs +++ b/config/src/config/network_config.rs @@ -46,7 +46,7 @@ pub const MAX_MESSAGE_METADATA_SIZE: usize = 128 * 1024; /* 128 KiB: a buffer fo pub const MESSAGE_PADDING_SIZE: usize = 2 * 1024 * 1024; /* 2 MiB: a safety buffer to allow messages to get larger during serialization */ pub const MAX_APPLICATION_MESSAGE_SIZE: usize = (MAX_MESSAGE_SIZE - MAX_MESSAGE_METADATA_SIZE) - MESSAGE_PADDING_SIZE; /* The message size that applications should check against */ -pub const MAX_FRAME_SIZE: usize = 4 * 1024 * 1024; /* 4 MiB large messages will be chunked into multiple frames and streamed */ +pub const MAX_FRAME_SIZE: usize = 20 * 1024 * 1024; /* 20 MiB large messages will be chunked into multiple frames and streamed */ pub const MAX_MESSAGE_SIZE: usize = 64 * 1024 * 1024; /* 64 MiB */ pub const CONNECTION_BACKOFF_BASE: u64 = 2; pub const IP_BYTE_BUCKET_RATE: usize = 102400 /* 100 KiB */; diff --git a/config/src/config/state_sync_config.rs b/config/src/config/state_sync_config.rs index 71660a646aa92..44b8dd4160df4 100644 --- a/config/src/config/state_sync_config.rs +++ b/config/src/config/state_sync_config.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; // The maximum message size per state sync message -pub const MAX_MESSAGE_SIZE: usize = 4 * 1024 * 1024; /* 4 MiB */ +pub const MAX_MESSAGE_SIZE: usize = 20 * 1024 * 1024; /* 4 MiB */ #[derive(Clone, Debug, Default, Deserialize, PartialEq, Eq, Serialize)] #[serde(default, deny_unknown_fields)] @@ -126,7 +126,7 @@ impl Default for StorageServiceConfig { max_network_chunk_bytes: MAX_MESSAGE_SIZE as u64, max_state_chunk_size: 4000, max_subscription_period_ms: 5000, - max_transaction_chunk_size: 2000, + max_transaction_chunk_size: 5000, max_transaction_output_chunk_size: 1000, storage_summary_refresh_interval_ms: 50, } @@ -166,7 +166,7 @@ impl Default for DataStreamingServiceConfig { fn default() -> Self { Self { global_summary_refresh_interval_ms: 50, - max_concurrent_requests: 3, + max_concurrent_requests: 20, max_concurrent_state_requests: 6, max_data_stream_channel_sizes: 300, max_request_retry: 5, diff --git a/config/src/config/storage_config.rs b/config/src/config/storage_config.rs index 833afff167f8c..7b8af9a538a36 100644 --- a/config/src/config/storage_config.rs +++ b/config/src/config/storage_config.rs @@ -65,7 +65,7 @@ impl Default for RocksdbConfigs { Self { ledger_db_config: RocksdbConfig::default(), state_merkle_db_config: RocksdbConfig::default(), - use_state_kv_db: false, + use_state_kv_db: true, state_kv_db_config: RocksdbConfig::default(), index_db_config: RocksdbConfig { max_open_files: 1000,