Socket.io: Load testing by Manual multiple client connections creation - Not working #4312
-
I am trying to do load testing of my side which using socket.io. I would like to know how my application performing with more socket.io client connections. So, I have tired to inject multiple client connections programmatically as mentioned in Socket.io documentation https://socket.io/docs/v4/load-testing/#manual-client-creation as below. `const { io } = require("socket.io-client"); const URL = process.env.URL || "https://MYSITEURL.com"; let clientCount = 0; const createClient = () => { const socket = io(URL, { setInterval(() => { socket.on("server to client event", () => { socket.on("disconnect", (reason) => { if (++clientCount < MAX_CLIENTS) { createClient(); const printReport = () => { console.log( packetsSinceLastReport = 0; setInterval(printReport, 5000);` But on viewing the IIS requests of my site, seems only one connection is created all other connections are failing with 404 errors. Below I pasted list of logs. My questions why for some connection my client is connection not for others. Also, in successful connection I found like one GET and POST calls are parsing but for unsuccessful connection only GET call get passed with same code, I don't know how? It would be helpful I I get any help. Thanks in advance. Successful connection IIS log ** Unsuccessful call IIS logs** |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Looks like you are using a custom path ( You need to make sure the server and the client share the same value. |
Beta Was this translation helpful? Give feedback.
Looks like you are using a custom path (
/vnext/socket.io/
) in Firefox, while the Node.js process uses the default/socket.io/
.You need to make sure the server and the client share the same value.
Reference: https://socket.io/docs/v4/server-options/#path