Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD Coding (http://www.topmudsites.com/forums/forumdisplay.php?f=9)
-   -   MySQL for CircleMUD Player Saves: Thoughts? (http://www.topmudsites.com/forums/showthread.php?t=6237)

plamzi 09-14-2010 02:31 PM

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.

Newworlds 09-14-2010 02:46 PM

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.

plamzi 09-14-2010 05:54 PM

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.

Newworlds 09-14-2010 10:19 PM

Re: MySQL for CircleMUD Player Saves: Thoughts?
 
Good news then Plamzi. I'm glad it worked out!:)

plamzi 10-22-2010 01:50 AM

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...


All times are GMT -4. The time now is 01:55 AM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022