<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 27 December 2017 at 10:23, Jan Ceuleers <span dir="ltr"><<a href="mailto:jan.ceuleers@gmail.com" target="_blank">jan.ceuleers@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Top informs you about the possibility of CPU utilisation being the<br>
bottleneck. You established that it wasn't.<br></blockquote><div><br></div><div>OK</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">A more likely bottleneck when building a RAID is that I/O bandwidth is<br>
the bottleneck, and specifically the seek rate. Rebuilding a RAID<br>
normally involves sequential reads and writes, but if you do this while<br>
also accessing the file system the heads constantly have to move back<br>
and forth between the area being rebuilt and where the file(s) being<br>
accessed are located.<br></blockquote><div><br></div><div>I can't quite understand the second part. What files are being accessed? There is currently no activity on the raid array other than rebuilding the 5th drive, and as I said the recordings are going to a separate non-raid drive.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
It's too late for that now, but a better way to build an array is to<br>
assemble it, assuming it's clean (i.e. without a rebuild) and then<br>
create the filesystem on top of it. </blockquote><div><br></div><div>Following a tutorial at</div><div> <a href="https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu-16-04">https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu-16-04</a></div><div>I did </div><div>sudo mdadm --create /dev/md0 ...</div><div>sudo mkfs.ext4 -F /dev/md0 </div><div><br></div><div>...and by that time it was already rebuilding. Were you suggesting mdadm --assemble instead of --create?</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">The array is brought into sync when<br>
each of its blocks is first written, and areas of the array that haven't<br>
yet been written contain no useful data so it's unimportant that it's<br>
not in sync.<br>
<br>
You can slow rebuilding the array down to a crawl by running something<br>
like (as root):<br>
<br>
        echo 5000 > /proc/sys/dev/raid/speed_<wbr>limit_max<br>
<br>
This will limit the resync speed to 5MB/s and should give you an<br>
opportunity to assess whether the RAID resync is indeed affecting<br>
recordings. </blockquote><div><br></div><div>Thanks for this one.</div><div>I checked the preexisting value before overwriting it and it was 200000.</div><div>The expected completion time is now another 4-5 days. I'll let the box record something else and see if there are any glitches before restoring it to 200000.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Set it back to a large number in order to resume at full tilt.<br>
<br>
Another approach is to reduce the frequency with which the kernel writes<br>
your recordings to disk. In other words, to allow it to buffer writes<br>
for a much longer time. How to do that depends on too many things to go<br>
into here.<br>
<br>
Another thing to check though is whether the power supply in your box<br>
has enough oomph to power all your disks working hard at the same time.<br>
If not you should see signs of trouble in dmesg (i.e. read or write errors).<br></blockquote><div><br></div><div>None of that, fortunately---as I said in the original message I gave it a 700 W PSU.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="gmail-">> Does it seem plausible to anyone that building the raid could be the<br>
> cause for the video artifacts? The machine is a 4-core i5 with 8 GB RAM.<br>
<br>
</span>That's ample.<br></blockquote><div><br></div><div>That's what I also thought.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> Note that the faulty recordings were made to an independent HDD, not to<br>
> the raid that was being built.<br>
<br>
</span>How many parallel recordings to this single disk, </blockquote><div><br></div><div>I think 2 when the file with all those glitches was recorded.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">what is its type<br></blockquote><div><br></div><div>ST5000DM000</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
(rotation speed, </blockquote><div><br></div><div>5980 rpm</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">seek speed)</blockquote><div><br></div><div>unknown</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> and by which kind of interface is it<br>
connected to the host? </blockquote><div><br></div><div>it has a sata 3 interface but it's attached to a sata 2 port on the motherboard</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">How is this disk powered? </blockquote><div><br></div><div>with a sata power connector to the (obviously shared) 700 W PSU</div><div> </div><div><br></div><div>Thanks to both of you for all your help.</div></div></div></div>