While troubleshooting network issues, it is sometimes necessary to perform network throughput tests using services on the Internet. When testing the speed of Internet uplinks using a client device on an MX configured with load balancing, the test may use only a single uplink for multiple tests. If the throughput of the uplinks differ, this behavior may produce unexpected results in Internet speed tests. The behavior is a function of the MX's load balancing algorithm.
Traffic is mapped to an Internet interface by source and destination IP address. Any newly initialized IP traffic matching the source and destination IP address of an existing mapping will be sent over the same Internet interface. This is done to preserve the connection state of certain flows that require the source and destination to remain the same for the duration of the connection.In the figure below, traffic for Host A (192.168.1.2) destined for the speedtest site has been mapped to Uplink 1, and traffic for Host B (192.168.1.3) destined for the speedtest site has been mapped to Uplink 2. For as long as these mappings persist, Host A's results will always match those of Uplink 1 whereas Host B's results will always match those of Uplink 2.
This is outlined further in SSL/TLS connections with Load Balancing on the MX.
Each of these traffic mappings expires after 3600 seconds (1 hour) of no traffic matching the mapping. This duration is reset each time new traffic is generated that matches the mapping. With frequent communication between a pair of hosts, this can result in traffic consistently using a single uplink for communication as the mapping is continuously refreshed.
In many cases the throughput of the uplinks connected to an MX will differ. For example, one uplink may be on a high-speed MPLS network while another is on a slower DSL connection, or an upstream issue may be causing congestion on a particular link. When testing uplink speeds using an Internet-based speed test, the best practice is to test each uplink separately by connecting only a single uplink during the test. This will avoid the interface preference issue described earlier and allow for more accurate measurement of the uplink's throughput.