[arch-general] Install wiki - recommendations regarding 'swap' ?
All, After installing without AIF, I want to update the install wiki to drop a note about swap. It isn't addressed at all. What is the current Arch recommendation regarding swap creation? I.E.: recommended for systems w/less that 1G of RAM, create swap file of what size? (256M?) Even if swap is not recommended, I at least want to drop that note in the basic install. Thanks. -- David C. Rankin, J.D.,P.E.
On Sat, 4 Aug 2012, David C. Rankin wrote:
All,
After installing without AIF, I want to update the install wiki to drop a note about swap. It isn't addressed at all. What is the current Arch recommendation regarding swap creation? I.E.: recommended for systems w/less that 1G of RAM, create swap file of what size? (256M?) Even if swap is not recommended, I at least want to drop that note in the basic install. Thanks.
I think it depends wildly on what you're doing. If you're gaming on KDE, or running a server on a 2GB machine, you're gonna want swap. If you want to hibernate, you need at least as much as you have RAM. If you're (like me) just running a bunch of terminals in DWM, then you won't need any swap even for a 1GB system. A page with RAM usage estimates for different sorts of systems might be useful, but past that, there's not much that can be said that's generally applicable. -- Scott Lawrence Linux jagadai 3.4.6-1-ARCH #1 SMP PREEMPT Fri Jul 20 08:21:26 CEST 2012 x86_64 GNU/Linux
On Sun, Aug 5, 2012 at 4:50 AM, Scott Lawrence <bytbox@gmail.com> wrote:
If you want to hibernate, you need at least as much as you have RAM.
I'm not sure this is true. AFAIK, both swsusp and uswsusp try to reduce the hibernation image as much as possible – I think /sys/power/image_size defaults to 1 GB for swsusp. (A large part of RAM is usually used by cache, which can be just freed before hibernating.) -- Mantas Mikulėnas
On Sun, Aug 5, 2012 at 10:30 AM, Mantas Mikulėnas <grawity@gmail.com> wrote:
On Sun, Aug 5, 2012 at 4:50 AM, Scott Lawrence <bytbox@gmail.com> wrote:
If you want to hibernate, you need at least as much as you have RAM.
I'm not sure this is true. AFAIK, both swsusp and uswsusp try to reduce the hibernation image as much as possible – I think /sys/power/image_size defaults to 1 GB for swsusp. (A large part of RAM is usually used by cache, which can be just freed before hibernating.)
-- Mantas Mikulėnas
As far as I know linux kernel expects a swap by default (that might have changed after 3 kernel though..). Personally I have 8Gb of RAM and rarely some KB are written to the swap. Even when I had 4Gb or memory it was the same, rarely used it. I have set swap to be 500Mb and set the kernel rarely to swap anything to my SSD. Note: for SSDs it's not recommended to have the swap writing a lot to the disk as it wears off the SSD. -- Caution: breathing may be hazardous to your health. #include <stdio.h> int main(){printf("%s","\x4c\x65\x6f\x6e\x69\x64\x61\x73");}
On Sat, Aug 4, 2012 at 8:46 PM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
All,
After installing without AIF, I want to update the install wiki to drop a note about swap. It isn't addressed at all. What is the current Arch recommendation regarding swap creation? I.E.: recommended for systems w/less that 1G of RAM, create swap file of what size? (256M?) Even if swap is not recommended, I at least want to drop that note in the basic install. Thanks.
i don't hibernate, but i still like 1-to-1 or so mapping of swap to RAM, mainly because swap space is the backing store for tmpfs and any low-mem situations ... i've had OOM killer come in and murder stuff i really wished it wouldn't have, and if tmpfs does happen to fill (i've done it multiple times) things are "nicer" when swap is around to relieve pressure, because tmpfs files can simply be swapped out if not in use. i also had a really nasty webkit bug that took ~3 days to track, and it turned out to be due to lack of swap -- linux kernel disables or at least limits memory overcommit when swap is not present: http://trac.webkit.org/changeset/86957 -- so now i keep some around just so things are smoother. -- C Anthony
On Sat, Aug 04, 2012 at 08:46:05PM -0500, David C. Rankin wrote:
All,
After installing without AIF, I want to update the install wiki to drop a note about swap. It isn't addressed at all. What is the current Arch recommendation regarding swap creation? I.E.: recommended for systems w/less that 1G of RAM, create swap file of what size? (256M?) Even if swap is not recommended, I at least want to drop that note in the basic install. Thanks.
As others on this thread have elaborated, it comes down to the individual's need. I don't think any distro can dictate about the need of a swap or not.
2012/8/5 gt <static.vortex@gmx.com>:
On Sat, Aug 04, 2012 at 08:46:05PM -0500, David C. Rankin wrote:
All,
After installing without AIF, I want to update the install wiki to drop a note about swap. It isn't addressed at all. What is the current Arch recommendation regarding swap creation? I.E.: recommended for systems w/less that 1G of RAM, create swap file of what size? (256M?) Even if swap is not recommended, I at least want to drop that note in the basic install. Thanks.
As others on this thread have elaborated, it comes down to the individual's need. I don't think any distro can dictate about the need of a swap or not.
I almost don't use swap as my RAM can handle my needs. But, just in case, I set swap partition to 1,5x my RAM capacity.
On 08/04/2012 11:11 PM, rafael ff1 wrote:
2012/8/5 gt <static.vortex@gmx.com>:
On Sat, Aug 04, 2012 at 08:46:05PM -0500, David C. Rankin wrote:
All,
After installing without AIF, I want to update the install wiki to drop a note about swap. It isn't addressed at all. What is the current Arch recommendation regarding swap creation? I.E.: recommended for systems w/less that 1G of RAM, create swap file of what size? (256M?) Even if swap is not recommended, I at least want to drop that note in the basic install. Thanks.
As others on this thread have elaborated, it comes down to the individual's need. I don't think any distro can dictate about the need of a swap or not.
I almost don't use swap as my RAM can handle my needs. But, just in case, I set swap partition to 1,5x my RAM capacity.
Scott, C, gt, Rafel, Thank you for all you comments. I'll drop a note in the wiki that captures a brief set of these considerations and the few steps needed to set up a swap if the user desires. -- David C. Rankin, J.D.,P.E.
On 08/05/2012 12:04 AM, David C. Rankin wrote:
Scott, C, gt, Rafel,
Thank you for all you comments. I'll drop a note in the wiki that captures a brief set of these considerations and the few steps needed to set up a swap if the user desires.
Well, I do not have permission to write to the Install wiki. I think the best way to handle it is this: after this existing note: <quote> Remember to create any stacked block devices like LVM, LUKS, or RAID. Consider also if you will require swap space for your install. swap is needed for suspend-to-disk capability and is required by a few applications to run. More information on swap can be found in the Partitioning link above. </quote> That is simple enough, it raises the issue and refers the user to where he can find additional info to guild him. -- David C. Rankin, J.D.,P.E.
Thank you for all you comments. I'll drop a note in the wiki that captures a brief set of these considerations and the few steps needed to set up a swap if the user desires.
With 4Gb and even > 32 Gb rams on some systems you may want to note that you can use a small swap for caching and a second swap file for hibernation that can easily be reclaimed. Not sure if the file can be created on demand and if so how not having enough space to hibernate is handled however. -- _______________________________________________________________________ 'Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface' (Doug McIlroy) _______________________________________________________________________
On Sun, Aug 5, 2012 at 3:24 PM, Kevin Chadwick <ma1l1ists@yahoo.co.uk> wrote:
Thank you for all you comments. I'll drop a note in the wiki that captures a brief set of these considerations and the few steps needed to set up a swap if the user desires.
With 4Gb and even > 32 Gb rams on some systems you may want to note that you can use a small swap for caching and a second swap file for hibernation that can easily be reclaimed. Not sure if the file can be created on demand and if so how not having enough space to hibernate is handled however.
With swsusp (kernel mode), I don't think you /can/ even hibernate to a file. With uswsusp, the s2disk program could be patched to create a file on demand, and it would simply exit before hibernating if not enough space. But still, I'm not sure whether resuming from a file will work, because the pre-resume kernel has to mount the filesystem in order to read from the hiberfile, but the filesystem is already mounted by the hibernated kernel... -- Mantas Mikulėnas
participants (8)
-
C Anthony Risinger
-
David C. Rankin
-
gt
-
Kevin Chadwick
-
Leonidas Spyropoulos
-
Mantas Mikulėnas
-
rafael ff1
-
Scott Lawrence