Session

Optimizing Serverless Applications: The Why and How?

Serverless applications are not new; they are simply applications running on a third-party fully managed resource on the cloud thereby allowing developers to focus completely on the business logic of an application without managing the servers where their code runs.

For this talk we will focus on AWS Lambda functions, which is a popular and very robust AWS service for building serverless applications. A very similar service on GCP are Cloud Functions. AWS Lambda is built to handle small or single tasks based on triggered events or an api call. The idea of a serverless application is to take the technical efforts (backups, uptime management and networking) required to run an application on a server, however it could have some unexpected or unwanted effects on the overall architecture of the application when the service (AWS Lambda) is not configured or managed properly in the cloud. Three major metrics to measure the efficiency of a serverless application are; Latency, Throughput and Cost.

From experience, these metrics can be drastically reduced to the nearest minimum thereby achieving a high level of efficiency when building serverless applications with AWS Lambda. I will be discussing few optimization techniques in this session, a few worth mentioning are:

1. Eliminate or reduce cold starts
Cold start is the boot time when a lambda function is initialized or needs to scale up. Cold starts can be expensive as they affect the cost of utilization and latency of the lambda function. This talk proposes to share few techniques explored from my experience with serverless applications are:
- Ahead of time code compilation (use binary or compiled files)
- Provision concurrency for resources required for your lambda
- Optimized dependency initialization (import only what you need)
- Abstract network connections or db connections
- Build with languages that handle concurrent request execution optimally with less memory allocations (NodeJS, Python and Go)

2 Memory and CPU Tuning
Memory in lambda is proportional to allocated cpu and this affects the cost of utilization because AWS bills lambda for the duration of the execution per time it is invoked. Deriving the most efficient (cost and execution time) memory allocation can be accurately achieved when with few analysis, in this talk I'll do a walkthrough on how AWS Lambda Power tuning can be helpful in this regard.

3. Proper Monitoring and Logging
This topic is mostly underrated but it is highly essential when building any application including serverless applications because it provides observability on what goes on during runtime and insight on what needs to be optimized. In this talk I will explain how AWS Cloudwatch and AWS X-ray are vital services for logging and monitoring in serverless applications.

Alayesanmi Femi

Lead Backend Engineer @ Mono

Ibadan, Nigeria

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top