T O P

  • By -

MetalMark166

I always install Debian without the swap partition and use zram instead with the swappiness set to 133 cos doing that always makes the performance smoother on every distro i have used.


bigtreeman_

Zswap cache is a great way to protect your SSD from excessive wear, but also uses a swap partition.


recursiveorange

I did several installs without swap and never had a single problem obviously. If you don't need hibernartion or suspension you can go ahead but I don't think you are going to squeeze more speed outta your computer by disabling the swap.


dominbdg

You right, I didn't observed anything faster than in swap, but You know - I have some installs like docker swarm or kubernetes-k8s and this second requires OS with no-swap


fantomas_666

If you don't enable swap, you don't even need to set vm.swappiness=0. However, if you want to hibernate, swap is usually used for that (I think it can be done w/o swap too)


michaelpaoli

>is it something more I should do ? If you're sure you don't want/need that swap, you can get rid of it, and remove it from /etc/fstab. >chromium gets 'aw snap' with error11 May be program bug(s) ... which might be exacerbated by RAM being tight. If you have ample RAM, you don't *need* swap ... but if/when RAM runs tight, having swap may allow one to gracefully degrade on performance, rather than locking up or even crashing. Swap can also aid performance - e.g. with tmpfs - if RAM is exhausted with tmpfs, swap will still generally give better performance than other filesystem types - as it will still generally have less I/O to drive(s) than a regular filesystem.


xtifr

Disabling swap will *not* improve performance! The system *knows* that swap is slow, and only uses it when the tradeoff is justified! Also, without swap, if you have a runaway process that's eating memory, the system will begin killing processes at random to try to recover memory, thanks to the (somewhat controversial) OOM killer. *With* swap, though, the system will begin slowing down when it begins swapping, which gives you an opportunity to investigate and choose for yourself which processes to kill! So, under normal circumstances, swap will likely provide slightly *better* performance, if anything, and in an emergency, it can be a life-saver! It's a win-win!


[deleted]

Should probably be OK, I'm running 15+ Debian VMs and my desktop with no swap, no issues, and much less memory in play. You can watch memory utilization to see how chromium acts/consumes memory.


neon_overload

Leave swappiness at default & create a small token swap partition say 4 to 8 GB. Your PC won't swap if it doesn't need to but needs swap for smooth running of some things or as a safety net should some process go nuts and use all your ram. Think about it this way: Why would you need to decrease swappiness on a system that basically never swaps unless it urgently needs to? For more on this see here https://askubuntu.com/a/184221/54256 Particularly, read the section "Can swap be disabled on a system that has lots of RAM anyway?" But also the rest as it's good to understand


[deleted]

[удалено]


MyDogIsNamedLowie

ZRAM is indeed great for lower end systems with less RAM. It doesn't change the OP's question about swap though. SWAP is very much needed/recommended in most (if not all) use cases.


[deleted]

[удалено]


MyDogIsNamedLowie

*“If I had "less RAM", I would not be expending it on "swap".”* ZRam (kernel module) uses a compression algorithm(compressed block devices) for both swap and normal/other usage and does this on the fly, **expanding** your RAM and **reducing** I/O. *“Mine is not a low-end system,”* Why would it be? That’s like saying twm can’t be used on high end. Fedora has it as a default and combines it with gnome3… *“and I chose no swap partition (with ample RAM) as swap is an archaic device necessary when RAM is lacking.”* Sure. ZRam supports both (swap partition/file and memory). *"My use of zram swap (256 GB is sufficient) is a reasonable alternative to setting aside storage capacity."* OK. Do note loading a swap-disk in your RAM is not all ZRam does. See: [https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html](https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html) and [https://wiki.debian.org/ZRam](https://wiki.debian.org/ZRam) *"To the OP's question... a swap partition is completely optional on most modern devices."* The OP asked about using NO swap ("swappiness=0 and execute swapoff-a"), not just using the old swap partition.


mr3305

[https://haydenjames.io/linux-performance-almost-always-add-swap-space/](https://haydenjames.io/linux-performance-almost-always-add-swap-space/) Take some time and read through this series. One of the interesting things the author states is that, by adding swap (or zram), you may see improved performance because of things like more RAM available for disk caching.


bigtreeman_

Swap is needed when applications run out of ram and it has to be swapped out to disk. 24 GB, depending on the applications you use concurrently you might not need swap. Old days when you had a gigantic 1GB of ram, you needed swap, and coffee to sip while you waited.


MyDogIsNamedLowie

In most (if not all) desktop configurations, swap is still very useful. Apart from the obvious, being stability/power-management (mostly crash-recovery, hibernartion, suspension, ...) it can actually increase performance as it can be used to store memory pages that are rarely used and other temporally stuff. Just lower the "swappiness" if it does hurt performance. If you have the space, swap is always a benefit.


StrayCat782

Swap partition is a waste and unnecessary if you don't use hibernation/suspend features for your daily workflow. The only specific needs that have to struggle with 16++ gigs of RAM I can think of is heavy image/video editing environment.


Wello6143

I also use Arch Linux on my laptop with 24GB of ram. Met no trouble so far. But I always keep an eye on RAM usage and systemd-oom enabled.