iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🫠

Lessons Learned from a Failed Load Test on App Engine

に公開
2022/05/19

Conclusion

When performing load tests on App Engine, make sure to do so against the endpoint issued by App Engine.

Lessons Learned from Failure

The target App Engine has a configuration with Cloud Load Balancer and Cloud CDN placed in front of it.

The target endpoint was a non-caching endpoint, so I simply applied load to the Cloud CDN endpoint without thinking. Initially, there were no problems, but after the number of requests per second exceeded 10, the latency rapidly increased.

1 request/second

5 requests/second

10 requests/second

To isolate the problem, I also applied load to the IP address of the Cloud Load Balancer and the App Engine endpoint. The Cloud Load Balancer showed results similar to Cloud CDN, but the App Engine's latency did not increase. From this, I inferred that the Cloud Load Balancer was the bottleneck.

Looking at the Cloud Load Balancer documentation, I found the following description:

All Google Cloud proxy-based external load balancers automatically inherit DDoS protection from Google Front Ends (GFEs), which are part of Google's production infrastructure.

https://cloud.google.com/load-balancing/docs/load-balancing-overview

Here is a description of GFE:

Multitier and multilayer DoS defenses are deployed to significantly reduce the risk of DoS impact to services operating behind GFEs.

https://cloud.google.com/security/infrastructure/design?hl=ja#denial_of_service_dos_protection

In this case, since the load was applied from a single host, it is highly probable that at a certain point, the requests were judged to be illegitimate and throttled.

I then wondered if App Engine has such defensive capabilities and investigated. It seems the policy is either to configure it with App Engine's firewall or to place a Cloud Load Balancer in front, as in the configuration of this article.

https://cloud.google.com/appengine/docs/flexible/nodejs/creating-firewalls?hl=ja

It's very reassuring to be able to benefit from GFE's, that is, Google's infrastructure's defense mechanisms by using Cloud Load Balancer!

GitHubで編集を提案

Discussion