Swap can have another benefit: Linux takes note of which pages of memory are not being touched. It tags them as "Inactive". They might be speculatively written to the swap file but not removed from DRAM (SwapCached). When memory pressure happens, those SwapCached pages can be released without having to write to disk. Some processes might allocate, but not actively use, a fair amount of memory that can eventually be recognised as Inactive, and SwapCached. If those pages are eventually accessed, they can be quickly pulled out of SwapCached+Inactive and into Active, without having to read from disk. Alternatively, if you're dealing with a fileserver, most of your memory might indeed be Cached, swap might allow those Inactive pages to be moved out of DRAM to gain a little bit more memory for the cache. The linux kernel devs working on its virtual memory subsystem are pretty smart, swap is rarely going to be a hinderence, but as mentioned swappiness (and many other tunables) can be adjusted for pretty much any workload. Those categorizations I mentioned about memory (Active, Inactve, SwapCached, Cached, and dozens more) can be retrieved with: $ cat /proc/meminfo If you have a large amount of Inactive, swap might just be a benefit.
@lethalz45192 жыл бұрын
Great video, clear and consice!
@art40182 жыл бұрын
Thank you for another great video!
@send2gl2 жыл бұрын
I actually run headless Raspberry Pi server using Apache, xsane, mumble, samba, dlna and others. It is an original Pi with only 256MB RAM. I also have a desktop and vnc installed but neither run at boot. I created a 512MB RAM for the very rare occasions I initialize the Desktop and VNC. Works well but I admit I've not actually checked the memory usage whilst running these two services.
@netwebgaming51212 жыл бұрын
In Ubuntu, if CSF and fail2ban is installed, do you recommend installing UFW too?
@Henk777ER2 жыл бұрын
Hi, thanks for the video. What about the size of the swap partition? These days you can have plenty of RAM on your system like 16GB. A rule of thumb is the swap size is twice the amount of RAM, so here the swap partition would be 32GB. But with 16GB of RAM isn't the chance you run out of RAM and need swap very remote? So why then allocate 32GB of swap space?
@AkamaiDeveloper2 жыл бұрын
Hello Henk - The following article from It's Foss outlines a bit more about swap recommendations and how vary from distro to distro. itsfoss.com/swap-size/ For some additional context, on the Linode platform, the default swap size on a 16GB instance is 512MB.
@vinvvinv74602 жыл бұрын
Hi, can you make a video explaining /etc/hosts, /etc/resolve.conf & /etc/named.conf why and when are they used? if you can provide a practical real-world working example In a basic understanding manner, please its a request
@PS_Tube2 жыл бұрын
If someone uses Linux desktop with suspend, you'd need to have swap that's equal to or double the RAM. Else, 1 or 2 GiB of swap is enough. Better to be safe than sorry.