{"id":295,"date":"2017-09-04T10:00:25","date_gmt":"2017-09-04T00:00:25","guid":{"rendered":"https:\/\/www.itfault.com.au\/main\/?p=295"},"modified":"2017-09-04T10:23:05","modified_gmt":"2017-09-04T00:23:05","slug":"latency-can-cause-havoc-remote-customers","status":"publish","type":"post","link":"https:\/\/www.itfault.com.au\/main\/2017\/09\/04\/latency-can-cause-havoc-remote-customers\/","title":{"rendered":"How latency can cause havoc to your remote customers"},"content":{"rendered":"<style type=\"text\/css\">\ntd.number {\n  text-align: right;\n  font-family: monospace;\n}\n<\/style>\n<p>In a country as big as Australia the speed of light becomes a limiting factor that can adversely affect customer experience. I&#8217;ll explain how.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.itfault.com.au\/main\/wp-content\/uploads\/2017\/09\/watch-240x171.jpg\" alt=\"Watch 240x171\" width=\"240\" height=\"171\" class=\"alignleft size-full wp-image-309\" \/> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Round-trip_delay_time\">Round-trip time<\/a> is the time it takes for a network packet to travel from a local device to a remote device via a network, and for another packet to travel back from the remote device to the local device.<\/p>\n<p>Various factors can affect how long it takes to transmit a packet. Large packets are limited by <b>network speed<\/b> (a 64 kilobyte packet takes ~640 milliseconds to transmit on a 1 megabit\/second link). So faster links can transmit more data more quickly, naturally.<\/p>\n<p>But, even with the fastest links, <b>network latency<\/b> (round-trip time) becomes an important factor when distance is involved. No packet can travel faster than the speed of light.<\/p>\n<p>Consider the round-trip time at the speed of light between the following cities:<\/p>\n<table>\n<tr>\n<th>From<\/th>\n<th>To<\/th>\n<th>Kilometres<\/th>\n<th>RTT<sup>1<\/sup><\/th>\n<\/tr>\n<tr>\n<td>Melbourne<\/td>\n<td>Sydney<\/td>\n<td class=\"number\">878<\/td>\n<td class=\"number\">4ms<\/td>\n<\/tr>\n<tr>\n<td>Melbourne<\/td>\n<td>Brisbane<\/td>\n<td class=\"number\">1,667<\/td>\n<td class=\"number\">8ms<\/td>\n<\/tr>\n<tr>\n<td>Melbourne<\/td>\n<td>Perth<\/td>\n<td class=\"number\">3,418<\/td>\n<td class=\"number\">17ms<\/td>\n<\/tr>\n<tr>\n<td>Melbourne<\/td>\n<td>Singapore<sup>2<\/sup><\/td>\n<td class=\"number\">6,026<\/td>\n<td class=\"number\">30ms<\/td>\n<\/tr>\n<tr>\n<td>Melbourne<\/td>\n<td>Tokyo<sup>2<\/sup><\/td>\n<td class=\"number\">8,144<\/td>\n<td class=\"number\">41ms<\/td>\n<\/tr>\n<tr>\n<td>Melbourne<\/td>\n<td>London<sup>2<\/sup><\/td>\n<td class=\"number\">16,904<\/td>\n<td class=\"number\">84ms<\/td>\n<\/tr>\n<\/table>\n<div style=\"margin-left: 20px;\">\nNotes:<\/p>\n<ul>\n<li>1. Round-trip time calculated as Google maps driving distance between two locations multiplied by 2 divided by <a href=\"https:\/\/en.wikipedia.org\/wiki\/Optical_fiber#Index_of_refraction\">200,000km\/s<\/a><\/li>\n<li>2. Distance used in calculation is <a href=\"http:\/\/www.gcmap.com\/\">great circle distance<\/a> between two locations<\/li>\n<\/ul>\n<\/div>\n<p>Those round-trip times are idealised <i>best cases<\/i> and real-world experience will be considerably worse than that taking into account all the routers a packet must traverse, congestion, transmission speed, and more.<\/p>\n<p>Consider the scenario where you are loading a web page hosted in Perth on a computer in Melbourne. Ignoring 3-way TCP handshake and transmission times a typical modern complex JavaScript-based webpage with separate round-trip requests for 50 URLs would require:<\/p>\n<div style=\"margin-left:20px;\">\n<p>50 x 17ms = 850ms<\/p>\n<\/div>\n<p>That&#8217;s not too bad, under a second, and a typical web browser will use concurrency to fetch those requests 4 at a time bringing that number down to ~212ms.<\/p>\n<p>But what if that same website was in London? Then you&#8217;re looking at a minimum round-trip time (including concurrent downloading) of 1.0s.<\/p>\n<p>Some websites get considerably more complex. For example, when this article was composed, The Age&#8217;s website required a browser to make 227 requests.<\/p>\n<p>For the most part websites can often &#8220;get away&#8221; with many individual requests because they tend to be oriented towards local users or use a global content delivery network (CDN) to cache content closer to the user; in addition browsers cache a lot of unchanging content themselves such as style sheets and JavaScript code. But customers of localised sites on holidays overseas can still suffer when trying to access their accounts.<\/p>\n<p>There are situations where a client program, however, does not conduct requests in parallel (no parallelism). I&#8217;ve seen this with the <a href=\"https:\/\/en.wikipedia.org\/wiki\/CORBA\">CORBA protocol<\/a> which, because of its nature, requires request-response pairs to be serialised.<\/p>\n<p>If you have a CORBA server, and expect to use a CORBA application client, and a login process makes 1,000 odd requests, then even if the locations involved are Melbourne to Sydney (4ms round-trip) then you&#8217;re looking at an <i>absolute minimum<\/i> of that process taking 4s. If that same process is used between Melbourne and Perth then the absolute theoretical minimum time would be 17s &#8211; not even taking into account other factors.<\/p>\n<p>Latency has a serious impact on any non-trivial communication process and always has to be considered when delays present themselves.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a country as big as Australia the speed of light becomes a limiting factor that can adversely affect customer experience. I&#8217;ll explain how. Round-trip time is the time it takes for a network packet to travel from a local device to a remote device via a network, and for another packet to travel back &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.itfault.com.au\/main\/2017\/09\/04\/latency-can-cause-havoc-remote-customers\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How latency can cause havoc to your remote customers&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-295","post","type-post","status-publish","format-standard","hentry","category-technical"],"_links":{"self":[{"href":"https:\/\/www.itfault.com.au\/main\/wp-json\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itfault.com.au\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itfault.com.au\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itfault.com.au\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itfault.com.au\/main\/wp-json\/wp\/v2\/comments?post=295"}],"version-history":[{"count":14,"href":"https:\/\/www.itfault.com.au\/main\/wp-json\/wp\/v2\/posts\/295\/revisions"}],"predecessor-version":[{"id":311,"href":"https:\/\/www.itfault.com.au\/main\/wp-json\/wp\/v2\/posts\/295\/revisions\/311"}],"wp:attachment":[{"href":"https:\/\/www.itfault.com.au\/main\/wp-json\/wp\/v2\/media?parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itfault.com.au\/main\/wp-json\/wp\/v2\/categories?post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itfault.com.au\/main\/wp-json\/wp\/v2\/tags?post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}