Chrome freezes after transferring a certain amount of data - waiting for an available socket

I have a browser game and I recently started adding audio to the game.

Chrome doesn’t load the whole page and gets stuck in "91 requests | 8.1 MB transferred" and doesn’t load more content and even slows down the website on all other tabs, saying Waiting for available socket .

After 5 minutes (accurately), the data is loaded.

enter image description here

enter image description here

This does not happen in any other browser.

Deleting one MP3 file (the last one added) fixes the problem, so I assume the problem is with the data limit?

+97
google-chrome networking sockets streaming
May 15 '14 at 13:38
source share
4 answers

It looks like you are pushing the connection to the server. I see that you are loading a lot of static files, and my advice is to split them into subdomains and serve them directly using Nginx.

  • Create a subdomain called img.yoursite.com and upload all your images from there.

  • Create a subdomain called scripts.yourdomain.com and upload all your JS and CSS files.

  • Create a subdomain called sounds.yoursite.com and upload all your MP3 files ... etc.

Nginx has great features for directly serving static files and managing caching of static files.

+66
Jun 30 '14 at 9:34
source share

Explanation:

This issue occurs because Chrome allows up to 6 open connections by default. For example, if you simultaneously transfer several multimedia files from tags 6 <video> or <audio> , the 7th connection (for example, an image) will simply freeze until one of the sockets opens. Usually, an open connection closes after 5 minutes of inactivity, and therefore you see that your pngs are loading at that moment.

Solution 1:

You can avoid this by minimizing the number of media tags that support an open connection. And if you need more than 6, make sure that you download them for the last time, or that they don’t have attributes like preload="auto" .

Solution 2:

If you are trying to use several sound effects for a web game, I highly recommend that you use SoundJS. This is a great tool for playing a large number of sound effects / music tracks at the same time.

Solution 3: Public Key Public Sockets (not recommended)

If necessary, you can force open sockets in your browser (only in Chrome):

  • Go to the address bar and type chrome://net-internals .
  • Select Sockets from the drop-down menu.
  • Click the Flush socket pools button.

This solution is not recommended because you should not expect your visitors to follow these instructions to browse your site.

+137
Apr 15 '15 at 0:15
source share

Message:

Waiting for an available socket ...

shown as you have reached the limit in ssl_socket_pool for either the host, or for the proxy, or for the group.

Here are the maximum number of HTTP connections you can make in the Chrome browser:

  • The maximum number of connections to the proxy server is 32 connections. This can be changed in the list of policies .
  • Maximum number of hosts: 6 connections.

    Most likely, it will be hardcoded in the source code of the web browser, so you cannot change it.

  • A total of 256 HTTP connections are combined for each browser.

Source: Enterprise Network for Chrome devices

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




Your sound problem may be related to Error Chrome 162627 , when HTML5 sound does not load and it clicks the maximum number of simultaneous connections to the server: proxy, This is still relevant at the time of writing (2016).

The significant problem with waiting for HTML5 videos is probably related to Problem # 234779 , which was fixed in 2014. And it is related to SPDY, which can be found in Problem 324653: Problem SPDY: waiting for available sockets , but this has already been fixed in 2014, so it’s probably not connected.

Another related issue is now marked as a duplicate, which can be found in Issue 401845: Failure to preload audio metadata. Only 6 out of 10+ were downloaded , which is associated with a problem with the media player code, leaving a bunch of suspended requests around it.




It could also be due to some Chrome adware or antivirus extensions using your sockets in the background (like Sophos or Kaspersky ), so check your network activity in DevTools.

+12
Mar 07 '16 at 20:44
source share

A simple and correct solution delays the pre-loading of your audio and video file from the settings and re-checking your page. Your problem while waiting for an available socket will be resolved ...

if you use jplayer, replace preload: "metadata" with preload: "none" from the jsper jsp file ...

preload: "metadata" is the default value that plays your audio / video file on page load, so google chrome shows a "pending available socket" error

+6
Feb 24 '15 at 8:14
source share



All Articles