linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Compress=lzo a good idea for Swapfiles on SSD?
@ 2011-03-26  3:47 John McCabe-Dansted
  2011-03-26 12:54 ` Chris Mason
  0 siblings, 1 reply; 2+ messages in thread
From: John McCabe-Dansted @ 2011-03-26  3:47 UTC (permalink / raw)
  To: linux-btrfs

I understand that modern SSDs can withstand a significant amount of
writes, and so using an SSD for swap seems like a reasonable
proposition. However minimising writes still seems like a good idea.
My experience with compcache/ramzswap suggests that swap compresses
quite well, I tend to get a 4:1 compression ratio. Furthermore, I
understand that we can work around the data corruption that usually
occurs when using a swapfile on a btrfs partion, by using a loopback
device. Given this, my question is:

Does it sound like a good idea to use compress=lzo for swapfiles to
reduce the amount of data written to the SSD, when using SSD drives
that do not use compression internally?

-- 
John C. McCabe-Dansted

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Compress=lzo a good idea for Swapfiles on SSD?
  2011-03-26  3:47 Compress=lzo a good idea for Swapfiles on SSD? John McCabe-Dansted
@ 2011-03-26 12:54 ` Chris Mason
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Mason @ 2011-03-26 12:54 UTC (permalink / raw)
  To: John McCabe-Dansted; +Cc: linux-btrfs

Excerpts from John McCabe-Dansted's message of 2011-03-25 23:47:02 -0400:
> I understand that modern SSDs can withstand a significant amount of
> writes, and so using an SSD for swap seems like a reasonable
> proposition. However minimising writes still seems like a good idea.
> My experience with compcache/ramzswap suggests that swap compresses
> quite well, I tend to get a 4:1 compression ratio. Furthermore, I
> understand that we can work around the data corruption that usually
> occurs when using a swapfile on a btrfs partion, by using a loopback
> device. Given this, my question is:
> 
> Does it sound like a good idea to use compress=lzo for swapfiles to
> reduce the amount of data written to the SSD, when using SSD drives
> that do not use compression internally?
> 

I would tend to say no, only because using compression leads to more
allocations required to actually write the blocks.  So you're swapping
because you need to free ram but you have to allocate ram in order to
swap.

There are projects for in kernel swapfile compression that have good
results though, so I'd have to study it in more detail.

-chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-26 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-26  3:47 Compress=lzo a good idea for Swapfiles on SSD? John McCabe-Dansted
2011-03-26 12:54 ` Chris Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).