[Solved] Optimize Socket io [closed]


Only being allowed to support 500-600 connections is a very broad issue. You need to distinguish what’s bottlenecking your code and analyze it to see if there’s any way to fix it. This issue may not be socket.io specific and can be caused by some other module in your application. First profile your code and see if there’s anything that is is really heavy and can use optimization. NodeJS has a built in profiling tool that can be used which you can find >HERE<. Once you’ve narrowed down your issue, it’ll be easier for you to figure out what needs to be optimized and easier for us in the community to help aid you.

Another option you can do is completely scrap socket.io all together and write your own custom websocket protocol. Requires a bit more work, but it’ll strip away a lot of overhead you may not need.

https://codeburst.io/why-you-don-t-need-socket-io-6848f1c871cd

If you do want to keep using socket.io and you find that there’s nothing that sticks out while profiling your application, your machine probably needs more resources to support the number of connections. Only thing you can do for this is to upgrade whatever hardware your application is sitting on.

0

solved Optimize Socket io [closed]