Re: [PLUG] SWAP size based on host's installed memory
On Sat, 23 Mar 2024, Johnathan Mantey wrote: Did I miss the definition of SAR? System Activity Report. On my Slackware desktop it's in /user/bin/sar. man page available, too. HTH, Rich
Re: [PLUG] SWAP size based on host's installed memory
On Sat, 23 Mar 2024, Michael Ewan wrote: Some swap is necessary but not the RAM+2GB or other calculations, those kinds of recommendations are based on very old memory management routines. You can start with a swap file for safety and then measure actual memory use under actual work loads over a period of time, you can add/remove swap files as necessary rather than creating a swap partition (look at the swapon man page). Using SAR you can get all the information you need. Ages ago when we were sizing some big iron we ran SAR over a period of time and sized the RAM (very expensive at the time) so the machine NEVER paged out. Paging stats are far more important than swap stats, a machine pages all the time but should never swap, swapping is very expensive and indicates a machine that has pathetically small RAM. You will probably see some page outs (page in is fine since starting a process is a page in), so you can size your swap space based on the paging needs of the current configuration. Michael, Thanks for makeing me aware of SAR. Germene to all swap partition size justifications might the solution be relative to use and memory size alone? If a host can support 16GiB (e.g., on a laptop) or 64GiB (on a desktop) but there's only one or a few concurrent users I wonder whether any swap partition would be necessary. Perhaps running a spatio-temporal statistical or multi-dimentional hydraulic model might require a lot of memory (unless it supports threads, which most do nowadays) might benefit from a swap partition. And then, most storage devices (hdds and ssds) are large enough that a swap partition of installed RAM plus 2 GiB would not hinder application and data storage space. Regards, Rich
Re: [PLUG] SWAP size based on host's installed memory
> When a host has 16G, 32G, or 64G RAM what size SWAP partition would be appropriate? Are you wishing to use suspend to disk hibernation? If so, the RAM + 2 GB as Mike suggested is great. Otherwise consider no disk based swap, and instead use zram as swap. This greatly increases responsiveness compared to any disk based swap configuration. There is a zram-generator [1] that makes it easy to configure. [1] https://github.com/systemd/zram-generator -- Jeffrey Borcean
Re: [PLUG] SWAP size based on host's installed memory
On Thu, 21 Mar 2024, Jeffrey Borcean wrote: Are you wishing to use suspend to disk hibernation? If so, the RAM + 2 GB as Mike suggested is great. Jeffrey, I only rarely hibernate the laptop and never the desktops. Otherwise consider no disk based swap, and instead use zram as swap. This greatly increases responsiveness compared to any disk based swap configuration. There is a zram-generator [1] that makes it easy to configure. [1] https://github.com/systemd/zram-generator Interesting. Thank you. Regards, Rich
Re: [PLUG] SWAP size based on host's installed memory
On Thu, 21 Mar 2024, MC_Sequoia wrote: That recommendation is for RAM < 2 GB for ram > 2 GB, the recommendation is RAM + 2 GB. Thanks, MC. I could not find this information in the SA book or online. Regards, Rich
Re: [PLUG] SWAP size based on host's installed memory
"The advice to create a SWAP partition sized at RAM x 2 comes from the past when computers had very little memory." That recommendation is for RAM < 2 GB for ram > 2 GB, the recommendation is RAM + 2 GB.
[PLUG] SWAP size based on host's installed memory
I'm waiting for delivery of a 2T SSD to replace the 500G HDD on the ThinkPad T430. The advice to create a SWAP partition sized at RAM x 2 comes from the past when computers had very little memory. When a host has 16G, 32G, or 64G RAM what size SWAP partition would be appropriate? TIA, Rich