Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Request throttling #135

Open
NickMoores opened this issue Nov 1, 2016 · 2 comments
Open

Request throttling #135

NickMoores opened this issue Nov 1, 2016 · 2 comments

Comments

@NickMoores
Copy link

Hey there,

Nice work!

Unless I've missed it, I couldn't see anything that attempts to throttle requests - is there any intention to implement anything simliar? We use FFMPEG behind a web service that generates thumbnails from MP4 videos, but we find that it doesn't take too many instances of FFMPEG running concurrently to quickly overwhelm a server's resources!

Thanks,
Nick

@flavioribeiro
Copy link
Member

Hey @NickMoores! So, @fsouza had a really great idea to detach the API from the core/ffmpeg itself. He was planning to add a queue on Mongo so we could have unlimited workers on different instances grabbing the jobs from the queue and running the actual encode job. @fsouza, do you have anything else to add?

@fsouza
Copy link
Collaborator

fsouza commented Nov 2, 2016

Yes, that would make scaling easier. That's how the workflow would work:

  • start job would drop a message in the queue
  • some idle worker gets the job and process it

It's possible to have as many workers as possible, or even don't have workers running at all, and some smart architecture that wakes workers up when there are jobs to be processed.

We could use MongoDB with monsterqueue (https://github.com/tsuru/monsterqueue), this way we wouldn't need another dependency. We can also make this extensible, in case users want to use some other technology for the queue (enabling serverless deployments with AWS's SQS + Lambda, for example).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants