Skip to content

Commit

Permalink
reduced the memory footprint of the server by reducing the allowed ca…
Browse files Browse the repository at this point in the history
…ching
  • Loading branch information
CommanderStorm committed Jul 9, 2023
1 parent dd35596 commit 13ab1d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions deployment/k3s/templates/deployments/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ spec:
resources:
requests:
cpu: 500m
memory: 600Mi
memory: 60Mi
limits:
memory: 1000Mi
memory: 200Mi
livenessProbe:
httpGet:
path: /api/status
Expand Down
4 changes: 2 additions & 2 deletions server/main-api/src/maps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ fn get_localised_data(id: &str, should_use_english: bool) -> Result<DBRoomEntry,
}

// type and create are specified, because a custom conversion is needed
// size=50 is about 150Mi
// size=1 is about 3Mi
#[cached(
type = "SizedCache<String, Vec<u8>>",
create = "{ SizedCache::with_size(30) }",
create = "{ SizedCache::with_size(5) }",
option = true,
convert = r#"{ _id.to_string() }"#
)]
Expand Down
2 changes: 1 addition & 1 deletion server/main-api/src/search/search_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct ResultEntry {
}

// size=1 ~= 0.1Mi
#[cached(size = 2500)]
#[cached(size = 200)]
pub async fn do_geoentry_search(
q: String,
highlighting: (String, String),
Expand Down

0 comments on commit 13ab1d4

Please sign in to comment.