You are not logged in.
Pages: 1
I know this has been discussed numbers of times but still I find it confusing. My new PC will have a SSD (and no traditional hard disk). My question is what to do with the swap and especially the swapiness parameter? Is it really a good idea to reduce it? How the default value of 60 has been decided?
What confuse me is that I have seen too many posts that say, roughly, that we need to avoid any write to the SSD in order to spare it; often to the point we can wonder if the SSD will remain useful... I have seen that SSD supports 100000 write cycles; with a 120GB SSD, you will thus need to write 12000 Tera (12 peta) before it fails. It is clear to me that small things (like putting /var outside the SSD somehow) makes no sense. Even the swap makes me dubious: is it really worthwhile to try to spare the SSD, will it not become obsolete well before it dies. Because the SSD is faster, it could actually make sense to swap on it on an optimal way? SSD supports fast reading of nonadjacent data, which seems a big plus for the swap.
Edited: It seems that this page http://ef.gy/statistics:ssd-write-endurance go in my sense. You will need more that six months to wear a SSD if you write to it at the maximum possible rate 24h/24h. If that is true, the SSD will never fail unless you do it on purpose. I have no estimate how much data we write on a hard disk on average but I think it is only a tiny fraction of that...
# mod edit: please don't rollback edits that make your thread title more relevant to the actual question you are asking. "SSD disk" means fsck all...
Last edited by jasonwryan (2013-08-20 07:04:07)
Offline
Typically multi-level-cell flash can handle between 3k to 5k writes per cell. What you are referring to with the 100,000 write cycles is the old single-level-cell flash that was what was used when SSDs first arrived on the market. You can still get SLC drives, but they are typically enterprise models, and even then, I have seen a recent shift towards using the more durable form of MLC called eMLC.
Even then, the wear levelling and garbage collection of today has vastly improved, and will likely ensure that any decent SSD will not require any kind of worrying about failure. I don't think you should be concerned whatsoever about putting /var or anything else on the SSD. If it were me, and I had a swap partition/file I would try to minimize writes to it, but not because I wanted to save the write cycles, but rather, I don't want my machine to swap unless absolutely necessary. But I have 8GB or RAM and I haven't had a swap partition for quite some time. In fact, I set up one of my whole disk as btrfs, so I don't even have the option of having a swap file (unless I put it through a loopback which apparently brings abysmal performance).
So basically, don't worry about it. Just use the disk as you normally would, and enjoy the vast increase in speed.
Offline
So basically, don't worry about it. Just use the disk as you normally would, and enjoy the vast increase in speed.
I second this. I have /var and swap on my SSD's in both my work and home machines. Don't stress about it, it's not worth the brain cycles these days.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
As an aside, a big thank you to Fukawi (I've trusted your advice for 5 years now!) and Wonderwoofy (began to trust yours pretty damn quick
)regarding current SSD technology. I had been wondering the same thing as the OP but I couldn't seem to find many answers to his (and my own) questions.
Last edited by MoonSwan (2013-08-20 21:33:05)
Offline
a big thank you to Fukawi (I've trusted your advice for 5 years now!)
And it still hasn't bitten you in the butt? I'd buy a lottery ticket, you have excellent luck ![]()
Thanks for the thanks though ![]()
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Unless you don't have enough RAM (8GB+), swap is barely used in my experience, so you don't really need to worry. A swap partition may be useful if you want to hibernate, even if it doesn't get used normally.
Offline
I think it is highly dependent on what you are using your machine for, but yes, I too see very little swap use with 8GB RAM. In my experience, hibernation on linux (suspend to disk) is far from perfect, and has always cased me more issues than the functionality was worth.
Recently though, I was able to set up Intel Rapid Start Technology, which is like hibernation controlled by the firmware. Typically you would use it by setting a timeout in the bios. So after being suspended for that set period of time, it would power back up partially and write the contents do disk, then "hibernate". But as of 3.11 Matthew Garrett created a userspace driver for it, so I can set it to only function in the event that my battery gets super low (at what point it decides that I'm not quite sure).
If your machien supports IRST, you should be aware that because it is firmware controlled, you cannot get away with "hibernating" on an Intel Rapid Start Technology partition that is less than the size of your RAM. It does not compress or try to opitimize the RAM contents for size at all. Also, it must be used on an SSD, so it is likely going to be taking valuable space on the faster disk. Interstingly, gehidore has the same machine as me, yet IRST works great for me, yet not at all for him.
Offline
Very litts swap use with 8GB ram? Yes, this is dependent on what you run on your system, but I can't imagine what you run in 8GB of ram that still needs swap. My arch systems range from 1-2GB ram, and none of them even have a swap partition or swap file - hibernating seems to the be only reason for swap to me.
Last edited by Trilby (2013-08-22 11:26:16)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Very litts swap use with 8GB ram? Yes, this is dependent on what you run on your system, but I can't imagine what you run in 8GB of ram that still needs swap. My arch systems range from 1-2GB ram, and none of them even have a swap partition or swap file - hibernating seems to the be only reason for swap to me.
I had a swap partition when I first got this computer. I saw things get swapped I think once when my browser was out of control and I was trying to compile something in RAM. But after a short while I simply removed the swap partition. I had a swap file for a moment, but then I switched to btrfs, where a swap file is said to cause corruption.
Offline
I have an SSD in my thinkpad with 8GB of ram. I don't have swap because I can't spare the space. When my system needs to swap, it compresses pages of RAM instead (https://aur.archlinux.org/packages/zramswap/).
Offline
Very litts swap use with 8GB ram? Yes, this is dependent on what you run on your system, but I can't imagine what you run in 8GB of ram that still needs swap. My arch systems range from 1-2GB ram, and none of them even have a swap partition or swap file - hibernating seems to the be only reason for swap to me.
I hit swap occasionally with 16gb RAM while Editing Video...
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
the very latest SSD's have come a very long way in no time hardly especially with TRIM you should get say 10 years
outta them the same as some HD's. I see a paradigm shift coming where generally standard issue will include SSD's
for operating systems and such and HD's for storage. As for Swap files I set my swappiness at 10 with 8gigs RAM and
am zippy. With an SSD I suppose RAM becomes less relevant as to Swap... dunno the speed stats for one verses the other....
end ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'the machine is not the end to the means., we are. In history, in board rooms and politic the greatest decision and effort
evolves from passion, lust for life, and a common sense of humanity. Never forget what you are and why'. -me
Offline
I'm with Trilby, I never make swap partitions anymore, and haven't for a long time. Once you have about 2GB of RAM you just don't need it unless you're doing things your computer isn't equipped for in the first place, like video encoding.
On the note of SSDs failing, I'm not worried about a lower lifetime. The amount of HDDs that die on me (I'm looking at you every Hitachi Deskstar I've ever owned) far before their time, your average SSD now looks as reliable as it gets. I'd rather a predictable lifeteime of about 10 years than an HDD that will maybe get 20 years or will maybe decide to throw a mechanical part in 4 years and get the classic "Click of Death".
Really, get an SSD and either don't make a swap file or don't make a swap partition. If you can afford the SSD stop stuffing around and buy enough RAM to go with it. If it's a laptop then hibernation isn't worth it anyway since an SSD will cut your boot time down enough to not warrant the extra speed of hibernating.
Last edited by MisterAnderson (2013-08-23 05:16:07)
D:
Offline
Ok, so i'm a little bit confused about how swap partition/file works together with vm.swappiness parameter. If i have no swap partition/file, then parameter vm.swappiness will not do anything, right ?
Offline
If you've got no swap file or swap partition, the swappiness setting won't do anything at all.
D:
Offline
There is nothing wrong with having swap on an SSD. Modern SSD's have very long lifetimes and don't require being "babied" to avoid writes like first-gen SSD's. Just use it normally.
Offline
Pages: 1