简体   繁体   English

Http请求-> net_error = -101(ERR_CONNECTION_RESET)

[英]Http request --> net_error = -101 (ERR_CONNECTION_RESET)

Now ,i encounter a case. 现在,我遇到一个案例。

This period of time,my website is very slow some time(Only one request,so it would not be request blocking). 在这段时间内,我的网站很慢(只有一个请求,因此不会阻止请求)。

I observe that when the page runs slowly,it 's timing performance as 我观察到,当页面运行缓慢时,它的计时性能为 在此处输入图片说明

And i open chrome://net-internals/#events, find the result: 然后我打开chrome:// net-internals /#events,找到结果:

在此处输入图片说明

what 's wrong? 怎么了? what happened in the time between t(29) and t(18933)? 在t(29)和t(18933)之间的时间里发生了什么?

dns lookup? DNS查找? nginx queueing? Nginx排队?

Well, the fact is that you don't have only one request to the server. 好吧,事实是您对服务器只有一个请求

  1. Even if you have the web page open in a single tab, there might be multiple connections for different resources. 即使您在单个选项卡中打开了网页,对于不同的资源也可能存在多个连接。

  2. If you are using a proxy server, then all the requests go to the proxy server, causing requests to block. 如果您使用的是代理服务器,则所有请求都将发送到代理服务器,从而导致请求被阻止。


Read the answer to a similar problem : 阅读类似问题的答案:

The cause of the problem is multiple simultaneous connections to the server. 问题的原因是到服务器的多个同时连接。 Every browser has a limit to the maximum number of TCP connections to a server. 每个浏览器都有与服务器的最大TCP连接数限制。 For chrome, the limit is six. 对于chrome,限制为六个。 The problem is more prominent when you are using a proxy server, because all the requests go the same server (the proxy server). 使用代理服务器时,此问题更加突出,因为所有请求都发送到同一服务器(代理服务器)上。

Chrome doesn't allow you to change this limit. Chrome浏览器不允许您更改此限制。 It shouldn't in fact. 实际上不应该。 If you want to know more about why this limit exists, and what are the limits for other browsers, you can read this article . 如果您想进一步了解为什么存在此限制,以及其他浏览器的限制是什么,可以阅读本文

The reason why this limit is rarely a problem is because multiple HTTP requests to the same host are mostly sent consecutively, rather than parallely, preferably over the same TCP connection. 此限制很少成为问题的原因是,对同一主机的多个HTTP请求大多是连续发送的,而不是并行发送的,最好是通过同一TCP连接发送。

If this problem occurs to you frequently, then the reason might be: 如果您经常遇到此问题,则原因可能是:

  1. Server doesn't support persistent TCP connection: If the problem occurs only when accessing a particular server, the reason might be that chrome is fetching multiple resources (like images, CSS files, etc) on parallel connections. 服务器不支持持久的TCP连接:如果仅在访问特定服务器时才出现问题,原因可能是chrome正在并行连接上获取多个资源(例如图像,CSS文件等)。 Since, in your case, the server is on your local network, you might want to ask the server's administrator to add support for persistent TCP connections. 由于在您的情况下,服务器位于本地网络上,因此您可能需要请求服务器的管理员添加对持久TCP连接的支持。

  2. Multiple persistent connections are open: If you are working behind a proxy server, then downloading multiple files simultaneously or opening sites which keep a TCP connection open might be the cause of your problem.To get rid of it, all you can do is to not download many things simultaneously (or download in a different browser, if you have to). 多个持久连接处于打开状态:如果您在代理服务器后面工作,则同时下载多个文件或打开保持TCP连接保持打开状态的站点可能是造成问题的原因。要摆脱它,您所要做的就是不要同时下载许多内容(如果需要,也可以下载其他内容)。

PS: The error net_error = -101 (ERR_CONNECTION_RESET) is because of the timeout, waiting for some previous connection to the server to close. PS:错误net_error = -101(ERR_CONNECTION_RESET)是由于超时,正在等待与服务器的某些先前连接关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM