From d7a5cd09e1465239bd615197abf2304c22f610bd Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe Date: Fri, 10 Jan 2025 17:45:35 +0200 Subject: [PATCH 1/5] Increase the number of pvf execute workers Signed-off-by: Alexandru Gheorghe --- polkadot/node/service/src/lib.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs index 227bc52539946..820cce8d083a6 100644 --- a/polkadot/node/service/src/lib.rs +++ b/polkadot/node/service/src/lib.rs @@ -944,14 +944,9 @@ pub fn new_full< secure_validator_mode, prep_worker_path, exec_worker_path, - pvf_execute_workers_max_num: execute_workers_max_num.unwrap_or_else( - || match config.chain_spec.identify_chain() { - // The intention is to use this logic for gradual increasing from 2 to 4 - // of this configuration chain by chain until it reaches production chain. - Chain::Polkadot | Chain::Kusama => 2, - Chain::Rococo | Chain::Westend | Chain::Unknown => 4, - }, - ), + // Default execution workers is 4 because we have 8 cores on the reference hardware, + // and this accounts for 50% of that cpu capacity. + pvf_execute_workers_max_num: execute_workers_max_num.unwrap_or(4), pvf_prepare_workers_soft_max_num: prepare_workers_soft_max_num.unwrap_or(1), pvf_prepare_workers_hard_max_num: prepare_workers_hard_max_num.unwrap_or(2), }) From 31a571a55e2252b1080f3e7bc25763ea417ad0ed Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe <49718502+alexggh@users.noreply.github.com> Date: Mon, 13 Jan 2025 15:47:42 +0200 Subject: [PATCH 2/5] Update lib.rs --- polkadot/node/service/src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs index 820cce8d083a6..ada4f15714759 100644 --- a/polkadot/node/service/src/lib.rs +++ b/polkadot/node/service/src/lib.rs @@ -944,9 +944,14 @@ pub fn new_full< secure_validator_mode, prep_worker_path, exec_worker_path, - // Default execution workers is 4 because we have 8 cores on the reference hardware, - // and this accounts for 50% of that cpu capacity. - pvf_execute_workers_max_num: execute_workers_max_num.unwrap_or(4), + pvf_execute_workers_max_num: execute_workers_max_num.unwrap_or_else( + || match config.chain_spec.identify_chain() { + // The intention is to use this logic for gradual increasing from 2 to 4 + // of this configuration chain by chain until it reaches production chain. + Chain::Polkadot => 2, + Chain::Rococo | Chain::Westend | Chain::Kusama | Chain::Unknown => 4, + }, + ), pvf_prepare_workers_soft_max_num: prepare_workers_soft_max_num.unwrap_or(1), pvf_prepare_workers_hard_max_num: prepare_workers_hard_max_num.unwrap_or(2), }) From 797d2bc51442749932e17b32c02e02ff6711e6d9 Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe Date: Mon, 13 Jan 2025 15:53:33 +0200 Subject: [PATCH 3/5] Revert "Update lib.rs" This reverts commit 31a571a55e2252b1080f3e7bc25763ea417ad0ed. --- polkadot/node/service/src/lib.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs index ada4f15714759..820cce8d083a6 100644 --- a/polkadot/node/service/src/lib.rs +++ b/polkadot/node/service/src/lib.rs @@ -944,14 +944,9 @@ pub fn new_full< secure_validator_mode, prep_worker_path, exec_worker_path, - pvf_execute_workers_max_num: execute_workers_max_num.unwrap_or_else( - || match config.chain_spec.identify_chain() { - // The intention is to use this logic for gradual increasing from 2 to 4 - // of this configuration chain by chain until it reaches production chain. - Chain::Polkadot => 2, - Chain::Rococo | Chain::Westend | Chain::Kusama | Chain::Unknown => 4, - }, - ), + // Default execution workers is 4 because we have 8 cores on the reference hardware, + // and this accounts for 50% of that cpu capacity. + pvf_execute_workers_max_num: execute_workers_max_num.unwrap_or(4), pvf_prepare_workers_soft_max_num: prepare_workers_soft_max_num.unwrap_or(1), pvf_prepare_workers_hard_max_num: prepare_workers_hard_max_num.unwrap_or(2), }) From ebfde88bbe591a511702fe26c60269e87e3a0763 Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe <49718502+alexggh@users.noreply.github.com> Date: Mon, 13 Jan 2025 15:59:20 +0200 Subject: [PATCH 4/5] Create pr_7116.prdoc --- prdoc/pr_7116.prdoc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 prdoc/pr_7116.prdoc diff --git a/prdoc/pr_7116.prdoc b/prdoc/pr_7116.prdoc new file mode 100644 index 0000000000000..45476581fcee2 --- /dev/null +++ b/prdoc/pr_7116.prdoc @@ -0,0 +1,8 @@ +title: Migrate pallet-fast-unstake and pallet-babe benchmark to v2 +doc: +- audience: Node Dev + description: |- + Increase the number of pvf execution workers from 2 to 4. +crates: +- name: polkadot-service + bump: patch From 79831ca6b42be91e4ea0596cb9c89d8ac417d54b Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe <49718502+alexggh@users.noreply.github.com> Date: Mon, 13 Jan 2025 15:59:53 +0200 Subject: [PATCH 5/5] Update pr_7116.prdoc --- prdoc/pr_7116.prdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prdoc/pr_7116.prdoc b/prdoc/pr_7116.prdoc index 45476581fcee2..95a5254778a4d 100644 --- a/prdoc/pr_7116.prdoc +++ b/prdoc/pr_7116.prdoc @@ -1,4 +1,4 @@ -title: Migrate pallet-fast-unstake and pallet-babe benchmark to v2 +title: Increase the number of pvf execution workers from 2 to 4 doc: - audience: Node Dev description: |-