Waterfall Latency and Best Practices

MoPub has powerful tools to help you manage the waterfall for your ad inventory. Each item in your waterfall is a call to an ad source. If no ad is returned by the ad source, the next item in your waterfall is chosen. For each ad source, MoPub has to make a calls internally or to a partner to retrieve ads, which takes time and increases the duration between when the ad request is initiated and the ad response is returned. This duration is called latency.

This article provides some background on what causes higher waterfall latency and how to minimize it. As a rule of thumb, having more ad sources in your waterfall causes higher latency.

Latency Example 1

Types of Ad Sources

There are four types of waterfall ad sources that can have an effect on ad serving latency:

  • Direct-sold ads: These are ads that as the publisher sell directly to your advertiser via the “Orders” tab in app.mopub.com. They are served from MoPub’s ad serving infrastructure which has a latency of up to 100 ms per qualifying line item. A qualifying line item is a line item that’s targeted to the ad request.

  • MoPub Marketplace: The MoPub Marketplace lets MoPub fill your ad impressions by reaching out to demand-side platform partners (“DSPs”), and asking them in real time to bid on your impressions. The DSPs have a maximum timeout period of 200 ms to respond to the bid request, and there can be up to 100 ms in additional processing time, resulting in a total of up to 300 ms per MoPub Marketplace request.

  • MoPub S2S Partners: MoPub offers a special arrangement with certain ad networks and demand partners where they can be integrated via a server-to-server call (S2S). Server-to-server ad calls time out within 350 ms.

  • MoPub ad network SDK mediation: For certain ad networks like AdMob and iAd, MoPub lets developers drop in that ad network’s SDK. MoPub can then direct ad requests to that SDK via mediation. In the case of SDK mediation, the SDK in question controls the timeout and thus the maximum latency. To limit extreme cases, MoPub limits these SDKs to a maximum timeout of 10 seconds for banners and native ads, and 30 seconds for interstitials.

  • Custom JavaScript Networks: While JavaScript tags from Custom Networks are supported through the MoPub UI, MoPub cautions usage of this functionality, and does not provide technical support for issues arising from network’s tags. We recommending using no more than 2 tags max, as there are adverse downstream effects of using this method.

In addition to the ad serving latency above, there is the network latency that needs to be accounted for in the end-to-end calculation. MoPub’s ad serving infrastructure is located in the continental United States.

Latency Types Summary

This table summarizes the 5 different types of latency sources:

Type Timeout / Max. Latency Who sets timeout?
Direct-sold ads via MoPub 100 ms MoPub
MoPub Marketplace 200 ms MoPub
MoPub S2S Ad Network partner 350 ms MoPub
MoPub SDK Mediation SDK controls timeout.
In addition, MoPub SDK times out after:
10 secs – banners, native
30 secs – interstitials
SDK Partner
Custom Javascript Network Custom JavaScript Network controls timeout. Custom Javascript Network
Internet Latency Up to several seconds Internet provider, geographical distance to MoPub data center

Example

Let’s consider a concrete example in which a publisher has the following setup for an ad unit:

  • Direct-sold ads: The publisher has some direct-sold campaigns set up in app.mopub.com

  • Marketplace line item with CPM floor: The publisher has a marketplace line item with a $1 CPM floor.

  • S2S Partner Network: The publisher has an ad network partner that is integrated with MoPub via a server-to-server connection.

  • SDK Network: The publisher has an ad network integrated via SDK. The publisher inquired with the ad network and found that ad requests time out after 3 seconds or 3000 ms.

  • Marketplace line item with no CPM floor: As a fallback, the publisher has a marketplace line item with no CPM floor

Let’s calculate the overall maximum latency of this setup:

Line Item Maximum Latency
1. Direct-sold ads 100 ms
2. Marketplace line item with CPM floor 300 ms
3. S2S Partner 350 ms
4. SDK Network 3000 ms
5. Marketplace line item with no CPM floor 300 ms
+ Network latency (example using a US location on 3G) 300 ms
Overall latency 4350 ms

The worst case scenario for latency is that (1.) all line items take the maximum possible time, and (2.) none of the line items fill the ad impression. The result of “no ad” will be returned in 4350 ms.

Latency Example 2

The earlier in the waterfall the request fills, the better. For example, if the S2S network partner at priority level 2 always fills ad requests, that reduces the maximum latency of our example to just 500 ms.

Latency Example 3

Best Practices

MoPub recommends the following best practices for minimizing your waterfall latency:

  1. Minimize number of waterfall items: More waterfall items result in higher average and maximum latency. If you have a very complex waterfall, think about removing low-CPM and low-fill network partners, especially for SDK-integrated networks.

  2. Prefer S2S networks unless SDK implementation provides significant value: SDK networks define their own timeouts. As a fallback, the MoPub SDK will additionally timeout mediated SDKs after 10 seconds for banners and native, or 30 seconds for interstitials. S2S networks will only incur a latency of 350 ms, and significantly improve your user experience. Sometimes an SDK integration is worth the extra possible latency: For example, using a network SDK may help you get higher CPMs through better targeting. Weigh your options carefully when you decide which time of implementation you want to use.

  3. Keep items at the same priority: If you set up items at the same priority, then MoPub Marketplace, S2S networks, SDK networks, and direct-sold ads can compete with each other for the maximum CPM. We are obligated to show a network creative anytime we reach out to a network and it successfully returns a creative, so we have to wait until both Marketplace and your network partner have returned a result. Parallelizing requests by having items at the same priority improves your latency and CPMs.

  4. Manage banners and native ad unit waterfalls more aggressively than interstitials. Banners and native ad units appear on the screen shortly after setting up the view, while interstitials are often pre-loaded in the background, and shown at a later state. Thus, interstitials waterfalls can be more complex than the ones for banners without compromising the user experience.

Last updated October 01, 2018

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2018 MoPub Inc.