![]() |
Tags vs DB Query? - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: General Help (/Forum-General-Help) +--- Thread: Tags vs DB Query? (/Thread-Tags-vs-DB-Query) Pages: 1 2 |
Tags vs DB Query? - Ultima One - 02-01-2013 02:20 AM Hey, You have all been so helpful so far, now I have a query rather than a help request. Since there is no way to check how long a snippet script takes to run, I thought I would ask here, and maybe someone in the Sphere Dev team make provide some insight. I have heard many Rumors that 'Tags cause Lag' - I'm yet to see any solid evidence of it, but just curious. Is it true that the more tags a player has, the higher the chance of him experiencing lag? So, I was wondering, storing our Tags in a database, would querying our database be quicker than checking a tag? If the time taken is the same (or less), then maybe this could reduce the load on Sphere dramatically? I would be cautious about storing tags which update more often in the database, as the last thing I want it 100 connections to the database updating and inserting at once. We are moving to be more reliable on Stored Procedures in a database for our accounts system, 'MyUO' clone and game launcher. And just wondered about Tags. Any ideas? I could test it, but i doubt i would notice it easily without being able to time how long scripts take in ms. RE: Tags vs DB Query? - darksun84 - 02-01-2013 03:21 AM did you tried the built-in script profiler ? RE: Tags vs DB Query? - Ultima One - 02-01-2013 03:54 AM Nope, doesn't it profile all scripts though? I want to just see 1 tiny function call. (Was at work, but will try it now I am home) RE: Tags vs DB Query? - Wap - 02-01-2013 03:57 AM Storing all tags in the database and using db.query everywhere instead of tag reading? ![]() charm Wrote:I have heard many Rumors that 'Tags cause Lag' - I'm yet to see any solid evidence of it, but just curious. Is it true that the more tags a player has, the higher the chance of him experiencing lag?What is the problem to test this? Add 10k tags to player and test, will he have lags or not. I haven't heard about this anytime. RE: Tags vs DB Query? - Ultima One - 02-01-2013 05:57 AM Put the profiler on, and it almost doubled the load on Sphere... lagged everyone, so guess i'll use a test server ![]() RE: Tags vs DB Query? - darksun84 - 02-01-2013 06:12 AM ah i didn't know it can cause performance issue on live servers ![]() good to know ![]() RE: Tags vs DB Query? - Shaklaban - 02-01-2013 07:36 AM Im storing large amounts of data on mysql. For example in my shard runebooks can store 128 slots, so im storing that data on sql with a table which has 32 columns. Total rows in that table is 64,941. If you expect performance from mysql: Sql server must in the same machine with sphere. You need to know how to optimize tables, adding indexes. for example if you are putting 15000 player into a table, you need to index that table by uid column. Tags are faster, but in time they are creating high memory usage and long save times. My shard consumes 432 mb ram with 870000 items. Another shard in Turkey consumes 900 mb ram with 900000 items because they are storing everything on tags, vars etc. RE: Tags vs DB Query? - Ultima One - 02-01-2013 07:44 AM Thanks Shaklaban - this is one reason I have considered it, we do only store about 30 tags per character. RAM is not so much an issue, but save times and so on can build up quicker than you think. I guess if they get too much I can look to convert them later. We will be using mysql a lot, but no need to worry about performance our tables will all be well optimized, got plenty of experience with db management and programming ;D But thanks for giving the advice either way. RE: Tags vs DB Query? - Staff_Stanic - 02-01-2013 02:00 PM But to call something from DB to the shard will have a delay (lag). So you decreases the Save but to call back always you will cause lag?! Sorry for english :/ RE: Tags vs DB Query? - Mordaunt - 02-01-2013 10:29 PM I'm not really understanding why you would do this myself either... If the amount of tags you are running is concerning you, cut down on then where you can by making them like flags and use hexadecimal numbers. I personally wouldn't use a data base for storing tags |