简单来说,4xx的错误叫Client Error,可以理解为客户端到API-Gateway之间的错误;5xx的错误叫Server Error,可以理解为API-Gateway“背后”出现了问题。
换句话说,如果看到4xx的错误,查API-Gateway。看到5xx错误,把目光放到它的后面,比如Lambda。
4xx常见的有:
400 – Bad Request
403 – Access Denied。查查是不是被WAF给墙了。
429 – Quota exceeded。查查是不是被Throttle了。比如API Gateway设了Quota。
5xx常见的有:
502 – Bad Gateway Exception。看到这个,说明后边可能出现out-of-order invocations due to heavy loads。一般情况下,查查Lambda是不是报ConcurrentException了。
503 – Service unavailable。这个直接查后边吧,比如Lambda崩溃了之类的。
504 – Integration Failure。看看后边是不是Timeout了。包括API Gateway自己,因为它在29秒后就会直接回超时……
