nodetube icon indicating copy to clipboard operation
nodetube copied to clipboard

Add background job processor.

Open papodaca opened this issue 5 years ago • 5 comments

If the intent of this application is to be scaleable, it isn't ideal to process all the uploaded files in the main web server process. After a few (100-1000 not sure) simultaneous uploads performance may suffer handling other requests.

I've found a few options for achieving this easily:

To achieve this the code in this async block would be moved to a background job.

papodaca avatar Jan 03 '20 07:01 papodaca

The current approach I have to this, and let me know your take, is that the app is kind of partitioned into different sections. Check the top of .env.settings.sample, you can see :

LIVESTREAM_APP=false
FILE_HOST=false
FRONTEND=true

Basically you can run the app just as a file host which receives uploads, and the frontend is decoupled and can run as a standalone app.

Is that what you were getting at?

mayeaux avatar Jan 03 '20 07:01 mayeaux

This is something we should look at if we plan on scaling nodetube.live

dmdboi avatar Jan 05 '20 12:01 dmdboi

@mayeaux Not sure I follow 100% of what you are saying. Does this FILE_HOST/FRONTEND flag have to do with that http path certain processes are responding to? If that is the case at larger scales this may be insufficient. This isn't a feature I require or anything just an architecture suggestion that I thought might be helpful.

papodaca avatar Jan 07 '20 21:01 papodaca

@papodaca Yup, you can see it here: https://github.com/mayeaux/nodetube/blob/master/config/routes.js

So you can decouple the frontend from other functionality, I agree eventually a job queue will be needed for scale but it's at least something for now

mayeaux avatar Jan 09 '20 23:01 mayeaux

we are going to need this too for https://github.com/mayeaux/nodetube/pull/341 to resume quality convert

Yemeni avatar Sep 17 '20 01:09 Yemeni