Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Message
| For a bit of fun I wrote an application in Lua (using LuaSocket) that was designed to stress-test the Smaug FUSS server (I was using Smaug FUSS 1.9).
I was curious to see how it would react if you pumped a few hundred players through it. Specifically, would it:
- Crash?
- Exhibit extreme lag?
- Do other strange things?
- Would certain combinations of class/race not work correctly?
The Lua code was designed to create a new level 1 player from scratch, using a random name, random gender, random class and random race.
It would then move about - yes you guessed it - randomly. ;)
Interestingly the server passed the test pretty well. It was also quite good fun to watch the MUD jump into life with players running everywhere. Here is an example of running it with 500 players (plus a couple I used to monitor what was happening):
Comm: Broke all-time maximum player record: 502
Monitor: Broke all-time maximum player record: 502
<10040hp 10000m 110mv> <#21000>
who
1 Paladin Glerawyth the Keeper.
2 Thief Eowore the Footpad.
2 Warrior Agriand the Recruit.
2 Thief Oliedus the Footpad.
2 Druid Ibalena the Attendant.
2 Cleric Haolin the Attendant.
2 Druid Wylath the Attendant.
1 Cleric Kederracred the Believer.
2 Warrior Jeraenoic the Recruit.
2 Druid Griech the Attendant.
2 Thief Adweall the Footpad.
2 Cleric Nydilia the Attendant.
... and so on ...
1 Warrior Cowin the Swordpupil.
1 Mage Acelilla the Apprentice of Magic.
1 Augurer Ceawin the Docent of Wizardry.
2 Vampire Lotherra the Blood Student.
1 Thief Elardolath the Pilferer.
1 Paladin Vaeryan the Keeper.
1 Vampire Lothaledric the Apprentice of Blood.
1 Ranger Maymond the Runner.
1 Cleric Cadumond the Believer.
1 Warrior Olieth the Swordpupil.
1 Cleric Larelath the Believer.
2 Druid Aloalla the Attendant.
1 Cleric Glerana the Believer.
1 Ranger Wicuryan the Runner.
1 Vampire Larellyra the Apprentice of Blood.
1 Mage Daessa the Apprentice of Magic.
1 Warrior Raseth the Swordpupil.
1 Mage Croiwin the Apprentice of Magic.
1 Mage Dwoilgrin the Apprentice of Magic.
-----------------------------------[ IMMORTALS ]------------------------------
Supreme Entity Admin the Attendant.
502 players.
I had the bots output a random social every 20 or 30 seconds, which with 500 players made things a bit noisy. They also drank if there was a fountain there, and yelled out if they levelled:
Edeibrylla sneers in contempt.
Rorel looks innocently about itself.
Etallyra meows like a kitten.
Eowoeloth desperately seeks someone to marry.
Gwaoch begins to squeak like a mouse. Straaange.
Aoera whips out his flaming torches and begins to juggle them. Wow. What skill, what grace!
Mareder searches for a victim to tease.
Weraa leaves north.
Morenydd drinks from the fountain.
Ethalla drinks from the fountain.
Wicaectred flies in from above.
Laevudd drinks from the fountain.
Niraryan arrives from above.
Onaledon has entered the game.
Boilonna has begun to sing.
Delitlan wiggles his nose.
Eleriwyr stands and says, 'Hi, I'm Eleriwyr, and I'm a mud addict.'
Hungrily, a hollow voice asks 'What soul passes the gateway into this dominion?'
Ceaniver Looks happy! Awww whatta chum!
Gwoann looks particularly glum today. *sniff*
Merimar hits her head on a tree and cries, "Not AGAIN!?"
Halit yells 'Woooooot! Levelled!!!! (12/35 hp, 4/107 mana, 10/110 mv 3/3 prac.)'
Mendaldan looks around the room and asks everyone, "How are you?"
Cirach snaps his fingers.
Gweilla growls.
Cadash waves happily.
Daewin tightens his grip on his weapon, preparing for battle.
Wicaectred flies up.
Darkhaven Academy was a particularly busy place:
Darkhaven Academy - N -
-<---- Vnum: 10300 ----------------------------->- -<-U-(*)--->-
- S -
You stand inside the Darkhaven Academy, an establishment designed to teach
the basics of play inside this game. Each room has a specific purpose and
contains information on the various commands to maneuver around and interact
with the players. We recommend you explore the Academy in full, taking the
time to read the instructions in each room.
Type N to move north to the next room in the Academy. If you have already
completed the rigors of the Academy and wish to test your combat mettle in
the battlegrounds, type OPEN S or OPEN DOOR, then S to enter the arena.
Exits: north up.
A large marble fountain gushes forth here.
Oliedus the Footpad is standing here.
Wylath the Attendant is standing here.
Eowore the Footpad is standing here.
Kederracred the Believer is standing here.
Roavyan the Attendant is standing here.
... and so on for about 5 pages ...
Pieth the Believer is hovering here.
Ceabwyn the Runner is hovering here.
Kedardog the Believer is standing here.
Pulla the Docent of Wizardry is standing here.
Delicred the Footpad is standing here.
Nardowyth the Pilferer is standing here.
Gwerraryan the Apprentice of Blood is standing here.
Gwealath the Docent of Wizardry is standing here.
Keina the Keeper is standing here.
Jaevyan the Attendant is standing here.
Thynd the Pilferer is hovering here.
Hawtlan the Apprentice of Magic is hovering here.
The illustrious Darkhaven Academy Headmistress stands here to greet you.
Mistress Tsythia is shrouded in flowing shadow and light.
Gwiratram flies in from above.
Gwiratram flies up.
However even with 502 players, the CPU load was fairly light:
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
31368 nick 16 0 23236 22M 2380 R 13.0 3.6 3:10 0 smaug
That was around 13% CPU usage.
Response time on my client was slightly sluggish compared to normal, however that would partly be accounted for by the rather extreme quantities of network traffic. I wouldn't call it "lag" but it took a bit longer than usual to get a response.
I only had a single crash during the testing, and analyzing the crash with gdb seemed to indicate a corrupted stack, so one of the bots must have done something to cause that. Overall it was pretty stable, considering.
Conclusion
Smaug FUSS 1.9 seems to cope pretty well with 500+ players, with only slight lag, and an occasional crash.
Possible things you might change if you regularly had that many players would be to make some of the displays show summaries rather than listing every player. For example, instead of listing 300 players in one room you might say:
In the room with you are Oliedus, Wylath, Eowore, Kederracred, Roavyan and 297 other players.
It was hard to test fighting, making bots react correctly to lots of MUD input is harder than it seems. Some of the bots got into fights, which they often lost. To make fights work better you would need to make each class use its optimal attack, take into account whether it was winning or losing, be prepared to run away, heal itself, and so on. Automating all that is not particularly easy.
You also need to make the bots intelligently buy goods (eg. food), put it into bags, consume it when necessary, and so on. All in all, quite a challenge in writing an AI agent. :)
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|