Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
-
No low-effort posts. This is subjective and will largely be determined by the community member reports.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
view the rest of the comments
Is there a good way to tell what percent of RAM in use is used by less important caching of files that could be closed without any adverse effects vs files that if closed, the whole app stops functioning?
Basically, I'm hoping htop isn't broken and is reporting I have 8GB of important showstopping files open and everything else is cache that is unimportant/closable without the need to touch SWAP.
https://stackoverflow.com/questions/30869297/difference-between-memfree-and-memavailable
Looking at the htop source:
https://github.com/htop-dev/htop/blob/main/MemoryMeter.c
It's adding used, shared, and compressed memory, to get the amount actually tied up, but disregarding cached memory, which, based on the above comment, is problematic, since some of that may not actually be available for use.
top, on the other hand, is using the kernel's MemAvailable directly.https://gitlab.com/procps-ng/procps/-/blob/master/src/free.c
In short: You probably want to trust /proc/meminfo's MemAvailable, (which is what
topwill show), andhtopis probably giving a misleadingly-low number.Thank you for the detailed explanation
No problem. It was an interesting question that made me curious too.
Came across some more info that you might find interesting. If true, htop is ignoring the cache used by ZFS but accounting for everything else.
link
Yes, ZFS cache has been contentious for exactly the reason you posted, but it is generally not a functional issue.
ZFS will release cache under memory pressure, however nice values of virtualizing can potentially demand it sooner than ZFS can release it.
There have been many changes to ZFS to improve this, but the legacy of "invisible cache" is still around.
This is the job for the OS.
You can run most Linux systems with stupid amounts of swap and the only thing you'll notice is that stuff starts slowing down.
In my experience, only in extremely rare cases are you smarter than the OS, and in 25+ years of using Linux daily I've seen it exactly once, where
oomkillerkilled runningmysqldprocesses, which would have been fine if the developer had used transactions. Suffice to say, they did not.I used a 1 minute cron job to reprioritize the process, problem "solved" .. for a system that hadn't been updated for 12 years but was still live while we documented what it was doing and what was required to upgrade it.