Skip to content

Commit

Permalink
DOSE-1093 [Backport of DOSE-1092 to 6.0.13.0] object cache size shoul…
Browse files Browse the repository at this point in the history
…d be tunable (openzfs#260)

Default value remains 100, but this will allow easily increasing it for testing.
  • Loading branch information
ahrens authored Mar 1, 2022
1 parent cf30636 commit 6b8d5df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/zfs_object_agent/zettaobject/src/object_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct ObjectCache {

lazy_static! {
static ref CACHE: std::sync::Mutex<ObjectCache> = std::sync::Mutex::new(ObjectCache {
cache: LruCache::new(100),
cache: LruCache::new(*OBJECT_CACHE_SIZE),
reading: HashMap::new(),
});
static ref NON_RETRYABLE_ERRORS: Vec<StatusCode> = vec![
Expand All @@ -58,6 +58,7 @@ lazy_static! {
pub static ref OBJECT_CACHE_IS_BYPASSABLE: bool = get_tunable("object_cache_is_bypassable", false);
pub static ref OBJECT_QUEUE_DEPTH_PER_TYPE: usize = get_tunable("object_queue_depth_per_type", 100);
pub static ref PER_REQUEST_TIMEOUT: Duration = Duration::from_secs(get_tunable("per_request_timeout_secs", 2));
static ref OBJECT_CACHE_SIZE: usize = get_tunable("object_cache_size", 100);
}

#[derive(Debug, Enum, Copy, Clone)]
Expand Down

0 comments on commit 6b8d5df

Please sign in to comment.