-
Hello, I have been using uwebsocket in production environment under two different use cases. Use case:1 Number of clients are larger but topics are much less, so using pub-sub works well here. So this use case is successful with uws since the underlying idea of maintaining topictree in uws and batching updates together for a event loop iteration yields good results. Use case:2 Number of clients are smaller( ~20 ) but they have little high number of unique topics per socket they subscribe to which can be around ~10 as a rough number. But here i see huge lag in updates like minutes which basically seems to be happening becuase of larger number of overall topics. the data input is same for both use cases. Cpu uasge is constantly 100% for second use case |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 42 replies
-
can anyone give any hints/ideas regarding this ? |
Beta Was this translation helpful? Give feedback.
-
Repeating the conclusion: The rule of thumb for publish is basically the same rule of thumb as for send; publish/send to topics/with sockets in ways to maximize locality - if you have 10 messages to send, send them to one socket a time, then move on to next. Same for publish; publish to topics in order of locality / relationship - use the sockets/topics that are the most related, in groups, don't just randomly publish. |
Beta Was this translation helpful? Give feedback.
Repeating the conclusion:
The rule of thumb for publish is basically the same rule of thumb as for send; publish/send to topics/with sockets in ways to maximize locality - if you have 10 messages to send, send them to one socket a time, then move on to next. Same for publish; publish to topics in order of locality / relationship - use the sockets/topics that are the most related, in groups, don't just randomly publish.