ScriptaGames / zorbio

A 3D multiplayer WebGL game
MIT License
8 stars 1 forks source link

Remastered increased server CPU #522

Closed Jared-Sprague closed 6 years ago

Jared-Sprague commented 6 years ago

Not a lot changed server side, except for the Bot paths. If I had to guess I'd say this is related to bot paths.

screenshot from 2017-11-18 08-13-21 Figure out what changed in Remastered that made server CPU go to 100%

screenshot from 2017-11-18 08-21-57

Jared-Sprague commented 6 years ago

investigation notes: Using the version of the server in June: commit 1fe6df03230d57c1c41be73516a73bcc803f9636 Clients, CPU 2, 6 4, 7.2 6, 8.5 8, 9.5 10, 12 12, 14 14, 25 16, 30 18, 70 20, 80 22, 100

Jared-Sprague commented 6 years ago

Using latest version of master at tag 2.0.0-4: Clients, CPU 0, 3 2, 6 4, 7 6, 9 8, 11 10, 11 12, 14 14, 20 16, 40 18, 70 20, 90 22, 97

Jared-Sprague commented 6 years ago

Interesting, in the latest version when I kill all the test spheres the cpu stays high, because their clients are still connected, they are just not sending position updates. suggesting that perhaps most of the cpu load is from broadcasting, not receiving:

screenshot from 2017-11-18 09-20-19 screenshot from 2017-11-18 09-19-11

Jared-Sprague commented 6 years ago

I noticed that there is a leak somewhere in socket_uuid_map: screenshot from 2017-11-18 09-24-37

Jared-Sprague commented 6 years ago

Traced this down to a bug in node-game loop in the latest version: https://github.com/tangmi/node-gameloop/issues/4

Downgrading to 0.1.2 of node-gameloop fixes the problem

Jared-Sprague commented 6 years ago

Yep definitely fixed: screenshot from 2017-11-20 23-07-32