[bugfix] fix inconsistent calculated cache sizes (#2115)

* use calculated exampleTime instead of `time.Now()` to ensure no locale data, retweak cache ratios

* update envparsing test

* update default cache memory to 100MiB

* fix envparsing with latest cache target default

---------

Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
kim 2023-08-14 17:08:19 +01:00 committed by GitHub
commit 815b5291e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 127 additions and 109 deletions

View file

@ -129,7 +129,7 @@ var Defaults = Configuration{
// Rough memory target that the total
// size of all State.Caches will attempt
// to remain with. Emphasis on *rough*.
MemoryTarget: 200 * bytesize.MiB,
MemoryTarget: 100 * bytesize.MiB,
// These ratios signal what percentage
// of the available cache target memory
@ -145,32 +145,32 @@ var Defaults = Configuration{
// when TODO items in the size.go source
// file have been addressed, these should
// be able to make some more sense :D
AccountMemRatio: 18,
AccountNoteMemRatio: 0.1,
AccountMemRatio: 5,
AccountNoteMemRatio: 1,
ApplicationMemRatio: 0.1,
BlockMemRatio: 3,
BlockMemRatio: 2,
BlockIDsMemRatio: 3,
BoostOfIDsMemRatio: 3,
EmojiMemRatio: 3,
EmojiCategoryMemRatio: 0.1,
FollowMemRatio: 4,
FollowMemRatio: 2,
FollowIDsMemRatio: 4,
FollowRequestMemRatio: 2,
FollowRequestIDsMemRatio: 2,
InReplyToIDsMemRatio: 3,
InstanceMemRatio: 1,
ListMemRatio: 3,
ListEntryMemRatio: 3,
ListMemRatio: 1,
ListEntryMemRatio: 2,
MarkerMemRatio: 0.5,
MediaMemRatio: 4,
MentionMemRatio: 5,
NotificationMemRatio: 5,
MentionMemRatio: 2,
NotificationMemRatio: 2,
ReportMemRatio: 1,
StatusMemRatio: 18,
StatusFaveMemRatio: 5,
StatusMemRatio: 5,
StatusFaveMemRatio: 2,
StatusFaveIDsMemRatio: 3,
TagMemRatio: 3,
TombstoneMemRatio: 2,
TagMemRatio: 2,
TombstoneMemRatio: 0.5,
UserMemRatio: 0.25,
WebfingerMemRatio: 0.1,
VisibilityMemRatio: 2,