Serverless is a powerful paradigm that lets application developers focus on business logic rather than scalability or server maintenance. It is important, however, to understand the underlying serverless characteristics that can have a devastating impact on performance or budget, or both.

In this article, we summarize some real-life horror stories that illustrate the potential problems of serverless in production — and how to avoid them. For a more detailed description of these case studies, download our white paper.

An Expensive Mistake

When you pay per server instance, the cost is constant — no matter whether the server is overloaded or idle. If overloaded, it may crash but that won’t increase the bill.

Amazon Web Services’ Lambda functions, on the other hand, automatically scale to accommodate the workload. This is generally good for application resilience and sustaining sudden spikes, but it has to be monitored carefully, as we learned in Kevin Vandenborne’s article “Serverless: A lesson learned. The hard way.”

One morning, Kevin received an AWS notification about a detected infrastructure-cost overrun, from a budgeted $5.00 to a forecasted $83.28. By the time he logged into the AWS console, the actual balance was already at $206.14. A short investigation revealed a simple bug in his S3 bucket configuration that had created an infinite invocation loop and a larger than expected AWS bill.

This story teaches us the importance of carefully monitoring Lambda function workloads for unexpected traffic volumes that will drive up costs and make your cloud bill highly unpredictable. To this end, Thundra features active anomaly detection supported with insights modification to warn you when you have unexpected traffic.

Choose the Right Use Case

Serverless is brilliant when used for applications with varying workloads or unpredictable usage peaks, since serverless services scale up and down as needed, depending on the size of the workload. Thus, you spend more money to cover the peaks, but save money when the API is not being used.

#serverless #contributed #sponsored

Serverless Horror Stories
2.10 GEEK