Implement room instancing in socketio-server.js #458
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use case: experience with 3000 users, using room instancing by batch of 50 users, no audio, no video, only websocket. We are interested only in avatar movements.
For 50 in a room, you probably want to reduce the update rate to 1 per second instead of 15 by setting
NAF.options.updateRate = 1
(doc)If you test it inside the networked-aframe repo, be sure to use
npm run dev-socketio
and settingnetworked-scene="adapter:socketio"
in the basic.html or basic-chat.html examples.Be aware there are pending issues with the socketio adapter:
That's a quick implementation I tested only with
maxOccupantsInRoom = 3
instead of 50.I didn't test the load. Someone has to create a script to test 3000 connections, creating the websocket, sending avatar positions every second, do that for a random duration about 30 seconds to 3 min for each connection and close the websocket connection to see how the node process supports the load.
If someone wants to go further, some things to be tested for cpu/memory/latency: