I started testing serverless framework today and it is awesome, but i’m having a problem with AWS that I’d like to know if anyone is also experiencing.
After creating the basic project with hello world function I attached the http event to use API Gateway and for my surprise the response time is taking around ~550ms
I know there would be some latency since I’m in São Paulo making requests to us-east-1, but this is just way above my expectations
So, is just me or there are other people facing this problem? Is there any recommendations to improve performance on API Gateway?
We use runscope to monitor our endpoints. We see similar latency from the Brazil location. I’m not sure about methods of improving this other than developing a multi-region architecture. Would like to see if others have solutions.
I have similar issues from Sydney to us-east-1 and us-west-2. For example: I have a Rails app hosted in us-west-2 that responds in about 450ms but the Lambda function via the API GW is taking 750ms despite the Lambda function itself running in less than 50ms. us-east-1 was even worse at 950ms and you needed to double those times from a user perspective if it triggers a CORS pre-flight check.
In the end I’ve decided to no worry about it. I can find ways to keep the response times within acceptable limits and being able to easily scale wins.
Has anyone found a way around it? It seems Lambda + API Gateway only avoids this latency if your app is already so large that you’re doing 100 requests per second (per function).