I've done some research on multithreading and multiprocessing options for the server. I do not believe the Client will gain from either.
Clustering seems like the easiest and most stable way of increasing server performance capabilities.
The cluster module allows easy creation of child processes that all share server ports.
The workers can share a TCP connection. This would allow all users to connect to a single TCP server port, and have the messaging service distributed over the multiple processes.
Child Process is what the Clustering module is based on. If we wanted more direct control over the multiprocessing we could build our own clustering utility. However, it may be easier to use the stable Clustering module as it has baked in algorithms for job distribution.
Worker Threads is an experimental feature of Node.js. I've used it in the past for an memory mapping project, but due to some constraints with mmap module I used I couldn't get it to work 100%. The worker threads share memory with the master thread. I am unsure if the threads will be able to share a TCP connection or if the Socket connection instances could even be shared between threads. If I remember back, the messaging protocol for threads only sends serializable information and would thus require the clients to reestablish a TCP connection with the server.
Experimentation is required for all methods listed above.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too