The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tags vs DB Query?
Author Message
Ultima One
Journeyman
*

Posts: 238
Likes Given: 7
Likes Received: 10 in 6 posts
Joined: Jan 2013
Reputation: 6

Ultima One

Post: #1
Tags vs DB Query?
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.

ULTIMA ONE
The modern, sphere powered Ultima Online server
02-01-2013 02:20 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Tags vs DB Query?
did you tried the built-in script profiler ?
02-01-2013 03:21 AM
Find all posts by this user Like Post Quote this message in a reply
Ultima One
Journeyman
*

Posts: 238
Likes Given: 7
Likes Received: 10 in 6 posts
Joined: Jan 2013
Reputation: 6

Ultima One

Post: #3
RE: Tags vs DB Query?
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)

ULTIMA ONE
The modern, sphere powered Ultima Online server
02-01-2013 03:54 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Wap
Journeyman
*

Posts: 138
Likes Given: 6
Likes Received: 7 in 6 posts
Joined: Mar 2012
Reputation: 3

UORPG.net

Post: #4
RE: Tags vs DB Query?
Storing all tags in the database and using db.query everywhere instead of tag reading? [Image: facepalm.gif] No, I think, it is not a good idea.

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.
(This post was last modified: 02-01-2013 03:58 AM by Wap.)
02-01-2013 03:57 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Ultima One
Journeyman
*

Posts: 238
Likes Given: 7
Likes Received: 10 in 6 posts
Joined: Jan 2013
Reputation: 6

Ultima One

Post: #5
RE: Tags vs DB Query?
Put the profiler on, and it almost doubled the load on Sphere... lagged everyone, so guess i'll use a test server Big Grin

ULTIMA ONE
The modern, sphere powered Ultima Online server
02-01-2013 05:57 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #6
RE: Tags vs DB Query?
ah i didn't know it can cause performance issue on live serversShock

good to know Big Grin
02-01-2013 06:12 AM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #7
RE: Tags vs DB Query?
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.
(This post was last modified: 02-01-2013 07:38 AM by Shaklaban.)
02-01-2013 07:36 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Ultima One
Journeyman
*

Posts: 238
Likes Given: 7
Likes Received: 10 in 6 posts
Joined: Jan 2013
Reputation: 6

Ultima One

Post: #8
RE: Tags vs DB Query?
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.

ULTIMA ONE
The modern, sphere powered Ultima Online server
02-01-2013 07:44 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Staff_Stanic
Journeyman
*

Posts: 96
Likes Given: 25
Likes Received: 14 in 8 posts
Joined: Nov 2012
Reputation: 1

Dimension Shard

Post: #9
RE: Tags vs DB Query?
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 :/
(This post was last modified: 02-01-2013 02:02 PM by Staff_Stanic.)
02-01-2013 02:00 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #10
RE: Tags vs DB Query?
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

[Image: 2nis46r.jpg]
02-01-2013 10:29 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 7 Guest(s)