Skip to contentSkip to conversation

BTRFS on production: NVR 16+ IP Cameras

DISCUSSION Juan Alberto Cirez 6 participants 6 messages Nov 15, 2018 – Nov 17, 2018 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Is BTRFS mature enough to be deployed on a production system to underpin the storage layer of a 16+ ipcameras-based NVR (or VMS if you prefer)?

Based on our limited experience with BTRFS (1+ year) under the above scenario the answer seems to be no; but I wanted you ask the community at large for their experience before making a final decision to hold off on deploying BTRFS on production systems.

Let us be clear: We think BTRFS has great potential, and as it matures we will continue to watch its progress, so that at some future point we can return to using it.

The issue has been the myriad of problems we have encountered when deploying BTRFS as the storage fs for the NVR/VMS in cases were the camera count exceeds 10: Corrupted file systems, sudden read-only file system, re-balance kernel panics, broken partitions, etc.

One specific case saw the btrfs drive pool mounted under the /var partition so that upon installation the btrfs pool contained all files under /var; /lib/mysql as well as the video storage. Needless to say this was a catastrophe...

At the other end of the spectrum is a use case where ONLY the video storage was on the btrfs pool; but in that case, the btrfs pool became read-only suddenly and would not re-mount as rw despite all the recovery trick btrfs-tools could throw at it. This, of course prevented the NVR/VMS from recording any footage.

So, again, the question is: is BTRFS mature enough to be used in such use case and if so, what approach can be used to mitigate such issues.

Thank you all for your assistance

-Ryan-

Signature · 2 lines
Ryan Burt, B. Sc. for
Juan Alberto Cirez, CFPT
#1 lore raw
Quoted 8 lines · Juan Alberto Cirez

Is BTRFS mature enough to be deployed on a production system to underpin the storage layer of a 16+ ipcameras-based NVR (or VMS if you prefer)?

Based on our limited experience with BTRFS (1+ year) under the above scenario the answer seems to be no; but I wanted you ask the community at large for their experience before making a final decision to hold off on deploying BTRFS on production systems.

Quoted 8 lines

Let us be clear: We think BTRFS has great potential, and as it matures we will continue to watch its progress, so that at some future point we can return to using it.

The issue has been the myriad of problems we have encountered when deploying BTRFS as the storage fs for the NVR/VMS in cases were the camera count exceeds 10: Corrupted file systems, sudden read-only file system, re-balance kernel panics, broken partitions, etc.

What version of the file system, how many of those issues (if any) have you reported to the upstream mailing list? I don't remember seeing any reports from you.

Quoted 5 lines

One specific case saw the btrfs drive pool mounted under the /var partition so that upon installation the btrfs pool contained all files under /var; /lib/mysql as well as the video storage. Needless to say this was a catastrophe...

BTRFS is not suitable for random workloads, such as databases for example. In those cases it's recommended, at the very least, to disable COW on the database files. Note, disabling CoW doesn't preclude you from creating snapshots, it just means that not every 4k write (for example) will result in a CoW operation.

Quoted 6 lines

At the other end of the spectrum is a use case where ONLY the video storage was on the btrfs pool; but in that case, the btrfs pool became read-only suddenly and would not re-mount as rw despite all the recovery trick btrfs-tools could throw at it. This, of course prevented the NVR/VMS from recording any footage.

Again, you give absolutely no information about how you have configured the filesystem or versions of the software used.

Quoted 8 lines

So, again, the question is: is BTRFS mature enough to be used in such use case and if so, what approach can be used to mitigate such issues.

Thank you all for your assistance

-Ryan-

#3 lore raw
In reply to Juan Alberto Cirez
Quoted 2 lines · On Thu, 15 Nov 2018 11:39:58 -0700 Juan Alberto Cirez <[email protected]>…

Is BTRFS mature enough to be deployed on a production system to underpin the storage layer of a 16+ ipcameras-based NVR (or VMS if you prefer)?

What are you looking to gain from using Btrfs on an NVR system? It doesn't sound like any of its prime-time features -- such as snapshots, checksumming, compression or reflink copying -- are a must for a bulk video recording scenario.

And even if you don't need or use those features, you still pay the price for having them, Btrfs can be 2x to 10x slower than its simpler competitors:
https://www.phoronix.com/scan.php?page=article&item=linux418-nvme-raid&num=2

If you just meant to use its multi-device support instead of a separate RAID layer, IMO that can't be considered prime-time or depended upon in production (yes, not even RAID 1 or 10).

