UnicornTranscoder / UnicornLoadBalancer

MIT License
128 stars 16 forks source link

On Demand Spot Instance support #39

Open camjac251 opened 3 years ago

camjac251 commented 3 years ago

Is it possible to add on demand VM creation support for this project using various cloud providers? Hourly billing can be a lot cheaper than monthly rented servers and having the ability to spin up a VM and destroying it on completion of a transcode would make it much more affordable to use. A few cloud provider's offer this through their API if I'm not mistaken like AWS, DigitalOcean, Linode, Hetzner, and Scaleway. In my search to see if anyone else had made it before I could only find this but it sadly archived and might be discontinued https://github.com/BackInBash/Plex-Remote-Transcoder

davidjameshowell commented 3 years ago

What I think you will find some of the pitfalls derive around the actual required time to bootstrap and configure and instance to have it be quick enough to be considered "dynamic". This is why a scaling system would work better (and is totally possible, from a Plex session needs) as you'd have a set minimum fleet that would serve requests allow you time to up your fleet at that time.

zaldre commented 3 years ago

I've written scripts that do this, leverage something like Terraform to init the cloud providers with a blank machine, ansible to configure it and then i check http://loadbalancer:/api/sessions and http://transcoder:/api/stats to check session/cpu usage. Fairly straight forward in terms of approach but is a bit time consuming.

Other option is to use something like Kubernetes to do your scaling, this looks of interest but haven't played with it yet. (https://github.com/Unicorn-K8s/UnicornTrancoder-chart)