DOL on Linux with Mono3

Discussions on various DOL development features

Moderator: Support Team

Re: DOL on Linux with Mono3

Postby Leodagan » Wed Oct 09, 2013 8:21 am

Yeah with a table using almost 3GB I understand memory can be more useful than for my inventory table of 110 MB :)

Did you try any performance optimization on Tables definition ? Like using numeric ID's, changing varchar to char (MySQL love fixed size type) reducing itemtemplate and uniqueitemtemplate ID to about 50 / 100 chars (MySQL can guess it using ANALYSE() ), setting indexes or unique constraints ? Reducing Numeric field size ? (like slotPosition that could be a 16bits unsigned.)

But DOL don't like fixed CHAR on PrimaryKey so you have to use a VARCHAR, VARCHAR forces MySQL to do a full index scan for searching a key.

I was wondering if DOL supports Database "Enum" types :) These are pretty optimized too (size does not vary between records, only when updating table schema !)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: DOL on Linux with Mono3

Postby Tolakram » Wed Oct 09, 2013 3:21 pm

I modified the DB code a while back to use numeric primary keys (auto-increment) if desired for new tables. Unfortunately this is only a small part of the problem. The latest core solved a good bit of the Inventory table issue when Graveen normalized Inventory to move uniques out and then only have inventory track character specific numbers.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: DOL on Linux with Mono3

Postby Leodagan » Wed Oct 09, 2013 4:17 pm

Yes I saw there was a great support for Auto_inc Primary Key, it needs to change some part of the table code to take advantage of this and break compatibility with Trunk Database, but it's great to be able to rely on it if there are performance issues :)

Having foreign key for item template and unique template is great too, but this table is clearly one of the most heavy one and I understand that can become a big performance issue with no specific attention to the database itself (DBA optimizations, Profiling, Etc...)

I really think that hardware capacity must be taken into account to handle a table that goes above 500 MB, a default config MySQL won't handle a huge shard inventory table... For now I just resized my CHAR field to the max itemtemplate length + UUID length, but further modification will need a data migration :)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: DOL on Linux with Mono3

Postby Blue » Thu Oct 10, 2013 10:35 am

We already use integer primary keys on all tables. But this was still not enough. Giving the database enough memory helped incredible with the query times.
ex DOL Lead Developer
Blue
Uthgard Admin
 
Posts: 961
Joined: Wed Jan 21, 2004 11:07 pm
ICQ: 63977313

Re: DOL on Linux with Mono3

Postby Leodagan » Thu Oct 10, 2013 5:33 pm

Well I keep that in mind, I think there are some experimentations about splitting big table, I'm not sure how will search algorithm handle that then (I think you'll have to split your table with an ID range, and use it as prefix to query the correct table)

Needing 3GB of RAM for 3GB Table with a player base that isn't online all at the same time looks weird in terms of pure "theoretical" computing... I hear my algorithms teacher yelling O(n) is bad :)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: DOL on Linux with Mono3

Postby Blue » Sat Oct 12, 2013 12:11 am

I used partitioning on inventorytable. Did not help much.

But yes, keep that in mind, lots of memory is of utmost importance for InnoDB. Theres not one table anymore that makes problems for us. And as I said our login procedure took up to 1000ms to query all chars (with visible items) for the account.
ex DOL Lead Developer
Blue
Uthgard Admin
 
Posts: 961
Joined: Wed Jan 21, 2004 11:07 pm
ICQ: 63977313

Re: DOL on Linux with Mono3

Postby Graveen » Sat Oct 12, 2013 11:57 am

I made some tests 2 years ago with partitionning on inventory table, and the benefits where really ridiculous. I think the requests are not enough targetted to particular fields to enjoy this feature.

Storm use MyISAM instead of InnoDB. The lack of true transactionnal is counterbalanced by regular backups, and the performance gain is noticeable.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: DOL on Linux with Mono3

Postby Graveen » Sat Oct 12, 2013 11:59 am

Anyhow, i have no ideas how it is performance related in comparison of InnoDB with tons of RAM, and if adding RAM also benefits MyISAM (or any light engine).
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: DOL on Linux with Mono3

Postby Dinberg » Sun Oct 13, 2013 7:55 pm

Does anyone remember the archiving feature DoL used to have? The idea was that every day database entries of characters not logged in for ~10days would be moved to archived databases that weren't cached. This works not just for Characters, but also inventory item, account, etc.

I can't remember exactly why it was turned off, but probably because compatability was broken. It does seem like a good solution though!
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: DOL on Linux with Mono3

Postby Blue » Sun Oct 13, 2013 8:48 pm

Anyhow, i have no ideas how it is performance related in comparison of InnoDB with tons of RAM, and if adding RAM also benefits MyISAM (or any light engine).
My point is I kept using MyISAM all the years due to performance until I've read that report about InnoDB being slow with too less memory assigned. And they were completely right. InnoDB is now outperforming MyISAM.
ex DOL Lead Developer
Blue
Uthgard Admin
 
Posts: 961
Joined: Wed Jan 21, 2004 11:07 pm
ICQ: 63977313

Re: DOL on Linux with Mono3

Postby Graveen » Sun Oct 13, 2013 9:31 pm

For thoses interested in more than a (true) assertion, here is a recent (2012) and complete bench: http://dimitrik.free.fr/blog/archives/2 ... in-56.html

Effectively, it totally outperforms massively MyISAM in many cases.
Warning anyhow:
- this is heavily related to MySQL 5.6 (although you could expect improvements with previous versions)
- a single core with 1GB ram is not really aimed by this bench

OMW to migrate Storms' to InnoDB !

:)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: DOL on Linux with Mono3

Postby Leodagan » Mon Oct 14, 2013 8:33 am

Be careful on these benchs !

They are run on server hardware that isn't detailed, but seeing tests on 32-cores/threads could be a hint that it's running with a lot of memory and great I/O ! (like 10k rpm or 15k rpm SAS drives on a RAID cache board !)

More common hardware will hit other bottlenecks than these dedicated Database Servers !
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: DOL on Linux with Mono3

Postby Blue » Mon Oct 14, 2013 3:14 pm

Something appealing about InnoDB is row level locking instead table locking.
ex DOL Lead Developer
Blue
Uthgard Admin
 
Posts: 961
Joined: Wed Jan 21, 2004 11:07 pm
ICQ: 63977313

Re: DOL on Linux with Mono3

Postby HunabKu » Mon Oct 14, 2013 4:11 pm

I think it's not objective but i fell that's more responsive on DoL with InnoDB.
"C'est l'ignorance qui apporte le chaos, pas la connaissance."
Scarlett Johansson dans "Lucy" de Luc Besson
-------------------------------------------------------------------------------
"Ignorance brings chaos, not knowledge."
Scarlett Johansson on "Lucy" by Luc Besson
User avatar
HunabKu
Developer
 
Posts: 1905
Joined: Sat Jun 18, 2011 4:48 am

Re: DOL on Linux with Mono3

Postby Leodagan » Mon Oct 14, 2013 5:34 pm

yep Row-level locking can do a great job when updating a big table like inventory ;)

And Inventory are the first source of "lagginess" that player can feel ;) (not seeing the item updated when moving it in inventory is obvious lag...)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon


Return to “%s” DOL Development Discussion

Who is online

Users browsing this forum: No registered users and 1 guest