Signature · 2 lines
With respect,
Roman
#4 lore raw
In reply to Juan Alberto Cirez
Quoted 1 line · Juan Alberto Cirez

Is BTRFS mature enough to be deployed on a production system to underpin the storage layer of a 16+ ipcameras-based NVR (or VMS if you prefer)?

For NVR, I'd say no. BTRFS does pretty horribly with append-only workloads, even if they are WORM style. It also does a really bad job with most relational database systems that you would likely use for indexing.

If you can suggest your reasoning for wanting to use BTRFS though, I can probably point you at alternatives that would work more reliably for your use case.

#2 lore raw
In reply to Nikolay Borisov
Quoted 37 lines · Nikolay Borisov
Quoted 8 lines · Juan Alberto Cirez

Is BTRFS mature enough to be deployed on a production system to underpin the storage layer of a 16+ ipcameras-based NVR (or VMS if you prefer)?

Based on our limited experience with BTRFS (1+ year) under the above scenario the answer seems to be no; but I wanted you ask the community at large for their experience before making a final decision to hold off on deploying BTRFS on production systems.

Quoted 8 lines

Let us be clear: We think BTRFS has great potential, and as it matures we will continue to watch its progress, so that at some future point we can return to using it.

The issue has been the myriad of problems we have encountered when deploying BTRFS as the storage fs for the NVR/VMS in cases were the camera count exceeds 10: Corrupted file systems, sudden read-only file system, re-balance kernel panics, broken partitions, etc.

What version of the file system, how many of those issues (if any) have you reported to the upstream mailing list? I don't remember seeing any reports from you.

Quoted 5 lines

One specific case saw the btrfs drive pool mounted under the /var partition so that upon installation the btrfs pool contained all files under /var; /lib/mysql as well as the video storage. Needless to say this was a catastrophe...

BTRFS is not suitable for random workloads, such as databases for example. In those cases it's recommended, at the very least, to disable COW on the database files. Note, disabling CoW doesn't preclude you from creating snapshots, it just means that not every 4k write (for example) will result in a CoW operation.

Quoted 1 line
Quoted 12 lines
Quoted 5 lines

At the other end of the spectrum is a use case where ONLY the video storage was on the btrfs pool; but in that case, the btrfs pool became read-only suddenly and would not re-mount as rw despite all the recovery trick btrfs-tools could throw at it. This, of course prevented the NVR/VMS from recording any footage.

Again, you give absolutely no information about how you have configured the filesystem or versions of the software used.

Quoted 3 lines

So, again, the question is: is BTRFS mature enough to be used in such use case and if so, what approach can be used to mitigate such issues.

And..

What is the blocksize used by the application to write into btrfs? And what type of write IO? async, directio or fsync?

Thanks, Anand

Quoted 4 lines
Quoted 4 lines

Thank you all for your assistance

-Ryan-

#5 lore raw
In reply to Juan Alberto Cirez
Quoted 9 lines · Juan Alberto Cirez

Is BTRFS mature enough to be deployed on a production system to underpin the storage layer of a 16+ ipcameras-based NVR (or VMS if you prefer)?

Based on our limited experience with BTRFS (1+ year) under the above scenario the answer seems to be no; but I wanted you ask the community at large for their experience before making a final decision to hold off on deploying BTRFS on production systems.

Quoted 8 lines

Let us be clear: We think BTRFS has great potential, and as it matures we will continue to watch its progress, so that at some future point we can return to using it.

The issue has been the myriad of problems we have encountered when deploying BTRFS as the storage fs for the NVR/VMS in cases were the camera count exceeds 10: Corrupted file systems, sudden read-only file system, re-balance kernel panics, broken partitions, etc.

Performance problems are separate from reliability problems. No matter what, there shouldn't be corruptions or failures when your process is writing through the Btrfs kernel driver. Period. So you've either got significant hardware/firmware problems as the root cause, or your use case is exposing Btrfs bugs.

But you're burdened with providing sufficient details about the hardware and storage stack configuration including kernel, btrfs-progs versions and mkfs options and mount options being used. Without a way for a developer to reproduce your problem it's unlikely the source of the problem can be discovered and fixed.

Quoted 2 lines

So, again, the question is: is BTRFS mature enough to be used in such use case and if so, what approach can be used to mitigate such issues.

What format are the cameras writing out in? It matters if this is a continuous appending format, or if it's writing them out as individual JPEG files, one per frame, or whatever. What rate, what size, and any other concurrent operations, etc.

Signature · 1 line
Chris Murphy