Interesting suggestion from a Tunapanda email thread:
Store video content by default in, say, /usr/local/tunapanda/videos/... (which is the SATA/USB storage, if present).
Then, have a cron script (there's probably a better way, but we can go with this for now) that parses nginx's logs to see which videos are being accessed most frequently.
Move the most frequently accessed videos to a directory in SD or NAND storage (I assume NAND will be the fastest, but space will be more limited)
Use nginx's try_files directive to use the fast-storage version if it exists, disk otherwise.
Possible arguments against this:
The need for this is based on assumptions about SATA performance. We don't actually know that SATA will be a bottleneck for streaming video performance, though it is very likely that SD/NAND will have better performance if it does.
Videos that haven't been moved to fast storage will result in a cache miss in SD/NAND before the server looks for them on disk. The assumption is that this will be offset by the performance savings from not having to go to disk for videos that are in SD/NAND.
Maybe spending a little extra on a high-capacity SD card and not bothering with SATA at all is worth not having to do caching?
Interesting suggestion from a Tunapanda email thread:
/usr/local/tunapanda/videos/...
(which is the SATA/USB storage, if present).Possible arguments against this: