Unity unet command - ClientRPC roundtrip time is unexpectedly long
I created dedicated server on AWS EC2. It's unity app using NaTTraversal. If I do command line ping from client to server the ping is 48ms. If I send unity CMD to server and it comes back with RPC, the delay is about 120ms. That's very long compared to ping.
Each server frame takes 20ms (50 fps) and client frame takes 5 ms (250fps). This is otherwise empty project, just one CMD and one RPC. Connection between server and client is direct.
Where does the extra 50ish ms of delay come from?
Command line ping is 48 ms. Server frame length is 20 ms. Client frame length is 5 ms. That adds up to 73ms. But if I measure it, it's 120+ms so there's something else going on? It also fluctuates heavily even though client and server framerates and ping are relatively stable. The same effect exits in all projects with CMD-s and RPC-s.
I start a diagnostics.stopwatch when sending CMD to server and close it when RPC arrives back from server.
Your answer
Follow this Question
Related Questions
PUN rpc only in scene 0 Answers
Photon synchronization on different devices failes 0 Answers
[Command] Not being called at all 0 Answers
How to fix this rpc 2 Answers
How to command dedicated server 1 Answer