[rhelv6-beta-list] My first experiences with RHEL6 beta

Bryan J. Smith b.j.smith at ieee.org
Tue Jun 15 20:43:02 UTC 2010


This is really simple, and will be my final response.  This has
sprawled into not just a meta-discussion about hypothetical cases,
but is based on 100% _poor_ practices in deploying LVM.

I can't even defend those.  ;)

> Let's say I have /var and /usr/local, with a swap file on
> /var.  Now I have /var running out of space but lots of free space
> in /usr/local; I can make a new swap file in /usr/local, add it,
> remove the swap file from /var, and free up space in /var.
> Essentially, I have moved free space from /usr/local to /var.

And back to the original context, what does this do to _performance_?

If you're moving swap files, to filesystems that might be very
defragmented (and you _know_ how /var is ;), what's the point, in the
original context?  Performance.

Furthermore, general volume management considerations here ...

If you're using a "raw" disk label, you're going to oversize /var.
If you're leveraging LVM, you can start smaller, increase as necessary,
on-the-fly.  It's these type of meta-discussions that are not only
theoretical, but not real systems.

Because if I'm using LVM, I'm far less likely to over-allocate/over-
reserve.  I'm going to keep spare space for snapshots, for growing,
etc...  If not, then volume management is out-the-window.  I cannot
help organizations that have practices that do not leverage the
technology.  ;)

> If instead I have /var, /usr/local, and swap, each as
> separate LVs, and I have /var running out of space but lots of free
> space in /usr/local, I have to shut down, shrink /usr/local (which can
> be a time-consuming operation), and shrink the LV (hope you do the
> math right!).  I can then boot up, add the PEs to the /var LV and
> resize /var.

Why didn't you keep some reserve PEs around in your volume group?
Why did you pre-allocate 100% of storage?

This is a greater issue of volume management, that is an issue with
"raw" disk labels, but not LVM.  Case in point ...

> Do you see how swap files can give you additional flexibility that you
> do not get with stand-alone swap partitions or LVs? 

Given a theoretical, hypothetical, utter disregard for best practices
of LVM, absolutely.  If I'm using LVM, allocating 100% and removing all
sorts of flexibility, then I'm guilty of painting myself into a corner.

The context of the original poster was for optimization.  My answers
were in this context.  I cannot help if every scenario, combined with
poor practices, could lead to a situation that results in issues.

And yet we revisit this reality again here ...

> You can even put multiple swap files in different filesystems with
> different priorities (obviously, never put multiple swap files OR
> partitions/LVs on the same disk at the same priority level though).
> Swap is a tough case; you often don't know how much to allocate in
> advance (especially on Linux where swap usage patterns change from
> time to time), you don't want to tie up too much of your disk
> with swap space that will never be used, but when you need it, you
> want to have all you need available and then some.

Which is a 100% moot and inapplicable argument to LVM.
And I'll re-quote ...

  "you often don't know how much to allocate in advance
   (especially on Linux where swap usage patterns change from
   time to time)"

With LVM, you can allocate as you wish.  In the case of swap,
you can swap on/off new and remove LVs as you want.  You don't
need to know, period, end-of-story.

And best of all ...

The PEs of _any_ swap LVs will be guaranteed to be contiguous.
This can very much not be the case if you're moving around "swap
files."  You're at the mercy of the filesystem.

And in conclusion, we reach the problem ...

> Again, I don't use swap files (although I have considered
> it), and I do make good use of LVM/DM.

Are you sure?  Or was all of this above "hypothetical"?
Especially the quote above.  If not, then why did you throw
out statements that you don't follow yourself?

This is what I meant by meta-discussions.  ;)

> I just don't claim that LVM/DM solves all problems

When did I do this?  Context is everything.  I invite you to
re-read my response.  ;)

> and swap LVs always beats swap files.

Ditto again.  Arguments for arguments' sake.  ;)




More information about the rhelv6-beta-list mailing list