From c4e143f106b49e99b566af806a7d5fcc0d8a143b Mon Sep 17 00:00:00 2001 From: Ertugrul Aypek Date: Fri, 24 Jan 2025 19:19:12 +0100 Subject: [PATCH] change chunk percentage --- deploy/stage/common-values-iris-mpc.yaml | 2 +- deploy/stage/smpcv2-0-stage/values-iris-mpc.yaml | 2 +- deploy/stage/smpcv2-1-stage/values-iris-mpc.yaml | 2 +- deploy/stage/smpcv2-2-stage/values-iris-mpc.yaml | 2 +- iris-mpc/src/bin/server.rs | 13 +++++++++++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/deploy/stage/common-values-iris-mpc.yaml b/deploy/stage/common-values-iris-mpc.yaml index 41fb4e954..af1e5cd0d 100644 --- a/deploy/stage/common-values-iris-mpc.yaml +++ b/deploy/stage/common-values-iris-mpc.yaml @@ -1,4 +1,4 @@ -image: "ghcr.io/worldcoin/iris-mpc:5ee9a90f515981506282708796dc5daa971ef207" +image: "ghcr.io/worldcoin/iris-mpc:6a553754fbe55bd4d0691343c756631d5c2e68b1" environment: stage replicaCount: 1 diff --git a/deploy/stage/smpcv2-0-stage/values-iris-mpc.yaml b/deploy/stage/smpcv2-0-stage/values-iris-mpc.yaml index fbe86d8a0..e21cbb16a 100644 --- a/deploy/stage/smpcv2-0-stage/values-iris-mpc.yaml +++ b/deploy/stage/smpcv2-0-stage/values-iris-mpc.yaml @@ -96,7 +96,7 @@ env: value: "true" - name: SMPC__PAGE_LOCK_CHUNK_PERCENTAGE - value: "20" + value: "25" - name: SMPC__CLEAR_DB_BEFORE_INIT value: "true" diff --git a/deploy/stage/smpcv2-1-stage/values-iris-mpc.yaml b/deploy/stage/smpcv2-1-stage/values-iris-mpc.yaml index 5c3bc1b3f..1729f08ab 100644 --- a/deploy/stage/smpcv2-1-stage/values-iris-mpc.yaml +++ b/deploy/stage/smpcv2-1-stage/values-iris-mpc.yaml @@ -96,7 +96,7 @@ env: value: "true" - name: SMPC__PAGE_LOCK_CHUNK_PERCENTAGE - value: "20" + value: "25" - name: SMPC__CLEAR_DB_BEFORE_INIT value: "true" diff --git a/deploy/stage/smpcv2-2-stage/values-iris-mpc.yaml b/deploy/stage/smpcv2-2-stage/values-iris-mpc.yaml index 4912aa4a2..d11468f52 100644 --- a/deploy/stage/smpcv2-2-stage/values-iris-mpc.yaml +++ b/deploy/stage/smpcv2-2-stage/values-iris-mpc.yaml @@ -96,7 +96,7 @@ env: value: "true" - name: SMPC__PAGE_LOCK_CHUNK_PERCENTAGE - value: "20" + value: "25" - name: SMPC__CLEAR_DB_BEFORE_INIT value: "true" diff --git a/iris-mpc/src/bin/server.rs b/iris-mpc/src/bin/server.rs index e3ce10220..6f72bb972 100644 --- a/iris-mpc/src/bin/server.rs +++ b/iris-mpc/src/bin/server.rs @@ -1192,6 +1192,7 @@ async fn server_main(config: Config) -> eyre::Result<()> { S3Store::new(db_chunks_s3_client.clone(), db_chunks_bucket_name.clone()); tokio::runtime::Handle::current().block_on(async { + let total_load_time = Instant::now(); tracing::info!("Page-lock host memory"); let dbs = [ (actor.left_code_db_slices.code_gr.clone(), IRIS_CODE_LENGTH), @@ -1201,8 +1202,13 @@ async fn server_main(config: Config) -> eyre::Result<()> { ]; let n_page_lock_iters = 100 / config.page_lock_chunk_percentage; let page_lock_chunk_size = config.max_db_size / n_page_lock_iters; + tracing::info!( + "Will page lock chunks in {} iters each {} items", + n_page_lock_iters, + page_lock_chunk_size + ); let dbs_clone = dbs.clone(); - let now = Instant::now(); + let mut now = Instant::now(); for (db, code_length) in dbs_clone { let device_manager_clone = actor.device_manager.clone(); register_host_memory( @@ -1220,6 +1226,7 @@ async fn server_main(config: Config) -> eyre::Result<()> { // prepare the handle for the rest of the page locks let page_lock_handle = spawn_blocking(move || { for i in 1..n_page_lock_iters { + tracing::info!("Page-locking chunk {}", i); let dbs_clone = dbs.clone(); let device_manager_clone = device_manager_clone.clone(); for (db, code_length) in dbs_clone { @@ -1232,9 +1239,11 @@ async fn server_main(config: Config) -> eyre::Result<()> { code_length, ); } + tracing::info!("Page-locking chunk {} completed", i); } }); + now = Instant::now(); let mut load_summary_ts = Instant::now(); let mut time_waiting_for_stream = Duration::from_secs(0); let mut time_loading_into_memory = Duration::from_secs(0); @@ -1404,7 +1413,7 @@ async fn server_main(config: Config) -> eyre::Result<()> { tracing::info!( "Loaded {} records from db into memory in {:?} [DB sizes: {:?}]", record_counter, - now.elapsed(), + total_load_time.elapsed(), actor.current_db_sizes() );