LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   LVM performance costs v. benefits? (https://www.linuxquestions.org/questions/linux-server-73/lvm-performance-costs-v-benefits-927950/)

humbry 02-06-2012 03:39 PM

LVM performance costs v. benefits?
 
Hi,

I am installing a server on a KVM-virtualized cloud server.

I only have a handful of websites and things being hosted on it, and won't need too much out of my disks. I'll probably be using two drives, one for O/S and one for user data. I don't expect in the short term that I will need to change or re-size them once I make my initial decisions.

BUT, in the long term, there is a chance the server could get more heavy use and the storage needs could change. From what I understand, that's where LVM fits in, allowing for easy re-sizing and changes on the fly.

Right now my feeling is if it comes to that, I wouldn't mind installing LVM at that time instead of now (if I had to temporarily move my data and mounts at that time, add a third drive and put LVM on top, I don't think that'd be too much of a problem).

--- Main Question---

Am I correct to assume LVM incurs at least a small performance hit? Keep in mind, I'm already taking a disk performance hit by being in a virtualized environment (actually, I wonder, are my "drives" likely to already be LVM volumes, so I'd be doing LVM on LVM?).

I'm also considering that I may use the encryption option that my provider uses for my drives, so that may be yet another performance hit to add up, so you can see, if LVM is even a small hit, it might be good to avoid unless I really need it.

If my short-to-medium term projections that I won't need to do any dynamic resizing, is there any reason at all that I'd want to use LVM?

Does it offer me any other benefits? (I already get "snapshot" capability of my drives from my cloud provider, so that one's already taken care of)

Is fdisk and mkfs going to be sufficient for me?

rhbegin 02-06-2012 07:50 PM

LVM gives you the flexibility to manage the file system, I finally got an understanding of it after a Red Hat week long course a few years ago.

I am not sure of the performance hit if any, as you can adjust the extent sizes for better performance. I use the defaults as I use other mount options like 'noatime' and such to help control endless file accessing email/web servers.

In a SAN environment LVM would really need to be mandatory, since it would give you the file system flexibility and you can create larger volumes and use (thin-provisioning) to over subscribe your LUNs.

http://docs.redhat.com/docs/en-US/Re...ion/index.html

I would not worry about LVM on LVM as you are getting flexibility of your file system. I always use a separate /, /home, /tmp, /var and /opt (on email servers) and /swap. All within the LVM itself, it is easier to manage and make more sense longterm.

As far as fdisk I still use it, I had to expand the file systems on Oracle Unbreakable servers. I carved out the storage out of the fiber channel san, assigned it to the correct servers. Ran fdisk -l discovered the storage, formatted it, and expanded the physical volumes can't remember which ones it was.

There is another command called diskpart I have used it a little but mostly fdisk it is up to the end user.

catkin 02-06-2012 08:25 PM

I prefer cfdisk

humbry 02-07-2012 04:32 AM

Thanks very much for the replies.

@rhbegin I agree that LVM is versatile in more complex environments (sounds like your answer has that in mind). However, I'm only working with a server instance hosted at a cloud provider that, if it does grow, still won't grow into anything too complex. Again, I value your answer a lot, but I'm getting the feeling that LVM is more than I need in a simple environment.

(but YES! definitely noatime on the web and email mounts!)

rhbegin 02-07-2012 12:00 PM

The 'noatime' option is by far the best thing since sliced bread.

:)

rhbegin 02-07-2012 12:02 PM

Quote:

Originally Posted by catkin (Post 4595541)
I prefer cfdisk

What package includes this?

humbry 02-07-2012 03:41 PM

Actually, relatime is preferrable to noatime in most cases if your kernel supports it.

cfdisk in some systems is available as its own package, but is also included in util-linux

catkin 02-07-2012 09:11 PM

Quote:

Originally Posted by humbry (Post 4596402)
Actually, relatime is preferrable to noatime in most cases if your kernel supports it.

That's interesting. Can you post an explanation or reference?

humbry 02-07-2012 09:28 PM

IIRC, relatime updates the atime on files only if the current atime is older than the last mtime. This allows certain applications that rely on the atime attribute to still work yet still eliminates the same performance loss (unless something is constantly modifying your files).

I think a quick google should verify this. I think newer versions of Debian might even default to relatime on its mounts.

catkin 02-08-2012 01:04 AM

Thanks Humbry :)

There's good information about relatime vs. noatime here and more detail in the pages linked from that page. Nothing new and I don't use the softwares that need atime so I'll continue with noatime.


All times are GMT -5. The time now is 11:04 AM.