how to speed up plexdrive + nginx with many concurrent users streaming mp4 videos
Hi all, since many people here use plexdrive and even more know how to use nginx I'm taking my issue here.
I got a Debian 10 VPS: 2x dedicated E5 cores, 12GB RAM, 50GB SSD, 1Gb/s
On that I run plexdrive that mounts my gdrive to a directory. This directory is then used as webroot for my nginx webserver so people can stream the files. All clients use chromium and sync their playback.
The issue starts when either >6 different files are accessed/streamed or >40 viewers access/stream a single file. The stream stutters for all users, if they refresh the browser the video won't buffer. Since the files have bitrates of <2500kbit/s and there is <100 peak viewers I have no worries about bandwith. Also I encoded the mp4s with +faststart flag to allow efficient streaming. I guess the issue is created by plexdrive serving each single user request from the nginx webserver in some inefficient way.
Ideally I would like to configure nginx cache, so it caches always a good bit ahead of the "chunks" that are currently being requested and serves all client requests out of the cache.
This is my current nginx and nginx-cache-proxy config that creates the issues I described above: https://pastebin.com/raw/zjXjePbY
Thank you for taking time to read into my issue! Hopefully someone has an idea or faced the same situation.
Edit: It may be important that I'm serving multiple copies of the same mp4 with different audio tracks, based on rewrite rules and the nginx GeoIP module (each language has a subdirectory of /var/www/html, filenames are the same) .