ramazon-web-servicesamazon-ecsaws-fargate

How can I reduce costs of ECS Fargate being used to run an R Shiny App


I am running an R Shiny App on Fargate ECS. It is roughly used once per week by the customer. It is running constantly and therefore we are paying for a substantial amount of idle time.

Is there a way it could be launched when there is an incoming connection and then stopped when this connection ends?

Does anyone have any suggestions for this?


Solution

  • You need a serverless style of application hosting, e.g. as suggested by a commentor with API Gateway backed by Lambda. If your request count is low, you may actually not pay much due to Free tier for these services. There is an R Runtime for Lambda here:

    [1] Serverless execution of R code on AWS Lambda - https://github.com/bakdata/aws-lambda-r-runtime