A fairly common Linux storage question: Which is better for data striping, RAID-0 or LVM? Let's take a look at these two tools and see how they perform data striping tasks.
The previous section contrasted RAID-0 and LVM from a conceptual perspective, but the question of which one is faster still remains (even if the question isn’t a good one). This section will present a performance comparison of RAID-0 using mdadm and LVM. However, in the interest of time it doesn’t follow our good benchmarking guidelines (a full set of benchmarks would take over 160 hours). In this case IOzone is used as the benchmark.
IOzone is run in two ways: (1) Throughput, and (2) IOPS. Also, only the write, read, random write, and random read tests are run but a range of record sizes will be tested. Unlike tests from previous articles, each test was only run 1 time using ext4. The test system used a stock CentOS 5.3 distribution but with a 2.6.30 kernel (from kernel.org) and e3fsprogs was upgraded to the latest version as of the writing of this article, 1.41.9. The tests were run on the following system:
- GigaByte MAA78GM-US2H motherboard
- An AMD Phenom II X4 920 CPU
- 8GB of memory
- Linux 2.6.30 kernel
- The OS and boot drive are on an IBM DTLA-307020 (20GB drive at Ultra ATA/100)
- /home is on a Seagate ST1360827AS
- There are two drives for testing. They are Seagate ST3500641AS-RK with 16 MB cache each. These are
/dev/sdb
and /dev/sdc
.
Both drives, /dev/sdb and /dev/sdc, were used for all of the tests.
To help improve run times, 3 threads were used on the quad-core system. The fourth core was kept for the software RAID or LVM processing. So in the IOzone command lines the “-t 3″ option means that three threads were used. In addition, each thread had a size of 3GB, resulting in a total data size of 12GB. The important point is that the total amount of data is larger than memory (12GB > 8GB).
For the throughput tests, the following IOzone command line was used.
./iozone -Rb spreadsheet_ext4_write_and_read_1K_1.wks -i 0 -i 1 -i 2 -e -+n -r 1k -s 3G -t 3 > output_ext4_write_and_read_1K_1.txt
The command line is shown with a 1KB record size.
The IOPS tests used the following IOzone command line.
./iozone -Rb spreadsheet_ext4_write_and_read_1K_1.wks -i 0 -i 1 -i 2 -e -O -+n -r 1k -s 3G -t 3 > output_ext4_write_and_read_1K_1.txt
The RAID-0 array was constructed relying on defaults as shown in a previous article. The command used to construct the array was the following.
[root@test64 laytonjb]# mdadm --create --verbose /dev/md0 --level raid0 --raid-devices=2 /dev/sdb1 /dev/sdc1
The “chunk size”, or stripe width, defaults to 64KB.
To contrast RAID-0 and LVM they need to be constructed as similarly as possible. This is a bit more difficult in LVM since it is different than RAID. The basics of LVM were discussed in a previous article. After the physical volumes (PV’s) were created they were grouped into a single volume group.
[root@test64 laytonjb]# /usr/sbin/vgcreate primary_vg /dev/sdb1 /dev/sdc1
Volume group "primary_vg" successfully created
[root@test64 laytonjb]# /usr/sbin/vgdisplay
--- Volume group ---
VG Name primary_vg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 931.52 GB
PE Size 4.00 MB
Total PE 238468
Alloc PE / Size 0 / 0
Free PE / Size 238468 / 931.52 GB
VG UUID yjkNSQ-416l-f5Bt-RZLt-38NH-8LT6-QfrjeJ
The key to stripe mapping in LVM is how the logical volume is created. For this article the number of stripes (“-i” option) was arbitrarily chosen to be 2, and the stripe width (“-I” option) was chosen to be 64KB to match RAID-0. The total size of the LV was arbitrarily chosen to be 465GB. The command line for creating the LV was the following.
[root@test64 laytonjb]# /usr/sbin/lvcreate -i2 -I64 --size 465G -n test_stripe_volume primary_vg /dev/sdb1 /dev/sdc1
Logical volume "test_stripe_volume" created
[root@test64 laytonjb]# /usr/sbin/lvdisplay
--- Logical volume ---
LV Name /dev/primary_vg/test_stripe_volume
VG Name primary_vg
LV UUID igTRtk-wcqn-YVzR-HNQh-Ki2b-HznC-HcW589
LV Write Access read/write
LV Status available
# open 0
LV Size 465.00 GB
Current LE 119040
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 512
Block device 253:0
Then the file system is created using the logical volume test_stripe_volume.
[root@test64 laytonjb]# /sbin/mkfs -t ext4 /dev/primary_vg/test_stripe_volume
mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
30474240 inodes, 121896960 blocks
6094848 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3720 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
RAID-0 and LVM Test Results
The two tables below present the throughput and IOPS results for both RAID-0 and LVM. Table 1 contains the throughput results.
Table 1 – Throughput Tests
|
RAID-0 mdadm |
LVM |
Record Size |
Write (KB/s) |
Read (KB/s) |
Random Read (KB/s) |
Random Write (KB/s) |
Write (KB/s) |
Read (KB/s) |
Random Read (KB/s) |
Random Write (KB/s) |
1KB |
161,898 |
145,404 |
1,378 |
3,108 |
159,412 |
109,844 |
981 |
1,751 |
8KB |
186,725 |
151,225 |
5,150 |
7,976 |
183,352 |
155,871 |
4,429 |
7,233 |
32KB |
183,341 |
156,619 |
16,910 |
24,748 |
185,189 |
155,294 |
20,247 |
24,106 |
64KB |
182,698 |
173,024 |
33,319 |
44,386 |
188,842 |
150,967 |
30,142 |
40,277 |
128KB |
182,957 |
157,612 |
59,890 |
44,386 |
189,571 |
123,128 |
34,578 |
41,502 |
512KB |
189,282 |
157,612 |
134,966 |
98,189 |
184,341 |
147,475 |
87,534 |
92,821 |
1MB |
191,890 |
169,098 |
187,623 |
119,255 |
187,019 |
143,780 |
115,939 |
111,758 |
4MB |
186,289 |
157,202 |
194,943 |
137,252 |
182,579 |
137,214 |
143,452 |
136,715 |
8MB |
184,611 |
148,623 |
203,796 |
141,693 |
187,268 |
146,750 |
238,120 |
139,860 |
16MB |
186,541 |
149,814 |
223,136 |
144,753 |
187,935 |
121.341 |
199,823 |
139,860 |
Table 2 below contains the throughput results for both RAID-0 and LVM.
Table 2 – IOPS Tests
|
RAID-0 mdadm |
LVM |
Record Size |
Write (Ops/s) |
Read (Ops/s) |
Random Read (Ops/s) |
Random Write (Ops/s) |
Write (Ops/s) |
Read (Ops/s) |
Random Read (Ops/s) |
Random Write (Ops/s) |
1KB |
181,457 |
161,357 |
1,545 |
2,156 |
176,556 |
106,719 |
836 |
894 |
8KB |
23,591 |
19,087 |
622 |
1,034 |
23,753 |
13,135 |
450 |
1,086 |
32KB |
5,763 |
6,291 |
617 |
796 |
5,836 |
3,709 |
529 |
748 |
64KB |
2,943 |
2,756 |
611 |
673 |
2,748 |
2,873 |
510 |
524 |
128KB |
1,483 |
1,228 |
323 |
331 |
1,492 |
989 |
261 |
282 |
512KB |
363 |
388 |
206 |
185 |
359 |
235 |
166 |
180 |
1MB |
178 |
161 |
141 |
112 |
189 |
143 |
108 |
109 |
4MB |
46 |
42 |
45 |
34 |
45 |
31 |
33 |
33 |
8MB |
24 |
20 |
26 |
17 |
22 |
15 |
21 |
17 |
16MB |
11 |
12 |
15 |
9 |
11 |
8 |
10 |
9 |
Even though the results did not follow our good benchmarking habits, which really limits our ability to make any conclusions, it is interesting to do a quick comparison.
- For both RAID-0 and LVM, as the record size increases, write throughput performance increases slightly and read performance remains about the same. Both random read and random write performance increases fairly dramatically as the record size increases.
- For both RAID-0 and LVM, as the record size increases write IOPS and read IOPS decreases dramatically (this is logical since you have fewer records reducing the IOPS). The same is true for random read IOPS and random write IOPS.
- Finally, while it is almost impossible to justify comparing RAID-0 and LVM performance, human nature will push it us to do a comparison. It appears as though RAID-0 offers a bit better throughput performance than LVM, particularly at the very small record sizes. The same is true for IOPS.
Summary
A fairly common question people ask is whether it is better to use data striping with RAID-0 (mdadm) or LVM. But in reality the two are different concepts. RAID is all about performance and/or data reliability while LVM is about storage and file system management. Ideally you can combine the two concepts but that’s the subject of another article or two.
In the interest of trying to answer the orignal question of which one is better, a quick test was run with IOzone. We did not use our good benchmarking skills in the interest of time, but the test results give some feel for the performance of both approaches. The performance was actually fairly close except for small record sizes (1KB – 8KB) where RAID-0 was much better.
Comments on "Pick Your Pleasure: RAID-0 mdadm Striping or LVM Striping?"
If you’re involved of your coronary heart well being then,
yoou cann make the most of LIfeTrak C200 Core.
Here iis mmy web-site – Escorts in Southampton
you are actually a good webmaster. The web site loading velocity is amazing.
It sort of feels that you are doing any unique trick.
Furthermore, The contents are masterwork. you’ve done a great process in this matter!
Great information. Lucky me I found your website by chance (stumbleupon).
I have saved it for later!
Here is my homepage cialis online canada
Outstanding post however , I was wanting to
know if you could write a litte more on this topic? I’d be very thankful if you
could elaborate a little bit more. Thanks!
Hi there, just became alert to your blog through Google,
and found that it is truly informative. I’m gonna watch out for brussels.
I’ll appreciate if you continue this in future. A lot of
people will bbe benefited from your writing. Cheers!
My website dyson dc56
This design is incredible! You obviously know how to keep a reader
amused. Between your wit and your videos, I was
almost moved to start my own blog (well, almost…HaHa!) Great job.
I really loved what you had to say, and more than that, how you presented
it. Too cool!
Have a look at my blog post – dyson dc59
Fitbit CFO Bill Zerellaa told the Fool during a cellphone interview onn the day of the IPO that thee company will not
be worried about opponents.
Heere is my blog post :: Mitzi
Not like the Charge, the HR is armed with a heart
charge monitor and a different strap tha it is fitness monitoring twin.
Also visit my web page: plumber goes
This page definitely has all of the information I wanted concerning this subject and didn’t know who
to ask.
Set a purpose and watch your progress, get notifications whesn you couuld
hhave achieved targets, and receive encouragement to stay on track.
my web blog :: proposed plumbers
Usse the Loop with a cellphone app like Endomondo for GPS monitoring and
you’ve got every basee lined on activity tracking annd
analysis.
My blog plumbers in southampton
The top product is a weekly/month-to-month report that gives a personalized health
plan as well as nutritional objectives.
Feel free to visit my homepage – Janina
PharmaEurope.net sells real legit anabol?c st?roids.
?ll their stuff iis authentic and of very ?igh quality –
here you cann b?y testosterone, anadrol, trenbolone, human gro?th
hormone,cyt?mel, T3, and more without prescription
Get extra nutritional information, the best train packages, health motivation and a FREE book with
over 100 iideas for dropping belly fat here.
Also visit my web-site :: plumbers near me
The accuracy of collected data will be differ because the calculations are based mostly on generic values for age, height, weight and .
Also visit my page Robby
The Fitbit Drive leaps to the top of the health tracker heap, with
a vibrant screen, comfy fit, and a bevy off slick options.
Also visit my webpage :: Noelia
A garden mower is sort of essential if you want to hold your yard looking lush and exquisite.
Mowing the garden is actually an important process if you want to preserve
your garden trying enticing all via the year.
A good wanting garden is not going to only enhance the aesthetics
of your property, however it is going to also increase its’ resale worth.
There are principally two forms of mowers, namely; electric garden mowers and petrol lawn mowers.
Just give me a tten dollar pedometer from K Mart and a free heazlth app corresponding to My Fitness Pal or Endomondo.
my web site – Chelsea
Notably, the Jawbone UP24, Nike FuelBand SE, and Fitbit One will
sync commonly and routinely.
Here is my web page :: bands for hire
You can tap thhe face of it throughout the dayy to see your progrews , and it
serves as a atch as properly—albeit a moderately abstract one.
Also visit my homepage :: hire a band
You really make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand.
It seems too complicated and very broad for me. I’m looking forward for your next
post, I’ll try to get the hang of it!
Websites
Coordintion is the power to get your muscles and your sensees to work collectively easilly and effectively to accomplish a task.
Also viusit my site; plumbers near me
Zuma dance exercises for hwalth are enjoyable and ann
effective way to burn these calories.
My blog – occasions plumbing contractors
Does your website have a contact page? I’m having a tough time locating it but, I’d like to shoot you an e-mail.
I’ve got some creative ideas for your blog you might be interested in hearing.
Either way, great blog and I look forward to seeing it develop over time.
Clash Royale is the very first portrait-style game from
Supercell with super addicting gameplay and strategic
yet easy interface.
It aiuds your general health targets annd wewll being by exhibiting
your accurate weight, BMI, and physique fat
percentages.
My web page … plumbers in southampton
“Fantastic blog post.Much thanks again. Fantastic.”
Attractive section of content. I just stumbled
upon your web site and in accession capital to assert that I acquire
in fact enjoyed account your blog posts. Anyway I’ll be subscribing
to your feeds and even I achievement you access consistently rapidly.