The number of concurrent connections to test the browser loading speed

 Each browser has its own default number of concurrent connections, and by default, the browser only maintains a certain number of connections for resources under the same domain, which will block too many connections, which will affect the browser 's loading speed of web pages . This article simply tests the loading speed with different numbers of concurrent connections. First introduce some basic concepts. The browser obtains the HTML code of the page displaying the requested page, and then analyzes the HTML code to obtain the components of the page (CSS files, JS files, pictures, etc.). Of course, DNS resolution may be required to obtain HTML code or components.
  Secondly, these components are generally downloaded sequentially, such as a CSS file of 100KB and a JS file of 1KB. The browser often needs to download the CSS file, and then download the JS file (provided that the CSS file appears before the JS file), so that the web page will display Very slow and will wait for the 100K CSS file to download.
  Of course, all browsers currently support concurrency, so that CSS files and JS files can be downloaded at the same time. In the http1.1 protocol, IE5/6/7 and firefox2 support up to 2 concurrent numbers, and IE8 and firefox2 support up to 6 concurrent numbers. , opera and safari support up to 8 concurrency, and chrome supports up to 4 concurrency. Interested users can read "The number of concurrent connections for IE and Firefox requests to the same domain name".
  This limitation does not have much impact on ordinary web applications. After all, normal connection requests will return results quickly, but if a long connection is used in the web, there may be major problems. , especially in IE6, the long connection will always occupy a number of connections. If you have 2 long connections, it will be more difficult, and the browser will not be able to request the same server at this time.
  You may think that the number of concurrency is not very obvious for the speed of the browser to browse the web. We can illustrate the problem through actual testing, using the online browser concurrency testing tool, address: http://site-perf.com/
  toTake http://www.iefans.net as an example, using 2 concurrent numbers and 6 concurrent numbers for testing, the results are as follows:

  Load test with 2 concurrent numbers

  The loading time of 2 concurrent numbers is 29 seconds (the speed of foreign websites accessing domestic websites is relatively slow) The loading time of
  6
  concurrent numbers is 13.2 seconds.
  By comparison, it can be found that under the same conditions, 6 concurrent numbers The number of browsers is 15.8 seconds faster than the browser with 2 concurrent numbers, and the waiting time is reduced from 87% to 45%, which is also the benefit of the number of concurrent degrees (not only can download 100K CSS files, but also 1K JS can be downloaded at the same time. file.)
  Of course, this is only the most superficial analysis. If you want to study the performance of the website, try to reduce the waiting time to 0. Usually, JS, CSS and other files are merged (the same 100MB file is copied faster than 100 1MB files. , because IO reading and writing takes more time than transmission), the same website places different files under different domain name machines for load balancing, which leads to longer domain name resolution time, but affects the loading speed.

 

From: http://www.spasvo.com/news/html/2016121142405.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326647485&siteId=291194637