Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat are the bottlenecks inherent in networking?
    primarykey
    data
    text
    <p>If a computer has to fetch some information, a network request is generally one of the slowest possible sources. My understanding is that, in general:</p> <ul> <li>Network access is much slower than disk</li> <li>Disk access is much slower than RAM</li> <li>RAM access is much slower than CPU registers</li> </ul> <p>My question is this: <strong>what makes network access so much slower, on average, than disk</strong>?</p> <p>Obviously this isn't always true: you <strong>could</strong> have a blazing-fast network connection to a server in the same room and a sluggish hard drive. But for the purposes of this question, please imagine <strong>an average user surfing the web</strong>: reading data from disk will be faster than fetching the same data from Google.</p> <p>Some of the pieces I can think of involved in, say, an HTTP request are:</p> <ul> <li>DNS lookup of the IP</li> <li>The three-way handshake to establish a TCP connection</li> <li>Packetization: breaking the HTTP request into TCP packets, and putting those into IP packets, with all the necessary counters and checksums, etc</li> <li>Transmission: the time required for electrical signals to move across wire</li> <li>Routing: the decision-making, buffering, etc that happens inside routers</li> <li>Processing: the server's formulation of a response</li> <li>All the transmission and routing of the response, including resending missing packets</li> <li>Ordering and assembling the TCP packets' contents and handing the HTTP response back to the client</li> </ul> <p>If I've missed any major steps, please let me know.</p> <p>Of these steps, ignoring server processing (which isn't really a network issue), are any parts particularly slow? Do any of them account for most of the inherent delay in network requests?</p> <h2>Update: Some numbers</h2> <blockquote> <p>An average DNS lookup takes 60~120ms, followed by a full round-trip (RTT) to perform the TCP handshake - combined, that creates 100-200ms of latency before we can even send the request!</p> </blockquote> <ul> <li>Source: <a href="http://www.igvita.com/2012/06/04/chrome-networking-dns-prefetch-and-tcp-preconnect" rel="nofollow">Chrome Networking: DNS Prefetch &amp; TCP Preconnect</a> by Ilya Grigorik, Developer Advocate at Google</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload