
CwF wrote:There should not be one formula. There is the purpose of the machine that through past iterations some generalities should be known, since rarely is this question starting from scratch! Recognize that the common-sense idea that swap is for when you run out of memory isn't the only reason it exist. While maybe an original reason, generous systems now have plenty of ram and those past examples show swap is still used. Realize there are types we can argue about, and amounts to stress over, and applicable use case. Overall, there should be some form of swap. The details are negotiable.
free -h # static measurement
grep pswp /proc/vmstat # record of swap usage
Head_on_a_Stick wrote:
- Code: Select all
free -h # static measurement
grep pswp /proc/vmstat # record of swap usage
CwF wrote:Since I've never figured out what I'm missing I use XFCE. So I have a minimize to 'Notification Area' instance of xfce4-taskmanager that gives me a nice hover message of user memory and swap usage. I may have a genmon watching something from time to time on setups where that info isn't the full story. With root rights "swapon" gives a snapshot that is meaningful to glance at at the right times. Once settled, you don't really need to watch it.
As important as the use case of the machine is the status of the activity, stable or experimental. A stable machine is one where the judgement is already in and we don't expect anything to get out of whack. Unused swap of that machine is a waste. On a testing machine things may go wrong. With a large swap available an errant process might be contained, maybe not, but more space could save you.
Swappiness is a Linux kernel property that sets the balance between swapping out pages from the physical memory to the swap space and removing pages from the page cache. It basically defines how often the system will use the swap space.
Bulkley wrote:Depending on your system and what you do with it changing swappiness may be worth adjusting.
MicroScreen wrote:In order to avoid unused SWAP space
MicroScreen wrote:swappiness
MicroScreen wrote: tests with as many I/O movements as possible would be to perform a backup of several data carriers simultaneously to one of the HDDs while a benchmark test is running
For a compromise 'buster', a little of both;Overall, there should be some form of swap. The details are negotiable.
# swapon
NAME TYPE SIZE USED PRIO
/dev/dm-2 partition 4.6G 689.7M -2
/dev/zram0 partition 128M 46.7M 100
/dev/zram1 partition 128M 48.4M 100
/dev/zram2 partition 128M 48.7M 100
/dev/zram3 partition 128M 50.3M 100
........
/dev/zram15 partition 128M 48.9M 100
# uptime
08:08:48 up 110 days, 23:38, 2 users, load average: 0.86, 0.92, 0.90
# uptime
08:10:08 up 61 days, 17:35, 3 users, load average: 0.76, 0.60, 0.61
# swapon
NAME TYPE SIZE USED PRIO
/dev/dm-1 partition 7.6G 326M -1
p.H wrote:What's wrong with unused swap space ? Disk space is cheap.
CwF wrote:So on the negotiable aspects, I lied. My rules are simple - but maybe not universal. Swap Partitions are archaic and no longer needed. Swap Files are a substitute without any real advantage. Zramswap rocks. And yes, you need something! Swappiness=0 with nothing works fine until it doesn't. I run some vm's like that but with a trick - they have unallocated memory to add when they lock up tight, and they do unfreeze and continue like nothing happened. Not easily possible on bare metal.
Users browsing this forum: No registered users and 17 guests