moonfire-nvr/src
Scott Lamb b037c9bdd7 knob to reduce db commits (SSD write cycles)
This improves the practicality of having many streams (including the doubling
of streams by having main + sub streams for each camera). With these tuned
properly, extra streams don't cause any extra write cycles in normal or error
cases. Consider the worst case in which each RTSP session immediately sends a
single frame and then fails. Moonfire retries every second, so this would
formerly cause one commit per second per stream. (flush_if_sec=0 preserves
this behavior.) Now the commits can be arbitrarily infrequent by setting
higher values of flush_if_sec.

WARNING: this isn't production-ready! I hacked up dir.rs to make tests pass
and "moonfire-nvr run" work in the best-case scenario, but it doesn't handle
errors gracefully. I've been debating what to do when writing a recording
fails. I considered "abandoning" the recording then either reusing or skipping
its id. (in the latter case, marking the file as garbage if it can't be
unlinked immediately). I think now there's no point in abandoning a recording.
If I can't write to that file, there's no reason to believe another will work
better. It's better to retry that recording forever, and perhaps put the whole
directory into an error state that stops recording until those writes go
through. I'm planning to redesign dir.rs to make this happen.
2018-02-22 16:35:34 -08:00
..
cmds knob to reduce db commits (SSD write cycles) 2018-02-22 16:35:34 -08:00
testdata initial split of database to a separate crate 2018-02-20 23:15:39 -08:00
clock.rs knob to reduce db commits (SSD write cycles) 2018-02-22 16:35:34 -08:00
h264.rs initial split of database to a separate crate 2018-02-20 23:15:39 -08:00
json.rs knob to reduce db commits (SSD write cycles) 2018-02-22 16:35:34 -08:00
main.rs initial split of database to a separate crate 2018-02-20 23:15:39 -08:00
mp4.rs knob to reduce db commits (SSD write cycles) 2018-02-22 16:35:34 -08:00
slices.rs initial split of database to a separate crate 2018-02-20 23:15:39 -08:00
stream.rs replace homegrown Error with failure crate 2018-02-20 22:46:14 -08:00
streamer.rs knob to reduce db commits (SSD write cycles) 2018-02-22 16:35:34 -08:00
strutil.rs support segmented mp4s 2017-10-01 15:29:22 -07:00
web.rs initial split of database to a separate crate 2018-02-20 23:15:39 -08:00