Skip to content

Commit

Permalink
change chunk percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
eaypek-tfh committed Jan 24, 2025
1 parent 4ad063b commit c4e143f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deploy/stage/common-values-iris-mpc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: "ghcr.io/worldcoin/iris-mpc:5ee9a90f515981506282708796dc5daa971ef207"
image: "ghcr.io/worldcoin/iris-mpc:6a553754fbe55bd4d0691343c756631d5c2e68b1"

environment: stage
replicaCount: 1
Expand Down
2 changes: 1 addition & 1 deletion deploy/stage/smpcv2-0-stage/values-iris-mpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion deploy/stage/smpcv2-1-stage/values-iris-mpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion deploy/stage/smpcv2-2-stage/values-iris-mpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 11 additions & 2 deletions iris-mpc/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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(
Expand All @@ -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 {
Expand All @@ -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);
Expand Down Expand Up @@ -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()
);

Expand Down

0 comments on commit c4e143f

Please sign in to comment.