Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 09-14-2010, 02:31 PM   #1
plamzi
Senior Member
 
plamzi's Avatar
 
Join Date: Nov 2009
Home MUD: bedlam.mudportal.com:9000
Home MUD: www.mudportal.com
Posts: 292
plamzi is on a distinguished road
Post MySQL for CircleMUD Player Saves: Thoughts

Hi,

I'm currently in the process of hooking up a fairly antiquated CircleMUD 2.0 code-base into a MySQL server running on the same box (Ubuntu 10+). The first stage is the player rent (equipment) files, and that's now being tested prior to release.

I expected MySQL to be just as fast, if not faster, than file r/w, but instead I'm noticing a tiny 'hiccup' when a player enters and exits the game. All EQ is loaded in one query result from an indexed table so I'm not sure what I can do to make this go away. I think I can live with what looks like a step back in speed because I intend to do a lot with 'unique' player objects and MySQL seems like the only practical way to go. Still, I'm wondering if there's something else I can do to speed up the request?

As a broader question, I was wondering if anyone else out there has been using MySQL for a similar purpose and what their experience is/was with response times/reliability etc. in a production/live setting.

For those who are not familiar with CircleMUD, it normally auto-saves all players every 5 minutes or so, and also every time their equipment changes. The OOB config places each player's objects inside a binary (later versions text) file. It's an ongoing r/w that sometimes causes loss of individual players' equipment due to file corruption, etc. (This is another reason for the SQL port.)

P. S. On a separate note, I can share some MySQL conversion code for CircleMUD if anyone is interested in going the same route.

Last edited by plamzi : 10-22-2010 at 01:33 AM.
plamzi is offline   Reply With Quote
Old 09-14-2010, 02:46 PM   #2
Newworlds
Legend
 
Newworlds's Avatar
 
Join Date: Aug 2007
Name: NewWorlds
Home MUD: New Worlds
Posts: 1,382
Newworlds will become famous soon enoughNewworlds will become famous soon enough
Re: MySQL for CircleMUD Player Saves: Thoughts?

Most Mud Progs autosave player files with a quick r/w throughout game play in case of crashes, etc. This isn't unusual. What is unusual is your lag on player/equipment load and should have nothing to do with SQL server data processing as it is extremely fast.

Are you sure this isn't related to your server itself, internet link, or server lag?

I'm also concerned that you are getting abnormal file corruption on your player files. Is this often? You may check into your box you are using.
Newworlds is offline   Reply With Quote
Old 09-14-2010, 05:54 PM   #3
plamzi
Senior Member
 
plamzi's Avatar
 
Join Date: Nov 2009
Home MUD: bedlam.mudportal.com:9000
Home MUD: www.mudportal.com
Posts: 292
plamzi is on a distinguished road
Re: MySQL for CircleMUD Player Saves: Thoughts?

Sweetness. I switched all the mySQL tables back to myISAM from InnoDB and the irksome hiccup is gone!

Apparently, it takes a bit of experience to configure InnoDB well. I think the default settings flush the table to disk frequently, which may have caused that delay (the HD was scratching every time a player entered/left).

I think the player eq file losses happened when the MUD was young and unstable, and running under OSX. The OSX detail may be the relevant one because the server files were on an NTFS partition with open-source driver support for Darwin (MacFUSE). I haven't really had lost eq complaints since we migrated to Ubuntu. In any case, the player saves in my MUD are binary (as is the main player file) and badly need to go!

Onward to more SQL goodness.
plamzi is offline   Reply With Quote
Old 09-14-2010, 10:19 PM   #4
Newworlds
Legend
 
Newworlds's Avatar
 
Join Date: Aug 2007
Name: NewWorlds
Home MUD: New Worlds
Posts: 1,382
Newworlds will become famous soon enoughNewworlds will become famous soon enough
Re: MySQL for CircleMUD Player Saves: Thoughts?

Good news then Plamzi. I'm glad it worked out!
Newworlds is offline   Reply With Quote
Old 10-22-2010, 01:50 AM   #5
plamzi
Senior Member
 
plamzi's Avatar
 
Join Date: Nov 2009
Home MUD: bedlam.mudportal.com:9000
Home MUD: www.mudportal.com
Posts: 292
plamzi is on a distinguished road
Re: MySQL for CircleMUD Player Saves: Thoughts?

Just wanted to report back in case someone else decides to go down a similar path. It was long and tedious, and full of all-night tweakery, but now we have a CircleMUD with no real bottlenecks when it comes to permanent storage and things are looking up!

Because all player files are in SQL, I can add a new player property in minutes without having to rebuild or upgrade existing player saves. Grabbing data easily in the order and under the criteria you want and modifying only the property that needs changing (without having to rewrite the whole file) are some of the other highlights of this brave new world.

Also, the same SQL database now drives a quest-building web browser wizard which is hooked back into the MUD. The goal is to allow players to submit quest ideas online and also to kick off their own quests for other players if they provide a reward. The questbuilder website "pushes" events to the MUD code via the database, which acts like a bridge.

I'm really liking all the possibilities...
plamzi is offline   Reply With Quote
Reply


Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 10:58 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014