Smaato Achieves 61% Cost Savings on Compute for Real-Time Ad Bidding Using Amazon EC2 Spot Instances
Smaato’s Digital Advertising Technology Platform gives publishers the controls to deliver seamless, tailored, and engaging experiences for their audiences and advertisers. The company’s core auction platform processes more than a trillion advertising opportunities per month, with a peak throughput of roughly one million requests per second and round-trip latency of less than 80 ms per opportunity.
Smaato ran its workloads with on-premises servers before moving to Amazon Web Services (AWS) in 2009. The company initially operated on a blend of Amazon Elastic Compute Cloud (Amazon EC2) On-Demand Instances and Amazon EC2 Reserved Instances. However, as the number of ad opportunities Smaato received grew in the 2010s, so did the underlying compute and networking capacity required to run its platform. Smaato sought to reduce costs in 2016 by shifting more of its computing to run on Amazon EC2 Spot Instances, which enabled it to take advantage of unused compute capacity at up to a 90 percent discount compared to On-Demand Instances.
Smaato systems architect François Guerraz admits he was skeptical of moving from Amazon EC2 On-Demand Instances to Amazon EC2 Spot Instances for a service with high uptime requirements. “I was one of the detractors of going full-on Amazon EC2 Spot Instances,” says Guerraz about early discussions among his colleagues. “I guess you fear what you don’t know.” His experiences using Amazon EC2 Spot Instances eventually changed his mind.
One of the reasons we are committed to AWS is that we wouldn’t have anything like Amazon EC2 Spot Instances with any other provider."
Head of Programmatic Strategy, Smaato
Refactoring to Stateless Architecture and Managed Services
In 2017, Smaato engineers decided to move workloads to managed services and shift toward stateless architectures to optimize costs. “It started with simple things like making sure all our big workloads were stateless so that we could scale them in and out fairly easily,” says Ajitpal Pannu, CEO of Smaato. This move to stateless architecture meant the workloads could forgo tracking logs, which would free up time and compute capacity. Originally, Smaato used an Apache Kafka–based system to stream the logs but made the decision to migrate to Amazon Kinesis Data Streams, which made it easy to collect, process, and analyze real-time streaming data. Smaato saved 68 percent of costs on data streaming with the move to Amazon Kinesis Data Streams.
The move to stateless architecture also meant Smaato could experiment with moving more compute to Amazon EC2 Spot Instances. The company started out by using Amazon EC2 Reserved Instances and moving 10 percent of its clusters to Amazon EC2 Spot Instances. “It was conservative,” recalls Umair Malik, Smaato’s head of programmatic strategy. “I was afraid that around Christmas, for example, when we have very high incoming volume, we weren’t going to be able to serve our customers.” After further experimentation, Smaato was able to successfully run around 80 percent of its compute clusters for its core auction platform on Amazon EC2 Spot Instances with the remainder on Amazon EC2 Reserved Instances.
Achieving High Availability Using Amazon EC2 Spot Instances
Part of Smaato’s solution involves Elastic Load Balancing, which automatically distributes incoming traffic across multiple targets, including Amazon EC2 instances, containers, IP addresses, and Lambda functions. Smaato uses a Spot Fleet, which launches the appropriate number of Amazon EC2 Spot Instances and Amazon EC2 On-Demand Instances to meet the target capacity specified in a Spot Fleet request, to easily scale based on changing demand for compute capacity. “Compared to Amazon EC2 On-Demand Instances, Spot Fleet enables us to specify more than one instance family that is suitable to run our workload, which greatly reduces the risk of running out of capacity,” says Malik. “We ended up in a much better place using Amazon EC2 Spot Instances with Spot Fleet than we were in using just Amazon EC2 On-Demand Instances with Auto Scaling.”
Smaato maintains high availability on its bidding platform by running a baseline of Amazon EC2 Reserved Instances and using multiple AWS Availability Zones and Regions with its Spot Fleet. “We sometimes have thousands of instances running worldwide,” says Malik. “So when a particular instance type in one Availability Zone in one of our Regions disappears, usually the two or three other Availability Zones in that Region are able to cope with the traffic without scaling out. For example, we can easily serve around 80 percent of the population of South America from Northern Virginia.” The company uses combinations of Amazon EC2 M5 instances and Amazon EC2 C5 instances with Amazon EC2 Spot Instances for its auction platform.
The strategy enables Smaato to achieve 24/7 availability even during periods of peak throughput. Malik confirms this, noting, “In the past two Christmas seasons, we’ve been running with zero Amazon EC2 On-Demand Instances in the majority of Regions, and we have had no availability issues.” On New Year’s Eve 2019, Smaato peaked at 200 million requests in 5 minutes, requiring 154 instances in production.
A Cost-Effective Solution for Real-Time Bidding
By using stateless architecture and a combination of Amazon EC2 Spot Instances and Amazon EC2 Reserved Instances to handle its compute requirements, Smaato was able to reduce the cost of its real-time bidding platform worldwide. “Combined with the right architecture and optimal orchestration of Amazon EC2 Spot Instances, we cut our costs per incoming ad request by 61 percent,” says Malik.
With Amazon EC2 Spot Instances, Elastic Load Balancing, and optimization measures using Amazon SageMaker for its Automated Traffic Curation product, Smaato is better equipped to run its auction platform at a low cost and high availability even as throughput requirements reach millions of requests per second.
“One of the reasons we are committed to AWS is because we wouldn’t have anything like Amazon EC2 Spot Instances with any other provider,” says Malik. “When we look at our savings on AWS compared to what we would save with other providers, we find that others can’t compete.”
Smaato plans to move more workloads to Amazon Elastic Kubernetes Service (Amazon EKS), a managed Kubernetes service that makes it easy to run Kubernetes on AWS. Smaato is also exploring AWS Fargate, which removes the need to provision and manage servers and lets customers specify and pay for resources per application.
Learn more about AWS for Advertising and Marketing: aws.amazon.com/advertising-marketing.
About Smaato Inc.
Smaato’s digital advertising technology platform gives publishers the controls to deliver seamless, tailored, and engaging experiences for their audiences and advertisers. Founded in 2005, Smaato is headquartered in San Francisco and has additional offices in New York, Hamburg, Shanghai, and Singapore.
Benefits of AWS
- Achieved compute savings of 61%
- Saved 68% on data stream processing using Amazon Kinesis Data Streams
- Maintained availability during peak times without Amazon EC2 On-Demand Instances
AWS Services Used
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud.
Amazon EC2 Spot Instances
Amazon EC2 Spot Instances let you take advantage of unused EC2 capacity in the AWS Cloud.
Elastic Load Balancing
Elastic Load Balancing automatically distributes incoming application traffic across multiple targets, such as Amazon EC2 instances, containers, IP addresses, and Lambda functions.
Amazon Kinesis Data Streams
Amazon Kinesis Data Streams (KDS) is a massively scalable and durable real-time data streaming service.
Companies of all sizes across all industries are transforming their businesses every day using AWS. Contact our experts and start your own AWS Cloud journey today.