Maximum browser connection in browsers

I want to do a stress test against my websocket server, run this javascript example in my browser (chrome) below:

function create_ws() { var ws=new WebSocket("ws://127.0.0.1/"); ws.onopen=function(evt){ var binary = new Uint8Array(2); binary[0]=1; binary[1]=2; ws.send(binary.buffer); }; ws.onclose=function(evt){}; ws.onmessage=function(evt){}; ws.onerror=function(evt){}; } var connections = []; var numberOfconnections=100; for(var i = 0; i < numberOfconnections; i++) { connections.push(create_ws()); } 

The problem is this: the script allows me to run only about 100 connections. If I increase numberOfconnections to 300, this causes the following error: WebSocket connection to 'ws://127.0.0.1/' failed: Error in connection establishment: net::ERR_INSUFFICIENT_RESOURCES

Is there a way to increase the number of browser connections in the browser?

+5
source share
2 answers

Try opening new tabs using the stress test manually or using window.open in the code.

+2
source

It seems like the limit for chromium is set to 256 in the following discussion:

Discussion Chromium

Other browsers may have different limitations. Since I use so many compounds for stress testing, I plan to open several windows to go beyond.

+1
source

Source: https://habr.com/ru/post/1232890/


All Articles