AT&T Video Optimizer
Multiple Simultaneous Connections Same Domain
Introduction
According to the Pew Research Center, over 80% of Android apps use the mobile network to connect back to servers to keep content fresh and recent. Aside from ads and analytics, most of the connections in your app will point to your CDN or home servers – all using the same domain/IP address.
Background
So, connections to your server are good, but too many connections can be bad. How does one find the right balance?
Due to the size and complexity of some JavaScript files, the delay caused by synchronous loading can produce a noticeable delay in the rendering of the page.
The Issue
If your app uses one connection to the server per instance, it is very easy to predict the connection load to your server (it is a 1:1 ratio of your user count). However, many popular apps use multiple API connections to the same server per user – and each set of API calls uses a different network connection. You might find that the ratio of your app is actually 5 connections per user. In that case, if you architected your backend to handle a capacity of 100,000 connections – you can only actually have 20k customers connecting at a given time (well under what you might have expected for user capacity).
This best practice looks at the number of connections that occur simultaneously to a server, and if the count is over 7, it triggers a failure. There are times where having multiple connections might make sense, such as when you send many images over HTTP to populate a screen, but you should investigate all occurrences to see if there is a space for optimization.
In the screenshot below, Video Optimizer detects 3 domains with over 7 connections at the same time (the domain is obfuscated).
The top entry in the screenshot shows 7 calls to APIs from the same server. By consolidating the API requests, this app could reduce the connection count at the server, and reduce the number of round trips for the requests (latency), which would reduce load and speed up the app at the same time!
The first line in the screenshot is for API calls to a common analytics engine. Perhaps the integration with this engine is adding extra connections—and so it would be good to double check the integration to ensure that these multiple connections do not block customer content.
Best Practice Recommendation
When this best practice fails, check each of the multiple connections that were discovered to see whether these calls can be consolidated into one single connection—which would speed up content delivery to your customers, and leave connection capacity for additional content.