Laravel - 429 Too Many Requests on 60th Request

Viewed 972

i have a problem. I have an app with aproximately 300 request per minute. I have been deploying my app on GCP with Google Cloud Run.

I have this configuration. Am i making a mistake? because I'm testing it using jmeter app. It could not handle more than 60 requests in lest than 1 minute. It always ended with 429 Too Many requests response. enter image description here

I tested my app using JMeter. And it always returning 429 Too Many Requests on 60th request.

2 Answers

After struggling out to what happend and have a long call with Google customer service, I found the 60th pattern no matter what changes we made on the resource. So, I did another investigation and found that the issue is on laravel.

It's quite hard to find it until I realize that Laravel has a default throtle 60:1, which means 60 requests per 1 minute. So, just need to change that and everything was fine.

Well, 429 means you have hit the container instance limit. Not sure why, as you have 50 connections per container (max). At 60 connections you should have 2 containers

Additionally, if you are in the google sandbox (i.e., free) there are additional limitations placed on your account.

Try the following:

Lower the min instances to 0. Let google automatically figure it out. Raise the max instances to 200.

Lower the max connections to 25 per container (or raise the ram/cpu to 2).

Let us know.

Related