What are Max parallel HTTP connections in a browser?


In this tutorial, we will learn about Max parallel HTTP connections in a browser.

To know more about this topic, we will first understand what parallel connections are, the reasons behind blocking and how to solve it, and the browser limitations.

Parallel Connections

By entirely requesting the original HTML page, the first embedded item, the second embedded object, etc., a browser may naively process each embedded object in sequence. But it moves too slowly! HTTP enables clients to establish connections and parallelly carry out numerous HTTP transactions.

Parallel Connections Could Speed Up Page Loading. If composite pages with embedded objects use a single connection’s bandwidth and slow time, they may load more quickly. If a single link does not exhaust the client’s Internet bandwidth, the delays can be overlapped, and the extra bandwidth can be used to load other objects.

Parallel connections could appear to be faster. Parallel connections do not always increase page loading speed. However, even if they don’t speed up the page transfer, parallel connections frequently give users the impression that the page loads faster because they can see progress as multiple component objects appear onscreen concurrently. People believe that web pages load faster if there is a lot of activity on the screen, even though a stopwatch would indicate that the total page download time is slower.

Blocking

A browser can only connect to the same host in parallel so many times. Therefore, the maximum number of connections is 60, with a maximum number of connections per host varying from 2 to 13, depending on the browser used. Often referred to as blocking or stalling, it is directly related to the number of connections available within a browser. Now we will see some important questions that are raised in blocking.

What does blocking mean?

This is known as blocking when a file must wait for connections to open up to start downloading to the browser. In essence, files wait in a queue for a connection to the server to open up before they are made available to site visitors.

Why does blocking occur?

Blocking always happens when more files need to load than there are open connections. The CSS, JavaScript, pictures, and other files will start downloading from the server as soon as the HTML for your page loads, allowing these elements to be shown in your browser. Unless otherwise specified, these files will load synchronously and in the order that they appear in the code of your website. Additional files that have asked to be loaded must wait until another connection becomes available when a browser reaches its connection allotment.

How can blocking be prevented?

It might seem as though having more connections accessible would significantly improve browser (and web) performance, yet doing so can be very taxing on the server. The server could manage only 10% of traffic if your browser could support 60 connections instead of 6. Several browsers (Opera, IE10, 11, & 12) allow you to increase the number of connections available. Still, it is typically not a good idea unless you run a load test on your server. Increased connections will negatively affect your server’s performance and may also be viewed as a DDoS attack by the server.

Maintaining a balance between the front and back end is crucial to enhance the surfing experience and prevent blocking from impairing web speed. You might also think about using Ajax calls or asynchronous file loading. Even the order in which the files are loaded is up to you. Consider packing a specific image if it adds more value to a page than your customer reviews.

Browser connection limitations

The amount of HTTP connections from the same domain name is restricted by browsers. The HTTP specification defines this constraint (RFC2616). Six connections per domain are typically allowed by current browsers. Most outdated browsers limit connections to two per domain.

Single-user clients cannot maintain more than two connections to any server or proxy, according to the HTTP 1.1 protocol. The purpose of browser limitations is for this. RFC 2616 - Hypertext Transfer Protocol, part 8 - Connections contains more details.

This is less flexible than modern browsers, which support more connections. The RFC does not mention how to stop the limit from being exceeded. Connections may be closed, or their ability to open may be restricted.

Browser version Connections per Hostname Max Connections
Chrome 34/32 6 10
Internet Explorer 9 6 35
Internet Explorer 10 8 17
Internet Explorer 11 13 17
Firefox 27/26 6 17
Safari 7.0.1 6 17
Android 4 6 17
Chrome Mobile 18 6 16
Internet Explorer Mobile 9 6 60

Can we use the same connection to submit several requests?

Persistent connection in HTTP 1.1 There were limitations with HTTP 1.0, such as the limit of one request per connection. This implies that each network request will form a new connection channel.

Since establishing a connection costs money, HTTP 1.1 introduced the idea of a permanent connection. (This capability was later added to HTTP 1.0 as well.)

A persistent connection may be used repeatedly and is kept open for a set amount of time, eliminating the need for a new TCP handshake for each connection request.

With this functionality’s help, we can send successive requests over the same connection channel.

Updated on: 07-Dec-2022

8K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements