0

I am considering migrating my current web services to Cloud Run. In Cloud Run's "Variables and Secrets", if we use Secret Manager to mount environment variables and credential files, how often will Secret Manager be read by which of the following?

  1. Whenever a web service is accessed.
  2. Every time an instance is created
  3. Whenever a revision is deployed
  4. other (I would appreciate it if you could tell me)

Currently, the web service is accessed by about 300 people per minute, and I expect that if 1 or 2 is selected, the number of accesses to the Secret Manager will increase and the billing amount will increase. If you have any best practices, I would appreciate it if you could share them with me.

Thank you in advance for your help.

1 Answers1

1

The answer depends on the code in your container. Typically each container would access Secret Manager on container start and hold those variables in the global namespace.

Using global variables

How many containers depend on how many simultaneous requests can be handled by each container.

How often a container is started and stopped depends on how frequently requests arrive. When a container is not processing requests it is eligible to be stopped. For your use case (300 requests per minute), consider the Always On option so that a minimum number of containers are always running.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
  • Thank you for the clear answer and the primary documentation. I will calculate the number of containers needed and use the Always On option so that the containers are always running. – Coichiro Aso May 30 '22 at 06:26