Run Stress Test with 1000 CCU

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

votagusvotag
Posts: 38
Joined: 07 Nov 2016, 12:26

Run Stress Test with 1000 CCU

Postby votagusvotag » 26 Feb 2019, 18:52

Hi, I'm currently trying to run a stress test with 1000 CCU with the C# API 1.7.11a with

Code: Select all

ThreadSafeMode = false
and I'm having some trouble trying to make it work, it runs okay with less than 100 CCU, but once it pass it there seems to be so much events to process in the client that it becomes really slow, thus making imposible to keep creating more. The last thing I tried is to create 50 instances and then wait for 10 seconds to process the connection, login and joining the lobby events, then create another 50 instances, but after 2 loops the 10 seconds aren't enough to process all the events, I'm not doing (for now) anything else with the already created instances, but I guess sfs does.
The weirdest part is that the test seems to run smoother in an Amazon ec2 t2.micro (1 CPU 3.3GHz, 1 RAM) (but it gets killed because of the ram comsumption) rather than a m5.large (2 CPU 3.1GHz, 8 RAM), so I'm completely lost. I also tried to manipulate the ThreadPool in C# without noticing any difference.

What would be the recommended hardware to run this test?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Run Stress Test with 1000 CCU

Postby Lapo » 27 Feb 2019, 08:16

Hi,
the ThreadSafeMode is simply a way to avoid the problem of concurrency in Unity, as you can't call the Engine methods from threads other than the main one.

For a stress test it would be best to not use Unity at all and simply write your client as a .Net/Mono client, using ThreadSafeMode = false.

As regards the 1000 CCU test I need more info on what you're doing.
If you have seen this article:
https://smartfoxserver.com/blog/buildin ... test-tool/
we explain how to build a basic test client and then create a "replication tool" that generates multiple instances of the client.

If this is the method you're following you're on the right track. As regards the 1000 CCU, the problem is that it might be hard to run them all on a single machine. Since every client needs to create a number of threads (let's say 5-6) you will end up with 1000s of them and it can be quite performance heavy on a single computer.
My advice would be to run the test over multiple machines, maybe 3-4 and if you have access to AWS it should be pretty easy to set it up with a bunch of t3.small or t3.medium, I suppose.

As for SFS2X it will require its own dedicate machine, of course. Other than that you should be good to go.
Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
votagusvotag
Posts: 38
Joined: 07 Nov 2016, 12:26

Re: Run Stress Test with 1000 CCU

Postby votagusvotag » 27 Feb 2019, 20:18

Thanks for the answer,

For a stress test it would be best to not use Unity at all and simply write your client as a .Net/Mono client, using ThreadSafeMode = false.

Yes, the client is pure .Net.

As regards the 1000 CCU test I need more info on what you're doing.

The test is actually quite heavy, every client joins to a game room (up to 10 clients per room) and does 1 request every 80 ms to move around the arena.
I can run up to 100 clients per machine (t3.medium as you recommended).
The method I used is not exactly the same described in the article, but it works quite similar, I create a client and wait until the login is done to create the next one.

I think it works fine, but I don't know if it could work better.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Run Stress Test with 1000 CCU

Postby Lapo » 28 Feb 2019, 09:02

Hi,
yeah if you're running a fast packet rate test you will likely need to split the clients on numerous machines, or try with beefier clients such as large or xlarge type servers.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Alexwek and 78 guests