How to optimize normcore?
We're looking to reduce the amount of bandwidth that we use. What are some good practices to reduce the amount of bandwidth being used? What are some good practices to reduce the cost of normcore for our use case?
9 Replies
Hi @beeeen. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To optimize Normcore and reduce the amount of bandwidth being used, you can consider the following practices:
1. Datastore Frame Duration: The rate at which updates are serialized and sent out is set by the
datastoreFrameDuration
property. The default value is 1.0/20.0
which sends updates at 20hz. Setting this value lower results in more frequent updates, but also higher bandwidth usage. If you're running a local installation, values up to your render framerate can be acceptable; however, you'll rarely want to send updates more often than 20hz. Typically, even 10hz works well with Normcore. You might want to experiment with this value to see if it improves the update delay. source (https://normcore.io/documentation/room/datastore#delta-updates)
2. Congestion Control: Normcore uses WebRTC which implements congestion control. This means it can automatically adjust the rate at which updates are sent to the server to utilize the maximum bandwidth available while still keeping updates smooth for users with poor connections. If your network is congested, this could be slowing down your updates. source (https://normcore.io/documentation/architecture/transport#webrtc-implements-congestion-control)
To reduce the cost of Normcore for your use case, you can consider the following:
1. Room Hours: Room hours refer to the total number of hours that a room server is running and clients are connected. If no one is actively connected to a room, the room server shuts down after 30 seconds, and you stop being charged for the room. So, managing your room hours effectively can help reduce costs. source (https://normcore.io/documentation/pricing)
2. Changing Plans: Normcore offers different pricing tiers. You can change plans at any time in your billing cycle so Normcore can best meet your needs. Changes in room-hour and bandwidth limits take place immediately. For instance, you will be able to exceed the fixed limits right away if you switch from Pro to Unlimited, even in the middle of a billing cycle. However, if you switch from Pro to Free, the change will occur at the end of the month to allow you to take advantage of the bandwidth and room hours that you've already paid for. source (https://normcore.io/documentation/pricing)
3. Firewall Rules: If you're having trouble connecting to Normcore's servers on a corporate network, make sure the following IP ranges and ports are enabled. This can help ensure a high-quality connection for all players and prevent unnecessary data usage. source (https://normcore.io/documentation/architecture/firewalls)
Remember, optimizing Normcore involves a balance between performance and cost. It's important to monitor your usage and adjust your settings and plans as needed to find the best fit for your specific use case.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@690217885540417680> kapa.ai is still learning and improving, please let us know how it did by reacting below
First step is to identify what’s actually using bandwidth
take a look at the Normcore Unity profiler modules
they’ll show you send and received bandwidth and you can use that to figure out what parts of your application have heavy bandwidth use
Where can I find those profiler modules?
We're still working on the guide for it, but if you open the Unity profiler, (make sure you're on the latest version of Normcore), you should see them there / there's a menu in the profiler to enable/disable modules and they'll be in that list.
Audio with rooms full of people is by far the biggest data usage in our experience
So rooms with lower player counts will help because the data is exponential based on player count in the room
@Normcore Assistant, how exactly can I change the datastoreFramDuration property?
Let me check the knowledge base for you. One moment! :books:
----------------------
The
datastoreFrameDuration
property is a part of the Room
class in Normcore. You can adjust this property in your script where you have access to the Room
instance. Here's a simple example of how you might do it:
Remember, setting this value lower results in more frequent updates, but also higher bandwidth usage. You'll rarely want to send updates more often than 20hz. Typically, even 10hz works well with Normcore.
You can find more details about the Room
class and its properties in the Normcore Documentation (https://normcore.io/documentation/reference/classes/Normal.Realtime.Room).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@690217885540417680> kapa.ai is still learning and improving, please let us know how it did by reacting below