Alex Williamson at the last Hacking Society meeting mentioned that he had seen poor performance from Device Mapper. I had noticed the previous week that performance on a system I had set up to do “badblocks” burnin of multiple drives using LVM was not running fast, but hadn't tracked it any further as to why.
LVM is a mechanism which allows you to create and resize partitions on the fly. Physical Volumes (PV) are added to Volume Groups (VG), and then Logical Volumes (LV) can be created using the physical blocks in the volume group.
In other words, you chop up hard discs into many smaller chunks (for example, 4MB) and those chunks are placed into the VG. You can then create and resize LVs which are made up of these chunks. Much like the md driver, you can use it to create a partition which spans multiple physical drives. However, you can also use it with the “ext2online” software to add space to a file-system without rebooting or re-partitioning your physical drives.
LVM can be very handy in some cases. For example, we are using it on our virtual dedicated system hosting for the root, swap, and configuration file-systems in each virtual machine. One of those systems has 40 partitions, for example, running on top of a RAID device for redundancy.
The problem, as Alex mentioned, is that performance, particularly for bulk in/out transfers is not the best. For example, on a test system I was running with, using “badblocks” to stress test the hard drives, I was seeing 10MB/sec using LVM to stripe across two drives.
For comparison, I also set up RAID-0 using the md driver on this system, and was seeing around 80MB/sec of throughput. Of course, this is just for bulk data transfers, I haven't run further tests on how it performs for more typical usage where you are seeking around to various places on the disc and doing read and write operations interleaved. I suspect the difference there is much smaller, but haven't had any time to do comparisons of it.
It's kind of sad, because LVM is a great way of managing discs. I've heard of some other LVMs for Linux, maybe one of them will become a clear leader. It'd be sad, because I'm really familiar with the semantics of the Device Mapper based LVM. That LVM is based on the semantics of the HP-UX LVM, which I was using a decade ago, so I haven't even had to read the man pages on it.
So, beware of Device Mapper. For the virtual system hosting we're using it most extensively for, it works very well, but there is some performance cost.comments powered by Disqus