Severless Framework: Good or Bad?

October 21, 2019

For any readers who have wondered whether the Serverless Framework is a good option for them, blogger Einar Egilsson provides a case study in his post, “Serverless: 15% Slower and 8x More Expensive.” Egilsson explains exactly what he tried and why Serverless was less than helpful, for his purposes at CardGames.io anyway. He describes his original setup, how he approached the shift (using this tutorial), how he tested the performance, and, last but not least, the pricing involved. See the write-up for all those details. The post concludes:

“I’m sure there are cases where API Gateway and Lambda are better than Elastic Beanstalk. I guess our use case is just not one of them. Maybe if you’re using API Keys, rate limiting and other stuff API Gateway provides then it makes sense to pay 3.50$ for a million requests. For us it would have been better if we could just put a normal load balancer in front of Lambda. As far as I know that’s not possible, API Gateway is necessary for http access to Lambda. But even if we were just paying for Lambda, at 10$ a day we would be paying 300$ a month instead of 164$. We have a lot of requests, but each request does very little, it’s basically one database call per request. Maybe heavier requests that use more compute time would be better served with Lambda, where you pay per 100ms of compute time. Below is a report for one request, you can see we’re using 3.50ms of compute time and being billed for 100ms, which seems like a big waste. Finally, I’m not trying to bash API Gateway, Lambda or serverless in general here, just showing that for some workloads they are a lot more expensive than boring old EC2 and Elastic Beanstalk. So that’s what we’re sticking with.”

Since the original was posted, Egilsson has amended it. Apparently, he learned a lot from the comments about what he could have done better—like using an Application Load Balancer instead of the API Gateway and upgrading to a newer instance type, for example. The software is still not right for his site, he notes, but at least he can admit, with good humor, where he went wrong.

Cynthia Murrell, October 21, 2019

Comments

Got something to say?





  • Archives

  • Recent Posts

  • Meta