Search code examples
socketsgoogle-chromehttpnetwork-programmingstreaming

Chrome hangs after certain amount of data transfered - waiting for available socket


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

Chrome does not load the whole page and gets stuck at "91 requests | 8.1 MB transferred" and does not load any more content; and it even breaks the website in all other tabs, saying Waiting for available socket.

After 5 mins (exactly) the data are loaded.

enter image description here

enter image description here

This does not happen on any other browser.

Removing one MP3 file (the latest added one) fixed the problem, so is it perhaps a data limit problem?


Solution

  • Looks like you are hitting the limit on connections per server. I see you are loading a lot of static files and my advice is to separate them on subdomains and serve them directly with Nginx for example.

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

    • Create a subdomain called scripts.yourdomain.com and load all your JS and CSS files from there.

    • Create a subdomain called sounds.yoursite.com and load all your MP3s from there... etc..

    Nginx has great options for directly serving static files and managing the static files caching.