Change nginx cache size to 1 GiB #759
No reviewers
Labels
No labels
approved, awaiting change
bug
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs docs
needs tests
not a bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#759
Loading…
Reference in a new issue
No description provided.
Delete branch "norm/akkoma:nginx-cache-size"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The current 10 GiB cache size is too large to fit into tmpfs for VMs and
other machines with smaller RAM sizes. Most non-Debian distros mount
/tmp on tmpfs.
Btw, does it actually make sense to use an nginx cache for local media?
For caching proxied media, i would guess using a large cache on disk is preferable to a small cache in RAM.
For local media using a disk cache doesn't make any sense (it’s already on disk) and a RAM cache seems at first thought a bit redunadant with the OS-level page cache too, though perhaps effectively reserving some chunk of RAM for recent media is actually helpful?
Ok, so originally only
/proxy
used the nginx cache, but cache was added to/media
during a restructure(?) after which/media
itself might also proxy request when using a non-local uploader.This proxy behaviour was removed in Akkoma instead always redirecting, so i think we should just stop recommending nginx cache for our own uploads.
Redirecting makes more sense to me and avoids wasting cache on local files. If we want to reintroduce proxying for old-upload-compat routes, this should just redirect to a
/proxy
URL instead of proxying directly.One thing I think the cache does help with is reducing the amount of file descriptors used by akkoma, I've had a few instances of akkoma running out of fds which was a major pain to deal with
I did raise the fd limit but it didn't completely resolve the issue, not sure if there's a better way of dealing with that