What does a Mid-Level Linux Admin need to learn about Operating System Memory Management?
Posted by tastuwa@reddit | linuxadmin | View on Reddit | 22 comments
Let us say "Paging". Does he need to read the architecture of paging from manufacturers? Or is there something specific knowledge that would be helpful? Please tell a bit in detail.
magnezone150@reddit
I'd say a good start is understanding PS and TOP in greater detail, How memory caching works and how to clear levels of memory cache safely. RSS vs VSZ. All very helpful, I know installing HTOP where I can helps, understanding the systemd system helps on some distros since you can read, set limits in the unit files as well.
I'd say that's enough unless you really want to dive deeper into Kernel Dev and C.
stufforstuff@reddit
Just throw more ram at the problem - coders no longer worry or spend time at optimizing their code - so when in doubt, up the ram.
evild4ve@reddit
- nice
- oom-killer
- btop/htop/top
most of the time we just hope there is enough memory but in a commercial setup it might be necessary to be able to scale not-running-out-of-memory, and that is quite hard
Rakesh8081@reddit
Ansible ? SNMP? Well, doesn't apply always, how about a stand alone server? What role they have there?
evild4ve@reddit
SNMP is still useful minimally with the server + a local client + their router/firewall + DNS
Ansible would be what deployed the standalone server, so the playbook should have included a check of what RAM was available on the specific hardware, and given the server services that would be within its capacity
Rakesh8081@reddit
They are not related to memory management in the context of what OP is asking for.
Rakesh8081@reddit
Well first things first, understand the basics, what's page in, page out, what's swap and tmpfs, what's is swappiness, and wrt application what is memory leaks and how to trace them.
Then commands to monitor them, and then abillity to correlate the info. Vmstat, dmesg, htop/top ps etc.. are some of them ..
If you can understand all these terms you should be good .
dhsjabsbsjkans@reddit
I wouldn't strive for a kernel developer level of VMM. Big things to look for are pages to and from disk. You really want most of your work happening in memory. If you start seeing a lot of pages getting written to disk, you likely need more ram.
As an admin, I think you need to look at ram from the perspective of providing good performance for whatever app you are running.
Also, almost every Linux kernel these days uses all memory. Lots of file caching, etc to improve performance.
catwiesel@reddit
no?!
we need to make sure the hardware is able to run the software. so yeah, we need to know a little about how much ram the system has, how much the os and applications use. but usually using your head and reading recommended specs and monitoring the system (and adjusting) is enough.
if its not, I may suggest that its not mid-leveling anymore :)
Yupsec@reddit
If you tell me you're a Linux Admin but you don't understand paging, memory management, and how to tune your server for the application's it supports...well, I'll know you're lying to me about being a Linux Admin.
If your default is hot swapping more ram onto your system because you experienced an OOM event, please learn everything u/No_Rhubarb_7222 is recommending.
No_Rhubarb_7222@reddit
Be able to read and interpret the free Mr State commands (also know to start with these commands when memory pressure is reported by monitoring or if alerted to oom events)
Know how memory is used (types of caching, swap, hugepages, process memory)
Quickly pull and interpret data from the ps command and/or top, and be able to sort processes by memory usage, knowing the difference between rss and vsz and which one he needs to pay attention to in his situation of the moment
Be able to find documentation on memory tunables in /proc and know if any specific settings for these are used (and why) in the population of servers he manages
TL;DR: Know how to interpret memory info on the machine; recognize and do basic OOM troubleshooting; know the basics of how memory is used and for what purposes; understand if any specific tuning is implemented in the population and why.
brightlights55@reddit
"free Mr State commands"
Please clarify. I am familiar with free but I do not understand that phrase.
No_Rhubarb_7222@reddit
Updated, was auto corrected from vmstat
dodexahedron@reddit
Pretty sure autocorrect just hated on
memstatthere.SaxonRefrigerant@reddit
can you recommend any resources to learn more about that?
DrCrayola@reddit
https://www.linuxatemyram.com/
dodexahedron@reddit
That site needs to just be one of the ones that takes the host name and inserts it as the noun in the text, so you can substitute any of the number of things it's relevant for while still looking legit.
Something like
tux.atemyr.am, which I assure you most users would happily click on because they like ransomware. Or at least I assume that's why they do those things...(Oh and yes, .am is a real TLD. It is the country domain for Armenia, apparently.)
Ok_Size1748@reddit
www.linuxatemyram.com is so underrated…
quiet0n3@reddit
Memory gets used in multiple ways.
Private, shareable, cache, etc
They are handy to understand. But I think the most important is soft vs hard faults.
lildergs@reddit
A mid level admin?
You don't need to read anything from specific manufacturers, but you absolutely need to understand the underlying concepts.
You need to know what paging is. You need to know when RAM pages are being swapped to swap. You need to be able to set up and monitor a swap partition or file. You need to be able to tell when your paging is impacting disk performance. You need to be able to spot a memory leak in running software.
There are plenty of resources online to learn about this kinda stuff.
timrosu@reddit
Linux by default doesn't have out-of-memory killer configured. This means when you run out of ram, the system will freeze and you will have to reset it manually. You can also set up swap to keep it from freezing, but it will slow down instead. You can fine tune the swap with swappiness value, read more about it in linked archwiki page. There is also Zram (memory compression), but that will slow down stuff (still a lot better than swap on disk).
Marelle01@reddit
I make sure I have enough memory to run the services. How Linux kernel handles paging is of no use to me.
Do you have applications with huge memory requirements, gigantic disk sizes or high frequency applications?