LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-25-2014, 09:18 PM   #1
IcoNyx
Member
 
Registered: Mar 2003
Location: Nevada
Distribution: Anything but Ubuntu... don't ask.
Posts: 145

Rep: Reputation: 15
Raid - Crypto - LVM... oh my!


So I _USED_ to have a really beefy computer... you know... 3 years ago... But recently I noticed a problem has cropped up that is driving me insane...

I used to have an areca 1220ix raid controller configured with two arrays. the "root" array (raid0 comprising 2 SSDs for performance) and then a "home" array (raid 5 comprising 3 750GB drives). On both arrays lived a pair of LUKS partitions with LVMs in them, the "home" crypto container had just the home partition, while the "root" container had / and swap.
in addition to these raid containers, I also had a /boot drive separate from the raid arrays.

When my raid controller died on me (I don't presently have the scratch to buy a new controller) I opted to build a software raid config with mdadm, then LVM my '/home' '/' and 'swap' partitions inside a pair of luks partition. The only layer I have added here is the linux raid partitions. I figured my system was still powerful enough to handle the added load... WOW was I wrong...

I have an external storage drive I use for backups and such. that drive is also encrypted (I know, I know...) when I do any data transfers from that drive, my system slows to an immediate crawl. conky appears to freeze so I cant really tell what is happening, but top indicates no process is going out of control... my processors (8 core proc) stay at low load, but everything I have up that is graphical in nature (gui) literally pauses (I like to listen to youtube and play minecraft while I play with my data )... I can move my mouse, and exit to console, but that's it. if I wait for the transfer to complete, my system returns to normal.

the best I can tell the loss of performance is having the system have to perform raid, LVM, and crypto simultaneously in this manner is simply robbing everything else of ram.

so I am sitting here thinking, I have 8 processor cores... and I really don't need that many at ANY point... also I have 16 gigs of ram...

So here's the question: is it possible to dedicate a core of my processor to the raid system, and a core to dm-crypt? is it possible to segregate a section of my ram off and give it exclusively to mdadm/dm-crypt? ...and prevent them from useing anything else)?
 
Old 06-26-2014, 08:56 AM   #2
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Rep: Reputation: 10
Look at iotop when the system freezes like that.
 
Old 06-26-2014, 11:05 PM   #3
IcoNyx
Member
 
Registered: Mar 2003
Location: Nevada
Distribution: Anything but Ubuntu... don't ask.
Posts: 145

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by notsure View Post
Look at iotop when the system freezes like that.
I will try this... if/when it gives me troubles again... suppriseingly, right now, it seems to be not freezing...
 
Old 06-28-2014, 01:47 AM   #4
IcoNyx
Member
 
Registered: Mar 2003
Location: Nevada
Distribution: Anything but Ubuntu... don't ask.
Posts: 145

Original Poster
Rep: Reputation: 15
Unhappy

Quote:
Originally Posted by notsure View Post
Look at iotop when the system freezes like that.
well isn't this just neat. iotop pauses when the system freezes up. when the system recovers, iotop "lurches" changing the entries rather violently, I cant catch what the offenders are... I still believe this is because of my choice to run LVM on crypto on soft-raid... if that is the correct line of thinking, my fix is to either fork out for a new hardware raid controller (been eyeballing the new areca 1883ix... prety...), or abandon either the crypto layer or the raid layer...

...unless anyone can tell me it's possible (and how) to "dedicate" a chunk of ram and a processor core to mdadm exclusively...
 
Old 06-28-2014, 08:19 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Seems to me you're reacting to symptoms, not the underlying problem(s).

Do some diag:
- is the external always involved when the slowdown/lockup occcurs ?.
- does it also occur if you only write to the external (ie, not a backup from the LVM/crpyt filesystem)
- does dmesg show any issues ?.
- run latencytop

Edit: no you can't dedicate processors/RAM to the software layers you have imposed on the system. They run in kernel space (even if kernel threads), and AFAIK you can't use (yet more) containers in cgroups to corral them. But I haven't tried ...

Last edited by syg00; 06-28-2014 at 08:22 AM.
 
Old 06-29-2014, 11:57 AM   #6
IcoNyx
Member
 
Registered: Mar 2003
Location: Nevada
Distribution: Anything but Ubuntu... don't ask.
Posts: 145

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
Seems to me you're reacting to symptoms, not the underlying problem(s).

Do some diag:
I have been diagnosing this issue since it began 6 months ago... I have reinstalled my OS, switched distros several times, even tried windows and BSD--erg and blarg...
While Windows does not exibit the symptoms, I'm fairly convinced this is because, though it is using fakeraid, I didn't have a satisfactory way to encrypt the drives. while I can encrypt the main OS partition (truecrypt), and I can encrypt my "/home" array and mount it as an additional drive in windows, that "/home" partition isn't really the home parition for windows... the "documents and settings" (or "user" for win 7 and up) folder is not easily moved to an seperate drive and I found I was working harder on picking through registry keys to move a stupid folder than troubleshooting my problem... so eff that.
All other distros exibited the same issues. this includes, Suse, Debian, LMDE, Mint, Fedora, Arch, PCBSD (NEVER again...), and red hat (enterprise... and yes, I have an entitlement, but I don't want to use it on this, they tend to throw up their hands and proclaim hardware failure for things like this).

Quote:
Originally Posted by syg00 View Post
- is the external always involved when the slowdown/lockup occcurs ?.
- does it also occur if you only write to the external (ie, not a backup from the LVM/crpyt filesystem)
no, it's just more obvious. the following are tasks I perform which will _usually_ generate a freeze:
> youtube playing (firefox) while transmission is open - this applies to any streaming service such as Hulu or vimeo. the freeze is momentary, but my system will freeze durring video caching consistantly, creating a kind of studder effect. IE: freeze for 30 seconds, system catches up. freeze again for another 30, catch up, etc.
> listening to music (clementine) while writing in libreoffice writer (usually have 3 or so windows of writer open) - I can keep typing all day, and the text I type will appear on page, however whenever the song changes in clementine, the systme pauses untill the next song is playing then the things I have typed will populate on the page.
> moving files to and from any of my myriad of drives (/, /home, /boot, /media, thumbdrives, external HDDs, etc.). - doesn't matter if I use thunnar or terminal to perform the task, doesn't matter what drive I'm transfering to or from, the system pauses on each and every file in the chain of files to be moved. the trouble is far more obvious on the one external drive, I believe, because both it and my /home partition are encrypted making the system deal with encryption twice.
> playing a DVD in VLC while killing some kerbals...
> listening to music while surfing the interwebz...
> playing minecraft while playing an .avi
> etc. etc. etc.
the pause is only obviuious if I try to do anything dynamic, like typing in a text document, or scrolling either on the web or in a file browser, or text doc, or anything that scrolls... or playing a game. additionally, the pause only occures when I have multiple things open, and ONLY if one of those things is reading/writing to one of the drives which are both encrypted and in RAID. for example, I can dd an image file from the encrypted external drive to a thumbdrive and I will not notice any lag/pause.
Quote:
Originally Posted by syg00 View Post
- does dmesg show any issues ?.
Sure as crap does! but none of them stand out for this issue...
> I have a faulty memory card reader, still works, kinda...
> I have a radeon 5785 running eyefinity (6 disp.) config on the radeon driver (I cant be bothered to load the firmware or the catalyst driver, besides this isn't a video issue)
> I have a realtek network card which spouts on about missing ucode and such...
> I have a gigabyte Motherboard which has WAY too much periferal hardware showing up in dmesg, none of which is faulty, just a lot of padding in DMESG...

If you'd like you can see my DMESG here (LINKY). but I'm prety sure there's nothing to see...

Quote:
Originally Posted by syg00 View Post
- run latencytop
latencytop is only vailable to me using an "unsupported" package (AUR, I'm using Arch at the moment)... I'd really like to avaiod yet another reinstall... I am using SSds for the OS partition... meh, regardless, I did manage to get some useful-ish info from iotop, when the pause occures I get a spike on one of the applications described above (firefox, transmission, or clementine, or one of their assiciated processes like firefox-flpl or clementine-gtk), the application which hits the top is only there for the briefest of moments and it is only after the pause has lifted. Still their appearance only pushes the notion this is an I/O issue related to too much hapening on the affected drives...

If you insist, I am willing to install and run latencytop, but I'm still prety sure my troubleshooting is sound... if not, let me know and I'll install/run it.

Quote:
Originally Posted by syg00 View Post
no you can't dedicate processors/RAM to the software layers you have imposed on the system. They run in kernel space (even if kernel threads), and AFAIK you can't use (yet more) containers in cgroups to corral them. But I haven't tried ...
dang! Oh well... I can get a raid controller, just wanted to be cheep.

TL;DR - I'm trying to make my PC do things it just cant do with the hardware I have in it... I need to get muhself a new raid controller.

EDIT:
there are a lot of spelling and punctuation errors in this post... I can't be bothered to install a proper spellchecker/dictionary for firefox and I'm too lazy to open up libreoffice. It's my day off... I'll sleep some more, then correct the typos later.

Last edited by IcoNyx; 06-29-2014 at 12:02 PM.
 
Old 06-29-2014, 01:20 PM   #7
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Rep: Reputation: 10
You're running a stripe array on your OS and a mirror for /root?

Have you tested each drive's performance individually? On the arrays? I'm guessing when you benchmark them the system freezes? There are a million ways to benchmark drives, how'd you go about doing it? I'm be curious to see the results from hdparm.

hdparm -t /dev/sd{a,b,c,d}
hdpart -t /dev/md{127,126}

Also, how did your Areca RAID card fail?

You're using ext4 for the filesystems?

I'm interested in anything RAID so forgive me if I ask too many questions.
 
Old 06-29-2014, 07:17 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Personallly I don't have an issue with AUR packages - easy enough to check the pkgbuild to satisfy yourself. And if you vote it up, it may get promoted and you won't have to worry in future ...
You need more pertinent performance data - iotop will give you an idea maybe, but something like collectl will give you good historical data you can analyse later. However if the problem is really "deep", anything running in userspace will only see the effects - but even that will be useful data if you see kernel threads listed as delayed for example.
There are tools that trace the various functions within the kernel itself, but none are user-friendly.
 
Old 06-30-2014, 02:11 PM   #9
IcoNyx
Member
 
Registered: Mar 2003
Location: Nevada
Distribution: Anything but Ubuntu... don't ask.
Posts: 145

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by notsure View Post
You're running a stripe array on your OS and a mirror for /root?
sda1 is /boot - nothing fancy there.
SDB, SDC are / - Raid 0 array (stripe). both drives are Sata3 SSDs
SDD, SDE, SDF are /home - Raid 5 array. these drives don't have to be super fast like the OS drives so they are just 7300 RPM sata 2 drives (750GB each for a total 1.5TB array)

Quote:
Originally Posted by notsure View Post
Have you tested each drive's performance individually? On the arrays? I'm guessing when you benchmark them the system freezes? There are a million ways to benchmark drives, how'd you go about doing it? I'm be curious to see the results from hdparm.
I just use hdparm, though I usually only test the /home drives as they are the ones with the appearant problem...

Quote:
Originally Posted by notsure View Post
hdparm -t /dev/sd{a,b,c,d}
hdpart -t /dev/md{127,126}
here's the results of # hdparm -t /dev/sd{b,c}
Code:
/dev/sdb:
 Timing buffered disk reads: 318 MB in  3.00 seconds = 105.88 MB/sec

/dev/sdc:
 Timing buffered disk reads: 732 MB in  3.00 seconds = 243.68 MB/sec
to be honest, I did not expect this diferance in performance at all... this shouldn't effect the /home partition... could it?
anyway, results of # hdparm -t /dev/sd{d,e,f}
Code:
/dev/sdd:
 Timing buffered disk reads: 354 MB in  3.03 seconds = 116.71 MB/sec

/dev/sde:
 Timing buffered disk reads: 376 MB in  3.01 seconds = 125.10 MB/sec

/dev/sdf:
 Timing buffered disk reads: 328 MB in  3.01 seconds = 108.96 MB/sec
and these numbers are about half what I was getting with my old areca... but then, the benchmark was on the array and not the individual drives.

Finally, the results of # hdparm -t /dev/md{127,126}
Code:
/dev/md127:
 Timing buffered disk reads: 574 MB in  3.02 seconds = 190.19 MB/sec

/dev/md126:
 Timing buffered disk reads: 352 MB in  3.01 seconds = 117.03 MB/sec
md127 is showing about on par with what I was getting with my old areca, and again md126 is definitely under performing compared with the numbers from my old areca.

Quote:
Originally Posted by notsure View Post
Also, how did your Areca RAID card fail?
The on-board memory overheated and put my arrays in bypass mode. without that added buffer, the arrays became unstable as fsck. I got tired of rebuilding the home array and forceing the root array online almost daily. that's why I will never get a 1#20 model EVAR again... depending on what model you get, some of their higher-end models have a DIMM slot with a replacable/upgradable ram stick... like the 1882ix

Quote:
Originally Posted by notsure View Post
You're using ext4 for the filesystems?
Yeah... I have no reason why... I have always used ext3... I just switched with no real reason, I know there are better performing file systems (btrfs for one) but I have had zero bit rot with ext over the years...

Quote:
Originally Posted by notsure View Post
I'm interested in anything RAID so forgive me if I ask too many questions.
Not at all!
 
Old 06-30-2014, 02:13 PM   #10
IcoNyx
Member
 
Registered: Mar 2003
Location: Nevada
Distribution: Anything but Ubuntu... don't ask.
Posts: 145

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
Personallly I don't have an issue with AUR packages - easy enough to check the pkgbuild to satisfy yourself. And if you vote it up, it may get promoted and you won't have to worry in future ...
It's not so much that the AUR has "bad" packages... I would think that my use of raid/LVM/Crypto in conjunction with an external encrypted drive would reveal my penchant for paranoia...

Quote:
Originally Posted by syg00 View Post
You need more pertinent performance data - iotop will give you an idea maybe, but something like collectl will give you good historical data you can analyse later. However if the problem is really "deep", anything running in userspace will only see the effects - but even that will be useful data if you see kernel threads listed as delayed for example.
There are tools that trace the various functions within the kernel itself, but none are user-friendly.
I'll look into it...
 
Old 06-30-2014, 08:26 PM   #11
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Rep: Reputation: 10
Does the system lock up when you copy files from md127 to the external?

The slow performance of sdb may be due to outdated firmware. smartctl -a
I don't think it has anything to do with your freezing problem. It seems to be affecting the performance of your stripe.

The slower performance of md126 could have to do with the chunk size you set for the array.

I'd like to see you log iotop to a file before you reproduce the problem. iotop -bo > /tmp/file
 
Old 07-06-2014, 03:26 AM   #12
IcoNyx
Member
 
Registered: Mar 2003
Location: Nevada
Distribution: Anything but Ubuntu... don't ask.
Posts: 145

Original Poster
Rep: Reputation: 15
FOUND IT!!!

my swappiness was 60... I have a 30 gig swap partition with 16 gig of ram... yeah...

reduced swappiness to 1 and problem solved. with that much ram, I can probably drop swappiness to zero... but, what the heck.

UPDATE:
Holy crap, I nearly forgot how snappy my PC is!!! I'm currently running an rsync of data from my external to my Home partition, listening to some tunes, re-installing steam (soon to be loading Kerbal), and playing minecraft... and no lag!

I missed this...

Last edited by IcoNyx; 07-06-2014 at 03:39 AM.
 
Old 07-06-2014, 04:34 AM   #13
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Nice find.

With 16 Gig you could even try getting rid of the swap altogether - maybe test with swapoff first.
Swappiness is just a recommendation indicator - nothing magic about 1 versus zero. I recommend (mainframe) enterprise users always use zero.

With modern desktop kernels, this shouldn't happen - something odd going on there.
 
  


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
[SOLVED] Configuring / Usage of RAID 0 & RAID 5 with PV / VG / LVM John King Linux - Server 9 08-17-2012 10:00 PM
Raid + LVM add new raid device to LVM, problem request Linux - Server 3 08-15-2012 04:06 AM
[SOLVED] How to migrate from raid 6 to raid 5 using mdadm and LVM haerta Linux - General 5 04-20-2012 06:16 PM
Dual drive failure in RAID 5 (also, RAID 1, and LVM) ABL Linux - Server 6 05-27-2009 08:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:39 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