Simulate multiple concurrent players


Im trying to run some simulations on the server to see how it behaves in various states. One scenario is many players walking around at the same time.

I couldnt find a way to do it in the documentation.

My solution to this was to register and log in with around 100 accounts from one computer using a simple script. It works in the sense that players are getting logged in and they are walking around randomly.

However, there is some sort of max limit. when roughly 80 acounts are logging in the server seem to close connections for whatever reason:

{"level":"info","ts":"2024-03-26T09:43:43.892Z","caller":"server/session_ws.go:517","msg":"Closed client connection","uid":"85aef082-0acd-4e66-8a21-e5701df68f31","sid":"559a8cc5-eb55-11ee-a855-006100a0eb06"}

So my question is, Whats going on :slight_smile: Is it because the clients are run from the same network? I tried with 2 different computers and same result. So maybe my network is getting overloaded?

Best regards

I think you should be able to get higher numbers than that, have a look at our benchmarks.

However, it’s hard to say what the issue could be, there’s a plethora of things to consider: host/client machine configuration, host/client resources, network bandwidth, network configuration, Nakama server configurations, db configuration, client script logic, etc.

Any one of these can create misleading results, benchmarks are tricky. Is there nothing else in the server logs besides the disconnects?

Yes, ive seen those benchmarks. I understand that this one is a tricky one. But i would have hoped some sort of error message was shown in the log file. But its not :expressionless: This leads me to believe that this could be related the the client… altought now when i think about, i did try it on 2 different machines with no success. I will continue the investigation :slight_smile:

btw, what are the possible configurations in nakama that could lead to a problem like this?

i managed to identify the problem. It was due to the fact the players where too close to eachother and sent their positions to all of them. When i spawn them in different locations in the world it works flawlessly. I need to optimize the way i broadcast messages to players in the same batch of chunks.

1 Like