I'm getting a SSD for my aging laptop (P8600, 4Gb ram), but having a hard time figuring out how much swap to allocate.
I know the 'default' recommendation for Linux is usually 2x Ram, but I have read all sort of 'tips' that say:
- don't use swap on a SSD, you want to minimize writes.
- amount of swap should be 1x size of ram if you plan to hibernate.
- some distros require swap to install, so just go with something small like 256MB.
What do you guys recommend?
While I have used hibernation in the past, its not a big deal if I don't use it. I do use suspend though.
I also plan to do some tweaks such as 'noatime', adjusting swappiness, and perhaps even turning logging off to save on writes.
Update here: http://forum.notebookreview.com/lin...ware/699790-linux-ssd-swap-2.html#post9229971
-
ALLurGroceries Vegan Vermin Super Moderator
I don't use any swap on my SSD systems, because they have enough RAM to do what I want them to do. If you need swap, I would suggest using a swapfile, not a swap partition, so that you can adjust its size as needed. You are paying for speed on an SSD so wasting any of it would be a shame.
At least in the debian installer it will warn you if you don't have a swap partition, but will let you continue anyway. -
A lot will depend on the tasks that you throw at that (unknown to us) laptop...
Since I don't allow myself to have more than one dedicated Linux box at the time, my recent experiences would say that you have plenty of RAM for "average" use.
My previous Linux box was a Panasonic CF-W7 with 3GB RAM, running Mint 12 on a Crucial C300 SSD. It was ridiculously fast for its limited specs, but I haven't thrown any *heavy* tasks at it.
The current Linux box is a customized ThinkPad T43 with 2GB RAM, running Mint Debian on a Crucial M4. Doesn't feel old at all, and it should...
All in all, a good SSD + Linux on an older machine is a winning combo.
My $0.02 only... -
If you are going with Ubuntu 12.X this article may also be of some help https://help.ubuntu.com/community/SwapFaq I am about to abandon win 7 on my asus and go this route & appreciate the concise answers in this thread.
-
Do NOT setup a Swap Partition on an SSD (with 4GB of RAM it would probably never be used), think about using ZRAM (running compressed swap in ram).
You can further reduce disk writes (& extend the life of your SSD) by making /tmp a symbolic link pointing to /var/tmp & add the following to /etc/fstab so that temporary files also exist only in ram:
Code:tmpfs /var/tmp tmpfs defaults,noatime,noexec,nodev,nosuid,mode=1777 0 0
-
there is an option to create a swap file on the SSD but I'm not as knowledgeable to know if that is good or bad.
I've had the luxury of having a SSD & a mechanical HDD (in the optical bay) to put swap on. Maybe that is something to consider if possible. -
6 weeks of this thread.
So little that has made any sense.
For anyone (me) using a SSD, my own take is to not use a swap partition.
Then try setting up your 1st choice Linux distro.
If that doesn't work (for sleep/hibernate), then move to installing your 2nd choice linux distro.
Etc. etc. until you find a distro that provides a workable sleep/hibernate mode with a swap file, and not with a swap partition. Meaning something like what Windows XP and 7 do with regard to S3 sleep, where computer's memory is kept active (during sleep) via A/C power.
That's my take so far (with zero Linux experience). -
-
As I understand it, for me a swap partition would need to be a minimum of ~ 17GB.
Since I'm only using SSD for storage (and no HDD), a 17GB partition, for only swap, looks like a very poor way to set up partitions for Linux use with expensive SSD space.
You did notice the terms "SSD" and "swap" in this thread title???
BTW does current Ubuntu 12.10 offer S4, or is that specific to Windows? -
-
I will say this about the concerns of writes on an SSD and SWAP. All consumer SSD made in the past couple of years have TRIM and garbage control which for the most part does negate most concern about write cycles, if your using SWAP extensively then it may pose a problem but it has to be far more then any common use even with extensive use of S4 usage. SSDs are built far better then they use to be and have overcome the problems that they have had in the past.
Personally i would use a SWAP file on an SSD just to save space. -
I have 4 GB of RAM and have 4 GB on my puny 36GB SSD. I hibernate often, but I close all applications before doing so.
At one time I had no swap space (and hence didn't hibernate) but I think 1x RAM is a good rule of thumb. -
If you get an SSD with a good controller, you really won't need to worry about writes on it. It'll far outlast it usefulness with normal write operations to it.
As for swap on an SSD, I recommend having a least a little available. 4GB of RAM is pretty tight, and you could easily full that up with a couple of tasks. My laptop is nearly the same as yours (T400, P8600 & 4GB RAM) and it isn't unusual for it to swap 100MB on occasion during compiles (on tmpfs) with web browsing and music playing. I use equal size swap to RAM, and use TuxOnIce for hibernating.
Don't forget you can always tune your vm.swappiness if you feel you're swapping too much.
If you do get an SSD, make sure when you format it that the filesystem's sectors are aligned to the drive. -
I realized I never really followed up with this thread, so for anyone interested, here are some links to check out concerning Linux on SSD:
Solid State Drives and Linux
Four Tweaks for Using Linux with Solid State Drives | Tombuntu
How to maximise SSD performance with Linux
https://wiki.archlinux.org/index.php/Maximizing_Performance#Swappiness
I just did a fresh install of Mint 15 and went with no swapfile and these tweaks from my first link:
-
I enabled trim and swapfile on a ext4 ssd partition. After a year, still going strong. 12gb ram and 12gb swapfile
Sent from my SGH-T889 using Tapatalk 2 -
Sent from my EVO using Tapatalk 2 -
^that's basically the long and the short of it. When you have more ram than you're using, the swap-file isn't really used all that much. You write down some of the marked files, if any, that always are cached. And some apps might specifically start to index resources. But most of the time you're just not using it.
Has been a lot of discussion about this, though. And the way cache-misses are typically used in Windows often has people insist, for somewhat good reason, that things will launch faster and index easier when a swap-file is there.
But since it's not 1998 any more, and an ssd access read starts to approach a memory read in certain usage scenarios, then.. there's just no point for a local system. ..Arguably, having swap on systems that don't cache from slow media (to a swap placed on faster media), is complete idiocy in the first place.
(And like I said, the way cache-misses is used to get program launch "boosts" on WinMo and Windows and so on is hairy as heck - if you don't already assume that the resources are all there, the program will fail, right - but the files are invalidated as cache misses if the actual file was actually updated.. ..sorry, ranting again..). -
ALLurGroceries Vegan Vermin Super Moderator
^ Windows Mobile? Good times.
-
You're so mean, Groceries
Linux on SSD, swap?
Discussion in 'Linux Compatibility and Software' started by Primes, Dec 10, 2012.