LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   LVM vs No-LVM? (https://www.linuxquestions.org/questions/linux-server-73/lvm-vs-no-lvm-811853/)

klabacita 06-03-2010 12:43 AM

LVM vs No-LVM?
 
Hi people.

I would setup soon a mysql server+php+apache, this server will run inside a vm with xen.

Normally mysql run inside /var, this vm will have:

8GB RAM
64GB for this vm.

The host will have Raid-10 with md.

My question is, is better(disk speed) to setup this vm using the default layout lvm:
Code:

/
swap

Or LVM+ext4 with manual layout:
Code:

/
swap
var
usr
tmp

Or no LVM and manual setup ext4:
Code:

/
swap
var
usr
tmp

I meant disk speed, using this layouts do I have to receive better performance using one of this layouts, I know that I have to check my self, hw, etc, but my point is, which one is better for a DB server with a lot of writes and reads or doesn't matter if I use LVM or not LVM with manual or auto partitions.

Hope u could understand my point, thanks!!!

paulsm4 06-03-2010 01:48 AM

HI -

If you're running this thing in a VM, clearly a simple filesystem (eg. ext3 or ext4) should give you the better performance!

IMHO .. PSM

klabacita 06-03-2010 02:43 AM

Thanks paulsm4 for your quick answer.

Last thing, went u say:

Quote:

simple filesystem (eg. ext3 or ext4)
Do u meant that I better make a manual layout or auto layout?

Code:

/
 swap

or
Code:

/
swap
/var
/tmp
/usr

Thanks again

JD50 06-03-2010 08:33 AM

I would use logical volumes, personally. I've never heard of LVMs causing a noticeable drop in performance.

paulsm4 06-03-2010 10:22 AM

In the real world, with physical drives, sure.

In a VM, with an apparently I/O intensive application - no. I'd definitely recommend a simple filesystem.

JD50 06-03-2010 12:13 PM

Quote:

Originally Posted by paulsm4 (Post 3991374)
In the real world, with physical drives, sure.

In a VM, with an apparently I/O intensive application - no. I'd definitely recommend a simple filesystem.

What kind of performance hit have you seen using logical volumes inside of a virtual machine? I haven't worked on a lot of database servers so I could be wrong.

JD50 06-05-2010 10:25 PM

So this really made me curious. I ran bonnie++ in two virtual machines, one used logical volumes and one just used a filesystem and regular partitioning. Here's the results.

Virtual Machine using LVM

Code:

Version  1.03      ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
localhost.locald 2G 33702  54 43904  9 25366  10 43617  69 340213  93 +++++ +++
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
              1024 19801  30 64095  56  524  1 16236  25 76682  73  231  0

Virtual Machine not using LVM

Code:

Version  1.03      ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
localhost.locald 2G 41457  67 40447  9 16199  5 55152  87 338124  89 +++++ +++
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
              1024 24548  38 73572  66  495  1 15871  25 75818  76  213  0


The first section (top portion of each test) is what we're interested in when talking about database performance, and the import part of that section is the block read/write section. The VM using logical volumes seemed to actually perform a little better, surprisingly. The VM using logical volumes had a block write speed of 43.9/MBs while the VM not using logical volumes had a block write speed of 40.4/MBs. With regards to block reads, the VM using logical volumes had a block read speed of 340/MBs while the VM not using logical volumes had a block read speed of 338/MBs.

So it seems that the difference is negligible, but when you take into account the convenience of logical volumes I'd go that route. If anyone has any input and conflicting opinions or tests I'd love to see it.

catkin 06-06-2010 12:23 AM

Quote:

Originally Posted by JD50 (Post 3993897)
So this really made me curious. I ran bonnie++ in two virtual machines, one used logical volumes and one just used a filesystem and regular partitioning. Here's the results.

Thanks for sharing :)

Could the difference be explained by physical location on disk? Tracks located toward the outside of the platters would perform better than tracks nearer the centre.


All times are GMT -5. The time now is 02:26 PM.