egametang / ET

Unity3D Client And C# Server Framework
Other
8.95k stars 3.06k forks source link

Performance. #372

Open juliolitwin opened 2 years ago

juliolitwin commented 2 years ago

Hello @egametang,

I did some tests with ET to see how it would behave in terms of performance, but I had some problems. First I started with a test to create 100 Robots, when it gets around 30, the server becomes totally unfeasible, with a huge processing slowness. In debug mode, you can see various throw issues.

I performed the following tests:

All were slow in the test of 100 robots.

Am I doing something wrong?

Here's an image of the throw that gives in debug mode: https://prnt.sc/38GY4e4_DE8B

Basically I just ran the project, and executed with the command "CreateRobot --Num 100".

egametang commented 2 years ago

You may only use single process mode to start the server, and a process contains too many message forwarding, resulting in performance degradation. In addition, only one robot process is used, which will lead to a process equivalent to 100 clients running, and the message of a robot will be broadcast to 100 robots. In this way, if each robot sends a message per second, the server actually sends 100 * 100 = 10000 messages. 10000 messages go through client->gate->map->gate->client, which is very laborious to process. You need to start the server in multiple process mode to test. Single process mode is only used for development

juliolitwin commented 2 years ago

Hey @egametang, thanks for answering! :)

Regarding the processes, in the case using multiples, is there any configuration example available? I couldn't find it. I'm trying to run some configuration tests to see if I can get smooth to work, but unfortunately I haven't had any success yet.

Here is an example of the configuration I was trying:

StartProcess: https://prnt.sc/kCpquyRCu3zn

StartScene: https://prnt.sc/NubSUoYZ3NOc

Robot: https://prnt.sc/9E0VJzFOmwu6

Regarding the map specifically, I only kept one, because I didn't test yet if with more processes I would keep the robots synchronized on the same map in different processes.

egametang commented 2 years ago

You should configure the scene to different processes. From the second picture, you still configure it in process 1

juliolitwin commented 2 years ago

You should configure the scene to different processes. From the second picture, you still configure it in process 1

Thanks. I'm trying to solve it, but apparently I'm having connection problems when I end up changing the Process ID. It would be great if there was a configuration mode with this different type of processes, it would help a lot.