LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-02-2010, 06:14 PM   #1
retch
LQ Newbie
 
Registered: May 2010
Posts: 2

Rep: Reputation: 0
Question LUKS on RAID or RAID on LUKS?


There seems to be a fair amount of discussion about the performance of LUKS, especially the kcryptd process as it appears to be single-threaded. My current setup is 3x2TB drives in a soft RAID5 (md), which has a LUKS volume ontop. When writing, I get around 40MB/s which could be better given a 3GHz quad CPU.

The low performance could be related to the fact only 1 kcryptd runs per device (this device being /dev/md1). My question is; would it be better to have a seperate LUKS volume per HDD, and them forming a RAID5 from these? This should spawn a kcrypt process per physical device (3) instead of just 1.

Has anyone tried this setup and does it make any difference on read/write performance?
 
Old 05-03-2010, 11:11 AM   #2
raymor
Member
 
Registered: Nov 2005
Posts: 59

Rep: Reputation: 20
40MB/s writing to RAID 5 is pretty good, especially with only three spindles.
I don't think your CPU has anything to do with it. Remember a "write" on
RAID 5 requires a two reads, a calculation, and two writes. Assuming a
16K block size, each 16K requires 4 disk operations, or one operation
per 4K. At 40 MB/s, you're getting 1000 IOPs.

Let us know when you benchmark it the other way, but I think
you'll see precious little difference - CPUs are WAY faster
than drives, so no matter what you do with the CPU the
drives are still only going to write the data at a certain
speed.

As to which is BETTER, I'd decide that by not based on
performance, but on logical design. To me, the RAID is at
the physical level - that data just happens to be on those
drives, but it could just as easily be anywhere else.
Which data should be encrypted is a _logical_ choice rather
than a _physical_ one. Logical sits on top of physical, so
encryption on top of RAID.

Last edited by raymor; 05-03-2010 at 11:18 AM.
 
1 members found this post helpful.
Old 05-04-2010, 01:56 PM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Agree.

& if you add LVM into the mix, the same logic says it goes between the 2.
 
Old 05-05-2010, 01:57 PM   #4
retch
LQ Newbie
 
Registered: May 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the replies. Personally I don't see why the encryption layer cannot go on the lowest level, pending some testing. I set this up using 3 loopback devices and it worked OK, however it was on the same phyiscal hard disks so performance couldn't be tested. Another plus point I can see is resizing RAID arrays should be easier if the encryption was the lowest level as you only have to resize the RAID array. Otherwise you have to resize the RAID array first, then the LUKS "container".

When I initially configured this array it was unecrypted and the performance was quite a bit higher that when it is encrypted (I can't remember the actual numbers). Maybe extra kcryptd processes will help? I have a bunch of old drives laying about and will test the performance difference and post back. I'm not expecting much difference but it's worth a test

raymor, going by your information, would you expect read/write rates to increase with the number of physical disks? I could test this too..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LUKS + RAID + LVM2 and suspend to ram vehn Slackware 3 12-14-2011 07:54 AM
Encrypted root with LUKS on LVM and RAID-1: How? gargamel SUSE / openSUSE 5 03-20-2010 04:30 PM
Slackware 12.2 + RAID-1 + LVM + LUKS encrypted root gargamel Slackware 35 12-17-2009 11:25 AM
LUKS on 2TB RAID 5 wsduvall Linux - Server 12 03-26-2009 01:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration