You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys, to try to use WS in cluster mode and so far I haven't been able to make it work ... but I noticed something interesting that I wanted your opinion ... I usually do performance tests on my platform ... the interesting thing was that when using the multi-fork mode separating the instances by ports and creating a load balance in nginx he had a better performance by about 20% than using the pm2 + adonis cluster mode directly
follows some images comparing the two:
MULTI-FORK + LOAD BALANCE NGINX:
CLUSTER MODE:
in the above test the cluster mode had a performance of about 20% less ... making some request had timeout and network error while the multi-fork all requests are successful.
another thing i wanted to see is the reason why ADONISJS Websockets is not working in cluster mode even making necessary modifications ... it doesn’t give any error anymore tbm the event is not broadcast to all connected users, it is only sent to users who are connected on the same door where the event is triggered ...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys, to try to use WS in cluster mode and so far I haven't been able to make it work ... but I noticed something interesting that I wanted your opinion ... I usually do performance tests on my platform ... the interesting thing was that when using the multi-fork mode separating the instances by ports and creating a load balance in nginx he had a better performance by about 20% than using the pm2 + adonis cluster mode directly
follows some images comparing the two:
MULTI-FORK + LOAD BALANCE NGINX:

CLUSTER MODE:

in the above test the cluster mode had a performance of about 20% less ... making some request had timeout and network error while the multi-fork all requests are successful.
#Testing was done by sending 6000 customers in 1 minute.
#I know that this problem is not with adonis, but with the use of cluster + Websockets, but there is little content in the documentation on how to deal with it
#I tried to use redis but it didn't work either ... : https://www.npmjs.com/package/adonis-ws-redis-provider / based: https://socket.io/docs/using-multiple-nodes/#Using-Node-JS-Cluster
another thing i wanted to see is the reason why ADONISJS Websockets is not working in cluster mode even making necessary modifications ... it doesn’t give any error anymore tbm the event is not broadcast to all connected users, it is only sent to users who are connected on the same door where the event is triggered ...
I followed the following topics:
https://github.com/adonisjs/adonis-websocket/pull/59/files
https://adonisjs.com/docs/4.1/websocket#_cluster_support
https://forum.adonisjs.com/t/how-do-you-scale-your-adonis-apps/4973/2
My server.js:
more informations about my multi-fork+ load balance:
#1406
can anybody help me?
Beta Was this translation helpful? Give feedback.
All reactions