Skip to content

Commit

Permalink
[Previewnet] Configuration tuning to achieve high TPS (#6825)
Browse files Browse the repository at this point in the history
  • Loading branch information
sitalkedia authored and rustielin committed Mar 2, 2023
1 parent d883a7c commit 75ae87a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions config/src/config/consensus_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion config/src/config/execution_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion config/src/config/network_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 */;
Expand Down
6 changes: 3 additions & 3 deletions config/src/config/state_sync_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion config/src/config/storage_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 75ae87a

Please sign in to comment.