Search code examples
google-cloud-platformgoogle-cloud-functionswebhooksgoogle-cloud-run

How many concurrent requests can a webhook in GCP handle?


I'm working on creating a webhook in GCP (using either Cloud Functions or Cloud Run) which would receive around 1200 requests on a particular day once in a month. And it is possible that most of these requests happen around the same time.

Would either of these services be able to handle 1200 requests around the same time?

  1. Cloud Functions

  2. Cloud Run

If not, what are the other alternatives? Please advise.


Solution

  • I am combining the comments from myself and @TheAddonDepot.

    Both Cloud Run and Cloud Functions auto-scale. Depending on the configuration, thousands of requests can be handled at the same time.

    The default setting for Cloud Run is 80 requests per instance. That can be adjusted based upon the resources requires to handle a single request. Then you can configure a minimum number of instances. Assuming 50 requests per instance, you only need 20 instances to handle 1,000 requests per second. Those numbers are approximations, but scaling to 10s of thousands is easily achieved.

    Autoscaling 2nd generation cloud functions (which leverage Cloud Run under the hood) allow you to configure the minimum number of instances and concurrent invocations (that helps you to minimize errors that stem from cold starts - but you will incur higher costs to maintain live instances and concurrency).