The problem of building chat rooms in socket.io,koa2.

ask a question about the server structure.
the current plan is for chat rooms to have functions such as login, public chat, custom groups, friends, private chat, and so on.
every function must be a functional module. Here comes the problem:

should I write each function as a separate koa app, listening on its own port, or should I listen on only one port in a koa app and treat each function as a functional module of the app?

at present, I personally feel that if you are in a single koa app, you will take up less link resources, but this app will deal with more things.
if separated, it takes up a lot more link resources, but there is less pressure on each app.

currently I have only one server. Although I am only writing a demo, I still want to ask someone with experience to analyze what problems should be paid attention to. Thank you.

Apr.05,2021

must be a port and then distribute it. Because performance does not depend on how many resources you take up per app, but on the total amount of resources taken up.


one port is good. Even if it is made into multiple ports, it is better to keep socket.io on one port


than to have more than one common

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9c094-18a4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9c094-18a4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?