How should I simulate many clients for stress testing?

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Molix
Posts: 40
Joined: 01 Apr 2009, 19:34
Location: Toronto, ON, Canada

How should I simulate many clients for stress testing?

Postby Molix » 20 Jan 2010, 01:27

I would like to run some stress tests of our game by simulating many clients logging in. I would then play with our normal client and could see how things work when the server is busy, the room is highly populated, etc.

My first thought was to write a special client (I am using Unity) that simply created several instances of the SmartFoxClient object but ignored doing any 3D stuff. Unfortunately the .NET API delegates are static, so there is no way to properly route the events to the correct SmartFoxClient instance.

I also thought I might use the createNPC() functionality. However it seems that there is a known bug which would make this undesirable. Lapo posted the following:
We don't recommend using the createNPC() functionality if you plan to dynamically create and destroy NPCs. What you can do is separate the NPC logic from the server creating another Java application that uses the SFS API to create multiple NPCs.

Does that mean a separate java app that you run on the server which calls some other functions to simulate a 'real' client? Could someone point me in the right direction for 'faking it' / connecting and talking to the server from Java?
User avatar
Lapo
Site Admin
Posts: 21286
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 20 Jan 2010, 09:46

Using an external application is the recommended way . If you used NPCs it would be very difficult to understand how much of the performance is taken by the test part and which is taken by the actual server process.

Read here for more info:
viewtopic.php?t=4646
Lapo
--
gotoAndPlay()
...addicted to flash games
Molix
Posts: 40
Joined: 01 Apr 2009, 19:34
Location: Toronto, ON, Canada

Postby Molix » 20 Jan 2010, 12:38

Ok, so I'll try to do what I did initially, but in Flash instead of Unity. Given that (from the linked post) you seem to have had several hundred connections from a single client app, I assume the Flash API does not use static delegate (or whatever the AS equivalent is) like the .NET API. Thanks for the help. Time to go learn Flash :?
User avatar
Lapo
Site Admin
Posts: 21286
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 20 Jan 2010, 14:54

That's correct. Unfortunately C# API is not usable for that purpose due to the static delegate. This is something that we'll correct in the next major release.
Java API can also be used for load testing.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: Google [Bot] and 16 guests