All You Need To Know About Swap Partition In Linux
|
|
|
Comments (11)
Ack. He wants to use and SSD for swap? Don't do that. SSD's have a limited number of writes cycles. Using them for swap is a wasteful use of those write cycles.
Why use swap at all when these days we have 4GB+ memory in even the smallest of computers?
<sarcasm> Only Firefox needs such large memory. </sarcasm>
<sarcasm> Only Firefox needs such large memory. </sarcasm>
Some things don't work properly without swap, even if you have 8GB or more RAM.
The truth it most of the time you don't need swap especially on modern machines. My computer has 16 gigabytes RAM. It never runs out of memory. I still have a swap partition because the computer also has a large hard drive so sparing a few gigabytes for swap isn't a big deal.
If your computer is continually swapping then you have an issue. You need more RAM or need to use less memory intensive programs.
If your computer is continually swapping then you have an issue. You need more RAM or need to use less memory intensive programs.
I have 16GB on my laptop. Overkill, but no worries.
i don't get the point about not using SSD for swap. nowadays you can get laptops and hosted servers that run on SSD only. given that, i find it hard to believe that SSD still have a limited number of write cycles that they can't handle swap.
greetings, eMBee
greetings, eMBee
> ...given that, i find it hard to believe that SSD still have a limited number of write cycles that they can't handle swap.
Oh, they can handle it fine, but it shortens their life. Here, you may find this article useful: https://itblog.sandisk.com/ssd-endurance-speeds-feeds-needs/
You may also want to check out this real world test: http://techreport.com/review/27909/the-ssd-endurance-experim...
You can use an SSD for swap, but why would you want to unless that's all you have?
Oh, they can handle it fine, but it shortens their life. Here, you may find this article useful: https://itblog.sandisk.com/ssd-endurance-speeds-feeds-needs/
You may also want to check out this real world test: http://techreport.com/review/27909/the-ssd-endurance-experim...
You can use an SSD for swap, but why would you want to unless that's all you have?
After spending more than $150 for my precious 500GB Samsung EVO, I am darn sure not wearing it out as a swap drive. The simple fix was adding 16GB memory to go with it.
thanks for the links.
the summary is that: SSDs live longer than harddrives to begin with and their write capacity is far higher than any consumer would need. thus, at least in my laptop i need not worry about the SSD dying earlier because of swap writes, because by the time the disk actually dies, i'll want to get a new laptop anyways.
workstations presumably are the same, except that it makes more sense to maybe keep the old disk even if you are replacing the machine, so you can actually benefit from the longer life of the SSD, and it starts to make sense to avoid unnecessary writes.
that leaves the servers. there of course we have more options with extra RAM that make swap space unnecessary.
in conclusion i see two use-cases for SSD: speed for servers, and for linus who needs to recompile the kernel continuously. and extra long life for precious data.
greetings, eMBee.
the summary is that: SSDs live longer than harddrives to begin with and their write capacity is far higher than any consumer would need. thus, at least in my laptop i need not worry about the SSD dying earlier because of swap writes, because by the time the disk actually dies, i'll want to get a new laptop anyways.
workstations presumably are the same, except that it makes more sense to maybe keep the old disk even if you are replacing the machine, so you can actually benefit from the longer life of the SSD, and it starts to make sense to avoid unnecessary writes.
that leaves the servers. there of course we have more options with extra RAM that make swap space unnecessary.
in conclusion i see two use-cases for SSD: speed for servers, and for linus who needs to recompile the kernel continuously. and extra long life for precious data.
greetings, eMBee.
> the summary is that: SSDs live longer than harddrives to begin with
On average, yes. I've had hard drives last 10 years of continuous use, so it's not a given.
> and their write capacity is far higher than any consumer would need.
The average consumer, yes, but again it's not a given.
> in my laptop i need not worry about the SSD dying earlier because of swap writes, because by the time the disk actually dies, i'll want to get a new laptop anyways.
You must not keep machines as long as I do. :) With Linux, I'd just turn off swap and be done with it. I've been running an SSD in my Mini-9 since I got it, and I've never used swap, And that was with 512M of memory, which I upgraded to 2G after a few years.
On average, yes. I've had hard drives last 10 years of continuous use, so it's not a given.
> and their write capacity is far higher than any consumer would need.
The average consumer, yes, but again it's not a given.
> in my laptop i need not worry about the SSD dying earlier because of swap writes, because by the time the disk actually dies, i'll want to get a new laptop anyways.
You must not keep machines as long as I do. :) With Linux, I'd just turn off swap and be done with it. I've been running an SSD in my Mini-9 since I got it, and I've never used swap, And that was with 512M of memory, which I upgraded to 2G after a few years.
Post a comment
A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.
Your message:Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help
Sign up and post (it is free) or Log in and post

Don't mean to dump on this guy, but when you hold yourself out as having technical knowledge and skill that you clearly don't have a harshly worded comment is warranted so others are not misled.