Opened 9 years ago

Closed 9 years ago

#10991 closed Bug Report - General (Feature request without patch)

RFE: make recording raid friendly

Reported by: dlbulk-mythtv@… Owned by: danielk
Priority: minor Milestone: unknown
Component: MythTV - Recording Version: 0.25-fixes
Severity: medium Keywords:
Cc: Ticket locked: no


When recordings are written raid devices, it is often reporting that write is too slow and eventually the recording stops after truncating the file.

Benchmarks on the raid device show that the throughput is far higher than mythtv reports.

According to iostat output, when mythtv is recording, there is also lots of read activity on all of the raid disks. It is happening even if there are no read requests on the md device itself. This implies that there is partial stripe writes happening. In this case, raid has to do a read in order to completes the partial stripe write.

Two factors can trigger partial stripe writes:

  1. write offset is not stripe aligned
  2. io size is not a multiple of a stripe

Although there is no direct control of raid layout at application layer, it helps if mythtv performs aligned writes only and uses an io size that's a multiple of a raid stripe. The alignment should also be a multiple of the raid stripe.

Yes, an underperforming disk can slow down writes. But partial stripe writes make it even slower :)

Change History (2)

comment:1 Changed 9 years ago by dlbulk-mythtv@…

observed io sizes used by recording:

Aug 11 07:45:02 ThreadedFileWriter.cpp:499 write(57528) cnt 31 total 1745392 -- took a long time, 1067 ms
Aug 11 07:45:19 ThreadedFileWriter.cpp:499 write(57716) cnt 57 total 3284548 -- took a long time, 1171 ms
Aug 11 07:45:32 ThreadedFileWriter.cpp:499 write(57528) cnt 42 total 2403768 -- took a long time, 1260 ms
Aug 11 07:47:19 ThreadedFileWriter.cpp:499 write(57528) cnt 42 total 2408656 -- took a long time, 1011 ms
Aug 11 07:59:31 ThreadedFileWriter.cpp:499 write(57904) cnt 38 total 2171212 -- took a long time, 1151 ms
Aug 11 08:04:40 ThreadedFileWriter.cpp:499 write(57528) cnt 109 total 6281456 -- took a long time, 1442 ms
Aug 11 08:04:40 ThreadedFileWriter.cpp:499 write(57528) cnt 54 total 3070228 -- took a long time, 1457 ms
Aug 11 08:04:52 ThreadedFileWriter.cpp:499 write(57528) cnt 73 total 4154800 -- took a long time, 1321 ms
Aug 11 08:06:28 ThreadedFileWriter.cpp:499 write(57528) cnt 43 total 2434600 -- took a long time, 1118 ms
Aug 11 08:16:21 ThreadedFileWriter.cpp:499 write(57528) cnt 31 total 1792580 -- took a long time, 1110 ms
Aug 11 08:16:22 ThreadedFileWriter.cpp:499 write(57528) cnt 58 total 3299400 -- took a long time, 1382 ms
Aug 11 08:21:30 ThreadedFileWriter.cpp:499 write(57528) cnt 77 total 4410668 -- took a long time, 1877 ms
Aug 11 08:36:44 ThreadedFileWriter.cpp:499 write(57716) cnt 44 total 2534804 -- took a long time, 1297 ms

(gdb) p/x 57528
$1 = 0xe0b8
(gdb) p/x 57716
$2 = 0xe174
(gdb) p/x 57904
$3 = 0xe230

comment:2 Changed 9 years ago by Raymond Wagner

Resolution: Feature request without patch
Status: newclosed
Note: See TracTickets for help on using tickets.