rendertron icon indicating copy to clipboard operation
rendertron copied to clipboard

Current app.yaml configuration creates high costs when deployed as is to GCP

Open webtalk16 opened this issue 3 years ago • 1 comments

Deploying rendertron after cloning the repo as is to GCP, works great, but also with almost no traffic yet I received a $150 monthly bill with the same projected for next month.

There should be a better explanation here on that and also at least present an optimized way to configure the app.yaml so that the app will work smoothly on but at minimal costs using minimal cloud resources.

Current app.yaml config in the repo:

runtime: nodejs12 instance_class: F4_1G automatic_scaling: min_instances: 1 env_variables: DISABLE_LEGACY_METADATA_SERVER_ENDPOINTS: "true"

It should be explained if there is a minimal instance_class that needs to be used for rendertron. Or, for example if setting a lower instance_class and max_instances instead of min_instances to 1 is also okay.

For example (would rendertron work smoothly with this config): instance_class: F1 automatic_scaling: max_instances: 1

Or alternatively, how it can be scaled down to 0 instances for max cost savings.

I don't expect you would give a cloud tutorial and all the options, but either change the app.yaml to start people off with incurring the lowest cost possible, or explain a little more why the current config is necessary, but best of all save developers a lot of time and headache by giving the 2 best options and explain they can scale from there depending on their needs.

In short, at least for people that can get rendertron to work but have limited experience with GCP, it would be great if you can maybe provide 2 examples of yaml configeration that both should work smoothly in a production environment. For example:

  1. with configuration that will incur the lowest cost possible from GCP but with the minimum needed for rendertron to still run smoothly.
  2. with configuration that will result in best performance possible for rendertron.

Stackoverflow question asked on this issue: https://stackoverflow.com/questions/67357098/how-to-deploy-a-simple-app-to-gcp-with-minimal-costs-or-how-to-disable-autoscal

-------- Update 1 -------- F1 instance class does not have enough memory for rendertron to handle even one request.

Deployed app.yaml with the following updates: instance_class: F1 automatic_scaling: max_instances: 1

The instance works and comes up okay but when navigating to myapp..../render/url..... I receive the following error (Viewing operations Logging on GCP): Exceeded hard memory limit of 256 MB with 268 MB after servicing 1 requests total. Consider setting a larger instance class in app.yaml Apparently F1 instance class is not enough to run the rendertron app. Please help with info on what the minimum instance class that can be used and still run smoothly? -------- Update 1 --------

webtalk16 avatar May 04 '21 09:05 webtalk16

This happened to me as well. I was researching some methods for better SEO of a react website, stumbled upon Rendertron. Tried it out and got myself a $180 CAD / $140 USD bill in under an hour in my development environment on a small website (I also followed Google Cloud's tutorial).

There should definitely be more prominent details on limiting usage / a warning of possible high costs if configured incorrectly. In my case I believe a call to Rendertron ending up calling Rendertron again causing a infinite loop. I removed the code very fast, but if I left it for any longer it would have made a massive bill.

augustmuir avatar Oct 02 '21 14:10 augustmuir

In general, as we're deprecating the project, you should look into alternative approaches to rendering on the web.

AVGP avatar Oct 06 '22 07:10 AVGP