developer tip

일정량의 데이터가 전송 된 후 Chrome이 중단됨-사용 가능한 소켓을 기다리는 중

optionbox 2020. 8. 23. 08:58
반응형

일정량의 데이터가 전송 된 후 Chrome이 중단됨-사용 가능한 소켓을 기다리는 중


브라우저 게임이 있고 최근에 게임에 오디오를 추가하기 시작했습니다.

Chrome은 전체 페이지를로드하지 않고 중단되고 "91 requests | 8.1 MB transferred"더 이상 콘텐츠를로드하지 않습니다. 그리고 다른 모든 탭에서 웹 사이트를 깰 수도 있습니다 Waiting for available socket.

5 분 (정확히) 후에 데이터가로드됩니다.

여기에 이미지 설명 입력

여기에 이미지 설명 입력

다른 브라우저에서는 발생하지 않습니다.

하나의 MP3 파일 (최근에 추가 된 파일)을 제거하면 문제가 해결되었으므로 데이터 제한 문제일까요?


서버 당 연결 한도에 도달 한 것 같습니다. 많은 정적 파일을로드하고있는 것으로 보이며 예를 들어 하위 도메인에서 파일을 분리하고 Nginx에서 직접 제공하는 것이 좋습니다.

  • img.yoursite.com 이라는 하위 도메인을 만들고 여기에서 모든 이미지를로드합니다.

  • scripts.yourdomain.com 이라는 하위 도메인을 만들고 거기에서 모든 JS 및 CSS 파일을로드합니다.

  • sounds.yoursite.com 이라는 하위 도메인을 만들고 거기에서 모든 MP3를로드합니다.

Nginx에는 정적 파일을 직접 제공하고 정적 파일 캐싱을 관리하기위한 훌륭한 옵션이 있습니다.


설명:

이 문제는 Chrome이 기본적으로 최대 6 개의 열린 연결을 허용하기 때문에 발생합니다. 따라서 6 개 <video>또는 <audio>태그 에서 동시에 여러 미디어 파일을 스트리밍하는 경우 소켓 중 하나가 열릴 때까지 7 번째 연결 (예 : 이미지)이 중단됩니다. 일반적으로 열려있는 연결은 5 분 동안 활동이 없으면 닫히므로 .png가 해당 지점에서 마침내로드되는 것을 볼 수 있습니다.

해결책 1 :

열린 연결을 유지하는 미디어 태그의 수를 최소화하여이를 방지 할 수 있습니다. 그리고 6 개 이상이 필요한 경우 마지막에로드했는지 또는 같은 속성이 없는지 확인하십시오 preload="auto".

해결책 2 :

웹 게임에 여러 음향 효과를 사용하려는 경우 Web Audio API를 사용할 수 있습니다 . 또는 간단하게하려면 SoundJS 와 같은 라이브러리를 사용하세요.이 라이브러리 는 많은 양의 음향 효과 / 음악 트랙을 동시에 재생하는 데 유용한 도구입니다.

해결 방법 3 : 소켓 강제 개방 (권장되지 않음)

필요한 경우 브라우저에서 소켓을 강제로 열 수 있습니다 (Chrome에만 해당).

  1. 주소 표시 줄로 이동하여을 입력 chrome://net-internals합니다.
  2. 메뉴 Sockets에서 선택하십시오 .
  3. 버튼을 클릭하십시오 Flush socket pools.

This solution is not recommended because you shouldn't expect your visitors to follow these instructions to be able to view your site.


The message:

Waiting for available socket...

is shown, because you've reached a limit on the ssl_socket_pool either per Host, Proxy or Group.

Here are the maximum number of HTTP connections which you can make with a Chrome browser:

  • The maximum number of connections per proxy is 32 connections. This can be changed in Policy List.
  • Maximum per Host: 6 connections.

    This is likely hardcoded in the source code of the web browser, so you can't change it.

  • Total 256 HTTP connections pooled per browser.

Source: Enterprise networking for Chrome devices

The above limits can be checked or flushed at chrome://net-internals/#sockets (or in real-time at chrome://net-internals/#events&q=type:SOCKET%20is:active).


Your issue with audio can be related to Chrome bug 162627 where HTML5 audio fails to load and it hits max simultaneous connections per server:proxy. This is still active issue at the time of writing (2016).

Much older issue related to HTML5 video request stay pending, then it's probably related to Issue #234779 which has been fixed 2014. And related to SPDY which can be found in Issue 324653: SPDY issue: waiting for available sockets, but this was already fixed in 2014, so probably it's not related.

Other related issue now marked as duplicate can be found in Issue 401845: Failure to preload audio metadata. Loaded only 6 of 10+ which was related to the problem with the media player code leaving a bunch of paused requests hanging around.


This also may be related to some Chrome adware or antivirus extensions using your sockets in the backgrounds (like Sophos or Kaspersky), so check for Network activity in DevTools.


simple and correct solution is put off preload your audio and video file from setting and recheck your page your problem of waiting for available socket will resolved ...

if you use jplayer then replace preload:"metadata" to preload:"none" from jplayer JS file ...

preload:"metadata" is the default value which play your audio/video file on page load thats why google chrome showing "waiting for available socket" error


Our first thought is that the site is down or the like, but the truth is that this is not the problem or disability. Nor is it a problem because a simple connection when tested under Firefox, Opera or services Explorer open as normal.

The error in Chrome displays a sign that says "This site is not available" and clarification with the legend "Error 15 (net :: ERR_SOCKET_NOT_CONNECTED): Unknown error". The error is quite usual in Google Chrome, more precisely in its updates, and its workaround is to restart the computer.

As partial solutions are not much we offer a tutorial for you solve the fault in less than a minute. To avoid this problem and ensure that services are normally open in Google Chrome should insert the following into the address bar: chrome: // net-internals (then give "Enter"). They then have to go to the "Socket" in the left menu and choose "Flush Socket Pools" (look at the following screenshots to guide http://www.fixotip.com/how-to-fix-error-waiting-for-available-sockets-in-google-chrome/) This has the problem solved and no longer will experience problems accessing Gmail, Google or any of the services of the Mountain View giant. I hope you found it useful and share the tutorial with whom they need or social networks: Facebook, Twitter or Google+.

참고 URL : https://stackoverflow.com/questions/23679968/chrome-hangs-after-certain-amount-of-data-transfered-waiting-for-available-soc

반응형