~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

An account once loaded is never let go

Open
Open chadtmiller.com opened this issue 0 comments

Since accounts are loaded on their first use (crates/pds-server/src/directory.rs), an account's Account, its sessions and its preferences stay in memory from then on. Its store is let go when idle (cache.rs); the account is not.

What it costs

About 1.6 to 2.9 KB an account as the scale run makes them (162 MiB with 91000 loaded; 288 MiB with 100000 before accounts were loaded on demand). That is inside spec/STORE.md's 4 KiB an account, so no rule is broken: but a server of 500000 accounts all of which are used at some time holds over a gibibyte of them, however long ago each was last used.

What would fix it

Letting go the accounts not used for a while that have nothing in flight, as stores are: the directory already loads one again from its row and the log.

What would check it

The scale run touching every one of its 100000 accounts, waiting, and holding resident memory to the base and the cache, not to 4 KiB an account.