Skip to content

Cache

To speed up the broadcasting of VOD, you can use the SSD cache.

To configure caching, for original files from the cloud or HTTP server the cache option is used.

For your files on SSD drives, you can use intermediate SSD caching of video file segments. The option for this operation is called segment_cache.

File caching on SSD

You can ask Flussonic Media Server to save not chunks, but file content on disk, when the source is a cloud or a remote HTTP server (such as another Flussonic).

This mechanism can allow you to build a distributed CDN from several Flussonics because now even downloading will lead to caching a whole file.

Flussonic Media Server will not download the same content twice, so simultaneous access to a file is collapsed into a single upstream request.

Warning

For file cache, do not use SSD partitions that were mounted with the option noatime.

Here is the configuration for file cache:

vod vod_remote {
  storage s3://minioadmin:minioadmin@minio:9001/test;
  cache /storage/cache 400G;
  download;
}

Such configuration will download files on /mount/ssd on request: only requested data will be available locally.

Caching based on the number of requests

You can define a condition for placing files in cache - this condition is how often a file was requested by clients.

The option misses=3 tells Flussonic that if this file was requested more than 3 times, it must be cached:

vod vod_remote {
  storage s3://minioadmin:minioadmin@minio:9001/test;
  cache /storage/cache 400G misses=3;
  download;
}

Choosing cache options in the UI

To set cache options for file in the Flussonic UI:

  1. Proceed to the VODs and click on the file that you want to cache.
  2. Open the Input tab and edit the Cache section.

VOD cache

Segment cache for SSD

Today, one of the most popular ways to speed up serving content from a disk is using SSD storage.

Since solid state drives cost significantly higher than traditional HDDs, quite often it makes sense to use the setup that involves intermediate SSD caching.

Flussonic Media Server can automatically cache the requested chunks for HLS on a disk, which allows to speed up delivery considerably. Specify the following configuration:

vod vod1 {
    storage /mount/hdd1;
    storage /mount/hdd2;
    storage /mount/hdd3;
    segment_cache /mount/ssd1 20G 48h misses=2;
}

With this configuration, Flussonic Media Server maintains the cache size limit of 20GB, deletes files older than 2 days, and caches only the files requested more than twice. The option segment_cache is specified once only.

Warning

We do not recommend using traditional hard drives (HDDs) for segment_cache, use SSD instead.