Skip to content

Commit c62ec04

Browse files
leftwoAlan Hanson
andauthored
Make 30 workers for local storage disks (#9639)
In testing on Cosmo We determined that 30 worker threads for each local storage disk seemed about right, so let's make Omicron tell propolis that when it sends over the information about disks attached to an instance. Co-authored-by: Alan Hanson <alan@oxide.computer>
1 parent cfb7836 commit c62ec04

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

nexus/src/app/instance_platform/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ use std::collections::HashMap;
7777
use crate::app::instance::InstanceRegisterReason;
7878
use crate::cidata::InstanceCiData;
7979

80+
use super::LOCAL_STORAGE_WORKERS;
8081
use crate::db::datastore::Disk;
8182
use nexus_db_queries::db;
8283
use omicron_common::api::external::Error;
@@ -279,7 +280,7 @@ impl DisksByIdBuilder {
279280
path,
280281
readonly: false,
281282
block_size: disk.block_size().to_bytes(),
282-
workers: None,
283+
workers: Some(LOCAL_STORAGE_WORKERS),
283284
});
284285

285286
self.add_generic_disk(disk, backend)

nexus/src/app/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ use slog_error_chain::InlineErrorChain;
4545
use std::collections::HashMap;
4646
use std::net::SocketAddrV6;
4747
use std::net::{IpAddr, Ipv6Addr};
48+
use std::num::NonZeroU32;
4849
use std::sync::Arc;
4950
use std::sync::OnceLock;
5051
use tokio::sync::mpsc;
@@ -156,6 +157,12 @@ pub const MAX_MEMORY_BYTES_PER_INSTANCE: u64 = 1536 * (1 << 30); // 1.5 TiB
156157
pub const MIN_DISK_SIZE_BYTES: u32 = 1 << 30; // 1 GiB
157158
pub const MAX_DISK_SIZE_BYTES: u64 = 1023 * (1 << 30); // 1023 GiB
158159

160+
/// This was number was chosen as the best-ish measured on a Cosmo when more or
161+
/// less fully dedicating an SN861 as a disk for a single VM. This is certainly
162+
/// higher than necessary for Gimlet, and is chosen far higher than may be
163+
/// appropriate if the disk is shared across several or more instances.
164+
pub const LOCAL_STORAGE_WORKERS: NonZeroU32 = NonZeroU32::new(30).unwrap();
165+
159166
/// This value is aribtrary
160167
pub const MAX_SSH_KEYS_PER_INSTANCE: u32 = 100;
161168

0 commit comments

Comments
 (0)