This is the second try (original post: https://feddit.de/post/426890) of me trying to get an answer, this time I’ll be more specific of what I am thinking to do. I thought a more generalized question would be enough. Sorry for that.

A peertube server needs lots of storage. Many of the videos will hardly get any views. Storage space on a vps is pretty expensive, storage space in general isn’t cheap. So my thought was to

have a disk at home (maybe external disk on a raspberry pi) and a VPS.

The VPS only has a very limited amount of storage, but is otherwise totally able to run peertube well. So why not have a virtual file system on the VPS, which looks like it has the size of the HDD and it uses a specified amount of the vps storage for caching. So if someone watches a popular part of a popular video, the vps can serve the video content from the local disk. If someone wants to watch the video that nobody ever watches, it’s not a problem since the uplink from home can easily deliver that as well, without the video taking the precious storage. Block caching would be best, since file caching wouldn’t be ideal with video files being really big in some cases. So a very long video would fill the cache, even if only parts of it are needed.

The remote storage doesn’t need to be from home of course, could be cheap cloud storage. I know that peertube works with s3, but it will only move transcoded videos into a bucket and then serve them directly from there. I don’t want that from home, it would also not use the upload performance of the VPS for popular videos.

Any thoughts? Good idea or not?

I have worked with bcache in the past and was always very impressed with the performance, I think my scenario could really work.

  • sj_zero
    link
    fedilink
    12 years ago

    I used remote storage on my peertube by just mounting a location on the filesystem and pointing the data directory there. It worked ok, but the throughput was pretty low even on a LAN so I’d spend a lot of time buffering on videos at too high a bitrate.

    I think a thing to think about is what is a popular video on peertube? Yeah, there are some videos by big channels that get thousands of views, but most of the ones I see are maybe 100 views, usually single digit.

    Looking at how bcache is setup, my intuition is that you couldn’t use it to cache a remote filesystem since it looks like it works on the block device level and would need a bunch of stuff…

    I’m sort of surprised that nobody has created a transparent caching solution like that before. It seems like something straightforward, and an easy win for certain workloads.