Should i use different socket connections or different namespaces?

Problem

I have different channels in my socket.io implementation and there will be a LOT of data exchanged with the clients connected to those channels. So i am a bit confused as to should i use the namespace concept in socket.io which creates separate namespaces for each channel under the same socket connection or should i create different socket connections on different ports for each channel? Please give me suggestion as to how these two options will affect the performance etc?

Thanks

Problem courtesy of: Bitsian

Solution

Namespaces seems like a better idea than tying up multiple sockets unnecessarily. The amount of data you can send back and forth will be limited by the overall bandwidth capacity. Opening new socket connections won't magically increase throughput unless the sockets connect to different machines, or if the single socket is used inefficiently (i.e. synchronous/blocking activity).

Solution courtesy of: Bret Copeland

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.