Replies: 5 comments
-
I would try to help but I am confused what exactly you are asking, what do you mean "without letting pubsub on the side" ? |
Beta Was this translation helpful? Give feedback.
-
Your options are add more threads and/or add more servers, you can test to determine what combination is best for your app, you are suggesting you want single thread because it will simplify your app/debugging, that is probably fine, cloud providers charge per vCPU so adding thread on same machine cost same as adding thread on new server |
Beta Was this translation helpful? Give feedback.
-
Yeah but the pubsub inside uWebSockets won't work if we create more instances inside k8s for example. We have to add a layer on top of that, because each instance have its own app and list of connected clients, I'm looking for a proper way to scale and have pubsub working without too much trouble |
Beta Was this translation helpful? Give feedback.
-
Ok so your question is how to send messages between instances/servers, yes that is something you need to set up, not really that hard, broadcast to each other server what topic and what message to send. If you have groups of servers in different geographic regions you would broadcast message to each region, each region broadcasts message to each server |
Beta Was this translation helpful? Give feedback.
-
The way I see it, it depends on the needs of your app:
There were plans before on having something like those being built-in within uws but I don't think it really pushed through. (can someone confirm lol) |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a question. How can we scale pubsub properly?
Context:
First, I use cluster or worker_threads for scaling. But There is a need to tell the main process to propagate because each process have his own uWebSockets
app
, kinda like this:main process:
workers
But for debugging purposes I start to think that I can remove clustering in development to add a debugger to the process, then, do the horizontal scaling with Kubernetes, but the same problem will occur too.
So my question is, if there is a way to have a proper production scaling but without letting pubsub on the side.
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions