{"id":903,"date":"2015-03-10T22:20:00","date_gmt":"2015-03-10T22:20:00","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2015\/03\/10\/http-pipelining-vs-domain-sharding\/"},"modified":"2021-07-27T15:49:31","modified_gmt":"2021-07-27T15:49:31","slug":"http-pipelining-vs-domain-sharding","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Networking\/Protocols\/http-pipelining-vs-domain-sharding.html","title":{"rendered":"HTTP Pipelining vs Domain Sharding"},"content":{"rendered":"
The other day I was reading about the benefits and new features within HTTP 2.0<\/a>. One of the key features to HTTP2.0 is the ability to interleave (i.e multiplex) multiple requests and responses across a single TCP connection. Resulting in Domain Sharding being considered counterproductive. However, based on how Domain Sharding and HTTP Pipelining can issue parallel HTTP requests, this raises an interesting question,<\/p>\n Why use Domain Sharding over HTTP Pipeling ?<\/strong><\/p>\n Ok, first a little history. Within HTTP versions prior to HTTP 1.1 each request was sent over a separate TCP connection. HTTP 1.1 then introduced a feature called “Keep-Alive”. This allowed for multiple requests to be sent over a single connection. However only a single request could be sent at once. When the request had been served i.e the response fully received the next request could be sent. This is also known as head-of-line-blocking. <\/p>\n HTTP Pipeling was introduced and allowed the client to send multiple requests within a single TCP connection in parallel. Consider the following,<\/p>\n Because of the head-of-line blocking issues with HTTP Pipelining, along with many servers and proxies not supporting it due to problems with implementation Pipelining is typically disabled (by default) within browsers.<\/p>\n Because of the limited adoption of HTTP pipelining there was still a need for further optimisation techniques within the HTTP protocol to allow for HTTP requests\/responses to be sent and received in parallel.<\/p>\n By default browsers open a maximum of 6 connections on a per domain basis. Domain Sharding simply means that the websites assets are spread across multiple domains. In turn maximising the amount of concurrent connections opened by the browser, allowing for a greater number of parallel downloads via HTTP.<\/p>\n However Domain Sharding does come with its own disadvantages. Such as the additional overhead\/latency introduced with a) building extra TCP connections and b) performing additional Domain Name lookups.<\/p>\n In essence both HTTP Pipelining and Domain Sharding allow for HTTP requests to be sent in parallel. But this is where the similarities end. With head-of-line-blocking and the limited adoption of HTTP Pipelining, Domain Sharding is the preferred choice when choosing between these 2 HTTP optimization ‘techniques’. <\/p>\n HTTP 2 FAQ – http:\/\/http2.github.io\/faq\/<\/a> <\/p>\n","protected":false},"excerpt":{"rendered":" The other day I was reading about the benefits and new features within HTTP 2.0. One of the key features to HTTP2.0 is the ability to interleave (i.e multiplex) multiple requests and responses across a single TCP connection. Resulting in Domain Sharding being considered counterproductive. However, based on how Domain Sharding and HTTP Pipelining can … Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"yoast_head":"\nHTTP Pipeling<\/h2>\n
However, Pipelining was still prone to head-of-line-blocking as each response had to be completed before the next response could be sent. Below is an example,<\/p>\n\n
Domain Sharding<\/h2>\n
Summary<\/h2>\n
References<\/h2>\n
Oreilly HTTP Optimization – http:\/\/chimera.labs.oreilly.com\/books\/1230000000545\/ch11.html<\/a><\/p>\n