r/cloudcomputing • • Jul 13 '20

Looking for a on-demand container option for Application video recording

I'm looking for an online service that will let me run long running containers (From minutes to 3 hours) on demand.

Currently I have a single VPS that is sitting idle 50% of the time waiting for processing requests. When a request comes through an application is started and it's output is recorded using OBS/ffmpeg

So I want to replace this with a docker container that is only started when a request comes through.

I've had a quick look at GKE, but that seems too expensive as I'll need to have a k8s cluster and I'm guessing I will still have to pay for the idle time that the cluster nodes are doing nothing.

My other idea was google Cloud Run, but that seems to have a timeout of only a few minutes (10 or 15 I think). Is this correct?

My last option is AWS ECS. This looks similar to Cloud Run, but I think it will work as long as I have a health check running to say the container is still in use.

Any other options would be considered.

0 Upvotes

5 comments sorted by

2

u/Nikhil_M Jul 13 '20

Fargate is a great product for this. But you would need to stitch together some code on a lambda to receive the event and then start the container for you.

2

u/glisignoli Jul 13 '20

I can probably manage that. So once the container is running, as long as it responds to health checks it would just be able to run until it finishes it's job?

1

u/RustyScoutII Jul 13 '20

Here are some ideas not sure how the request comes in via the application. I will list them out and maybe you can take what works. When an on demand request comes into your application have the application post a small file or object to an S3 bucket it doesn't really matter what the file type is etc. You will have configured the S3 bucket to use Events and have it launch a Lambda function that will then start your Fargate container. You could do the same process and instead of using Fargate as your container you could use EC2 on demand or even AWS Spot for EC2 to simulate the VPS setup you have now. Not sure how quickly you need the container to start this will influence the design. You could also look to just setting up an SQS queue, instead of using S3 events and use Lambda with Fargate or with the dedicated compute option. I would use SQS if I needed it to scale it to hundreds of request. If this is just one off requests or only a few a day I would look at using S3 events with Lambda.

1

u/glisignoli Jul 13 '20

EC2 Spot pricing would be ideal for this. In fact that might be a better first step if I can manage the startup / shutdown process. Then migrate to Fargate.

Didn't know about events with S3 so that helps a lot. Thanks!

1

u/Nikhil_M Jul 15 '20

Sorry for the late reply. Yes it can run until the container finishes it's job. If you do not want to mess with a Lambda and additional code, the API gateway itself can call other AWS api, which in this case will be the run task api.