1 handler or many, in context of actor model #80
Replies: 3 comments
-
For gws server instances, the upgrader and handler are shared, and the session is independent, you can refer to this design. A single gws instance struggles to meet your peak performance requirements, two is much easier. |
Beta Was this translation helpful? Give feedback.
-
The gws upgrader contains multiple memory pools within it, which are too configuration dependent (too many enumerations) to be used as global variables. If your library is private, it's okay to use global variables for the memory pool, most of the time there won't be multiple instances of server |
Beta Was this translation helpful? Give feedback.
-
Thank you, I will experiment with 2, 4, 8 etc instances |
Beta Was this translation helpful? Give feedback.
-
My current project (another ws library) has each session being 1 actor, each actor is 1 connection with their own read loop.
I tried to do the same with gws, but I see that each example only has a single handler.
What should I do, have a new upgrader+handler+readloop per session?
Or
1 handler, with 1 loop, and do some socket.Session() dispatching?
Just for info, current project (with diff library) has:
10k-35k sessions at all times, 400-2000 MB/s ws read/write total
I'd like maximum performance
Beta Was this translation helpful? Give feedback.
All reactions