Annoyances with Apple’s CDN

CDNs are complex things. A number of factors come together to deliver content in the most effective way, to the end user; but there’s loads of things that can do wrong when it’s not correctly implemented or understood.

If you’ve ever used Apple Music and Spotify, you’ll know very well that Apple has serious performance issues with media playback in comparison to Spotify, and there are good reasons for why.

 Delivery Method

Spotify provides a data-stream of usable content from the get go. By providing a stream, playable media exists immediately and mitigates any lag on playback. Only in extreme circumstances would this process be delayed.
Spotify partial beginning the stream immediately

Apple provides a single m4p file which means that the client (iTunes in this case) needs to wait for enough content to exist before it can play it.

Additionally, these files are usually prepended with meta-data such as album, track and artist information which can bloat the file and increase the delay in initial playback.

This is why Apple Music is slower to start than Spotify.

Apple Music single file download

 DNS, a CDN & how those two affecteachother

DNS is fairly critical to operating some CDNs—it can also be their downfall.

A common issue with some DNS providers is that they don’t properly forward the client’s subnet. Google openly admits this is an issue with their public DNS service.

Note, however, that because nameservers geolocate according to the resolver’s IP address rather than the user’s, Google Public DNS has the same limitations as other open DNS services: that is, the server to which a user is referred might be farther away than one to which a local DNS provider would have referred. This could cause a slower browsing experience for certain sites

Take a look at the test cases below; you’ll note that Apple’s CDN (Apple seems to be using Akamai DNS, but their own servers for content delivery) is serving content mostly from US regions. In Austrlia, this is problematic, especially when it takes the server 400+ milliseconds to respond to a request.

The following IPs were the only I could find serving content for Apple Music:

17.253.15.205   New York City
17.253.15.207   New York City
17.253.15.202   New York City
17.253.15.204   New York City
17.253.7.201    New York City
17.253.7.203    New York City
8.254.207.30    Los Angeles
8.254.230.62    Los Angeles
8.253.44.174    Los Angeles
17.253.57.205   Dulles
17.253.57.207   Dulles
17.253.57.202   Dulles
17.253.57.204   Dulles
17.253.35.203   London
17.253.35.201   London
17.253.3.201    Dulles
17.253.3.203    Dulles

dig audio.itunes.apple.com @8.8.4.4 Google

audio.itunes.apple.com. 1392    IN  CNAME   thxm-cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 21 IN CNAME    itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 14  IN  A   17.253.15.202
itunes-apple.g.aaplimg.com. 14  IN  A   17.253.15.204

dig audio.itunes.apple.com @8.8.8.8 Google

audio.itunes.apple.com. 9609    IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 299 IN CNAME   itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 14  IN  A   17.253.15.205
itunes-apple.g.aaplimg.com. 14  IN  A   17.253.15.207

dig audio.itunes.apple.com @208.67.222.222 OpenDNS

audio.itunes.apple.com. 57855   IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 300 IN CNAME   itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.15.206
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.15.208

dig audio.itunes.apple.com @208.67.220.220 OpenDNS

audio.itunes.apple.com. 57855   IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 300 IN CNAME   itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.15.202
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.15.204

dig audio.itunes.apple.com @165.87.13.129 AT&T (US)

audio.itunes.apple.com. 63257   IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 4 IN CNAME     itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 9   IN  A       17.253.7.203
itunes-apple.g.aaplimg.com. 9   IN  A   17.253.7.201

dig audio.itunes.apple.com @4.2.2.1 Level3

audio.itunes.apple.com. 78408   IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 282 IN CNAME   itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 11  IN  A   17.253.15.202
itunes-apple.g.aaplimg.com. 11  IN  A   17.253.15.204

dig audio.itunes.apple.com @168.95.1.1 HiNet (TW)

audio.itunes.apple.com. 58759   IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 269 IN CNAME   itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.18.224
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.18.222

dig audio.itunes.apple.com @195.129.12.122 UUNET (CH)

audio.itunes.apple.com. 84095   IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 23 IN CNAME    itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 15  IN  A       17.253.57.205
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.57.207

dig audio.itunes.apple.com @192.76.144.66 UUNET (DE)

audio.itunes.apple.com. 84095   IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 22 IN CNAME    itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.57.202
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.57.204

dig audio.itunes.apple.com @158.43.240.3 UUNET (UK)

audio.itunes.apple.com. 84095   IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 300 IN CNAME   itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.35.207
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.35.205

dig audio.itunes.apple.com @198.6.100.25 UUNET (US)

audio.itunes.apple.com. 68414   IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 23 IN CNAME    itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.3.202
itunes-apple.g.aaplimg.com. 15  IN  A   17.253.3.204

dig audio.itunes.apple.com @216.146.35.35 Dyn

audio.itunes.apple.com. 51184   IN  CNAME   thxm-   cn.itunes-apple.com.akadns.net.
thxm-cn.itunes-apple.com.akadns.net. 245 IN CNAME   itunes-apple.g.aaplimg.com.
itunes-apple.g.aaplimg.com. 8   IN  A   17.253.15.205
itunes-apple.g.aaplimg.com. 8   IN  A   17.253.15.207
 Conclusions

Spotify’s rig is obviously working out well. Providing a stream is much smarter than providing a single file, and their content delivery network seems to be coping. I haven’t thurroughly investigated their network, but EdgeCast seems to be working well enough to provide Spotify’s content globally—if only Apple could achieve the same.

 
2
Kudos
 
2
Kudos

Now read this

Docker—a brief introduction

At Studio None, we’ve been using Docker since the beginning of the year and it has massively improved the way we handle our deployments. Docker’s primary objective is to wrap up an application and all its dependencies into a neat little... Continue →