Replies: 1 comment 1 reply
-
One app can have many listen sockets (IP/port), and you can also listen to the same port on many threads (Linux only). But if you think about it, one "app" is really just a set of callbacks, so you can also simply create a new "app" how many times you want, and just use the same callbacks for all apps. So pretty much anything you want works. uWS does not currently have any knowledge or idea of horizontal scaling at all - it is only a simple library running on, for what it knows about, one machine. How you scale it horizontally is your engineering task. Ideally I would like to have some horizontal scaling feature built-in but I have no time to make it and I bet most people are going to end up doing their own thing anyways. |
Beta Was this translation helpful? Give feedback.
-
hello,
is it possible to .bind() .listen() the main app loop to many IP+PORT instead of one only?
if not, then a single app will exhaust the 28000 ephemeral sockets available in linux kernel, alright?
So, the best way to scale is it to use a pool of apps, redis as cache for shared channels, and haproxy or round robin dns, maybe over nginx reverse?
As before told,
perhaps,
App.
thread1 .listen(3000)
thread2 .listen(3001)
thread3 .listen(3002)
thread4 .listen(3004)
will work? Will share the common pubsub channels without the needs of redis?
thanks
Beta Was this translation helpful? Give feedback.
All reactions