Skip to content

Commit

Permalink
Tune down a bunch of limits to try to get the maximum used files down
Browse files Browse the repository at this point in the history
This includes parallelism controls and cache sizes
  • Loading branch information
bobbobbio committed Sep 4, 2024
1 parent 42faee9 commit f3a2b15
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/maelstrom-client-process/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl ClientState {
const MANIFEST_INLINE_LIMIT: u64 = 200 * 1024;

/// Maximum number of layers to build simultaneously
const MAX_IN_FLIGHT_LAYER_BUILDS: usize = 100;
const MAX_IN_FLIGHT_LAYER_BUILDS: usize = 10;

impl Client {
pub fn new() -> Self {
Expand Down
2 changes: 1 addition & 1 deletion crates/maelstrom-fuse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use tokio::{
///
/// This limit is put in place to try to have some control on the amount of tasks and memory being
/// used by a FUSE connection.
pub const MAX_INFLIGHT: usize = 30;
pub const MAX_INFLIGHT: usize = 20;

/// The handle returned by [`fuse_mount_namespace`]. It can be used make the child exit (thus
/// removing the mount) also it provides a way to get the path to the mount (via `/proc/`)
Expand Down
8 changes: 4 additions & 4 deletions crates/maelstrom-layer-fs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,14 @@ impl Default for ReaderCache {
}

/// The maximum size of the reader cache.
pub const READER_CACHE_SIZE: u64 = 300 + 300 + 200;
pub const READER_CACHE_SIZE: u64 = 100 + 100 + 50;

impl ReaderCache {
pub fn new() -> Self {
let s = Self {
dir_readers: LruCache::new(300.try_into().unwrap()),
file_readers: LruCache::new(300.try_into().unwrap()),
data_files: LruCache::new(200.try_into().unwrap()),
dir_readers: LruCache::new(100.try_into().unwrap()),
file_readers: LruCache::new(100.try_into().unwrap()),
data_files: LruCache::new(50.try_into().unwrap()),
};
assert_eq!(
usize::from(s.dir_readers.cap())
Expand Down
2 changes: 1 addition & 1 deletion crates/maelstrom-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub struct DispatcherAdapter {
layer_building_semaphore: Arc<tokio::sync::Semaphore>,
}

pub const MAX_IN_FLIGHT_LAYERS_BUILDS: usize = 100;
pub const MAX_IN_FLIGHT_LAYERS_BUILDS: usize = 10;

impl DispatcherAdapter {
#[allow(clippy::too_many_arguments)]
Expand Down

0 comments on commit f3a2b15

Please sign in to comment.