Mastering the Milliseconds: How Latency Optimization Elevates Win-Rates in Ad Exchanges
Introduction
In the fast-paced world of digital advertising, milliseconds can make all the difference. Ad exchanges are platforms where publishers and advertisers come together to buy and sell ad inventory in real-time. The speed at which these transactions occur is crucial for both parties. For advertisers, a slow ad exchange can mean missed opportunities and lower ROI. For publishers, high latency can result in unsold inventory and lower revenues.
In this blog , we’ll explore how latency impacts the ad exchange process and what measures did the team at GumGum take in order to lower latency and improve win rates.
What is Latency in Ad Exchanges?
In the context of ad exchanges, latency refers to the delay between the moment a bid request received and the moment the bid response is sent. This delay is determined by various factors, such as server response times, network congestion, or ad selection algorithms.
What is Win-Rate?
Win-rate is the percentage of successful bids an advertiser makes out of the total number of bids submitted. A higher win-rate means that an advertiser is more successful in securing ad placements.
The Impact of High Latency on Win-Rate
Timeouts and Unsuccessful Bids
In an OpenRTB auction, advertisers have a limited time window to submit their bids. High latency can result in timeouts, where the advertiser’s bid doesn’t get processed in time. This directly impacts the win-rate as the bid is essentially disqualified from the auction.
Reduced Inventory Quality
Publishers are likely to prioritize ad exchanges that can quickly fill their inventory. High latency can result in lower-quality inventory being available to advertisers, thereby affecting the overall campaign performance.
Missed Opportunities
High latency can result in missed opportunities for advertisers. By the time a bid is processed, the user may have already navigated away from the page or slot, making the ad placement irrelevant.
Synchronization Issues
OpenRTB allows for synchronized bidding across multiple platforms. Latency can disrupt this synchronization, causing advertisers to miss out on valuable, high-impact ad placements that are part of a broader, coordinated campaign. This not only affects the win-rate but also the overall effectiveness of multi-platform advertising strategies.
Strategies for Reducing Latency
Now let us discuss the strategies we implemented for reducing latency. We created dashboards in Grafana using Prometheus to monitor the latency of each individual component.
Improving Caching
The constraints that shaped our filtering logic were previously combined in real-time for each eligible ad or deal. By shifting these combined constraints to a cache, which is updated only during system startup or when alterations are made to the ads or deals themselves, we effectively eliminated the necessity for real-time computations. This lowered filtering latency by ~20–30 ms
The latency involved in generating an ad response experienced a substantial reduction, ranging from approximately 20 to 60 milliseconds, depending on the specific implementation. This improvement was achieved by caching key macros that are integral to multiple scripts, thereby negating the need for redundant computations for each individual script.
Parallel Processing
Rather than processing each ad or deal through a sequential series of filters, we adopted a more efficient approach by initially partitioning the ads and subsequently executing them within a multi-threaded environment.
We strategically partitioned the ads/deals into buckets, each containing a roughly equal number of entities, to ensure a balanced distribution of the workload between the threads.
Optimizing Third-Party Service Calls
We refined our calls with an external traffic shaping service by transitioning to asynchronous calls, effectively mitigating any adverse impact on the ad-serving process.
We further streamlined the process by reducing the number of calls to the traffic shaping service, invoking them solely after the completion of all requisite filtering operations.
Impact
In the early stages of our optimization journey, we observed that our system was grappling with a 95th percentile latency of approximately 300 milliseconds. This figure represented the upper limit of our system’s response time, with 95% of our requests being processed within this timeframe, highlighting a critical area for enhancement.
Post-optimization, we have witnessed a noteworthy improvement in this key performance indicator. Our p95 latency has been successfully curtailed to around 210 milliseconds. This reduction signifies a more responsive and efficient system and clearly shows how effective our optimization strategies have been, setting the stage for more innovations and enhancements as we strive to excel in ad exchange services.
Through the implementation of these latency enhancements, we achieved more than just a reduction in infrastructure costs owing to the decreased load on our servers. We also observed a substantial improvement in our overall publisher win rate by approximately 6%.
Conclusion
Reducing latency in ad exchanges is not just a technical challenge but a business imperative. A faster ad exchange benefits all parties involved — publishers get their inventory filled quickly, and advertisers enjoy a higher win-rate. By focusing on latency reduction, ad exchanges can create a more efficient and profitable ecosystem for digital advertising.
Publishers are likely to prioritize ad exchanges that can quickly fill their inventory. High latency can result in lower-quality inventory being available to advertisers, thereby affecting the overall campaign performance.