Maximum concurrent Socket.IO connections

前端 未结 5 1883
旧时难觅i
旧时难觅i 2020-11-29 15:23

This question has been asked previously but not recently and not with a clear answer.

Using Socket.io, is there a maximum number of concurrent connections that one c

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 15:36

    I tried to use socket.io on AWS, I can at most keep around 600 connections stable.

    And I found out it is because socket.io used long polling first and upgraded to websocket later.

    after I set the config to use websocket only, I can keep around 9000 connections.

    Set this config at client side:

    const socket = require('socket.io-client')
    const conn = socket(host, { upgrade: false, transports: ['websocket'] })
    

提交回复
热议问题