Using serverless

AnonymousTRIAL

2 years ago

Hi,
I would like to use Railway as a serverless.
It mewans that I am starting my service (FFmpeg in my case) for transcoding mission. When the transcoding is completed I would like the service to stop running.
The idea is, of course, to pay for Railway resources just for the time the service did the job

Thanks, Yehuda

8 Replies

2 years ago

Serverless isn't a thing on railway yet, but you could achieve something similar with cronjobs or app-sleeping


AnonymousTRIAL

2 years ago

Thanks Fragly.
I understand that the app-sleeping is getting the app to sleep after 10 minutes of non-traffic.
In case I need 20 sec of CPU 4 times in one hour, it looks not efficient.
Is there a shut-down command?


2 years ago

You might be able to programmatically close deployments via railway GraphQL, just a hunch, I'm not completely sure, https://docs.railway.app/reference/public-api
However if you know the delay between those 4 times an hour then I recommend using cronjobs


AnonymousTRIAL

2 years ago

Thanks Fragly.
I am completely new here.
Is there a guide that shows me the basic steps how to start from scratch, load a docker, run it, send it the commad line and get its output?


2 years ago

I think this might help: https://docs.railway.app/getting-started
Also railway automatically runs your code in a docker container so you don't have to worry about that, but if you need to have a custom docker container then you can provide a dockerfile along with your code


AnonymousTRIAL

2 years ago

Thank you


AnonymousTRIAL

2 years ago

Hi guys,
Additional question.
We would like to do video transcoding using FFmpeg app.
We are not satisfied with the current performance.
Is it possible to use GPU (graphical processor) for this purpose?


2 years ago

Unfortunately, I don't think Railway allows for GPU usage yet, I recommend you take a peak at this: https://docs.railway.app/maturity/use-cases#unsupported-use-cases


Using serverless - Railway Help Station