Reputation: 3842
I deployed two APIs to Google Cloud RUN. I used Dockerfiles to build the images directly on the Cloud Infrastructure. It took me quite a lot of tries to deploy the APIs. After the deployment I barely used them. I used this two commands to build and deploy the images
gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/${SAMPLE}
gcloud beta run deploy ${SAMPLE} \
--set-env-vars GOOGLE_CLOUD_PROJECT=${GOOGLE_CLOUD_PROJECT} \
--image gcr.io/${GOOGLE_CLOUD_PROJECT}/${SAMPLE} --timeout=30m --cpu 4 --memory 4Gi --concurrency 1 --execution-environment gen2
What did this command exactly do? The image is built on my computer and then uploaded to the google cloud infrastructure? I am asking this questing because I was surprised that I in the billing I have to pay 24€. Is that the deployment cost? Or because of the few times I used the APIs? Any idea?
Upvotes: 1
Views: 319
Reputation: 159
Looking at the command, it looks like your cloud run instance has the following settings.
--cpu 4 --memory 4Gi --concurrency 1
These settings mean that each CR Container will have 4Gi of memory, 4 CPUs, and will spin up 1 container per request. Because the concurrency is set to 1, each container spin up will also have a "cold-start" cost to it.
Just from eye-balling these settings, if you have alot of request going to this cloud run service, I wouldn't be surprised that it has costed this much, if not more.
Here is the GCP pricing calculator. Input the data needed and see how much you could save by lowering resources on the service.
https://cloud.google.com/products/calculator#id=
Upvotes: 1