MySQL/Memory optimization
#1

I have a fairly large server using SQL to save most stats and I was wondering which of these following ways is better.
Load all stats into bug enums (Ex: PlayerInfo) and only update them on logout.
or
Get rid of enums like PlayerInfo completely and just load/save stats into the database whenever needed.
or
A healthy mix of both?

My server is hosted on a fairly decent VPS but I still want to make it as optimized as possible.
I'm wondering if using SQL directly would speed up things in the script because it doesn't have to load stats that are never used.

Thanks for answers in advance!
Reply
#2

Quote:
Originally Posted by Germanator
Посмотреть сообщение
I have a fairly large server using SQL to save most stats and I was wondering which of these following ways is better.
Load all stats into bug enums (Ex: PlayerInfo) and only update them on logout.
or
Get rid of enums like PlayerInfo completely and just load/save stats into the database whenever needed.
or
A healthy mix of both?

My server is hosted on a fairly decent VPS but I still want to make it as optimized as possible.
I'm wondering if using SQL directly would speed up things in the script because it doesn't have to load stats that are never used.

Thanks for answers in advance!
I was thinking asking the same question, haha.

I thought the same. I think, as a matter of logic, is faster to read/write in memory and then dumping all the data to the files, but you got the disadvantage of losing data on a crash and having slightly more code in your script.

I use whatever method suits my needs at that particular time. If its lots of data to read/write constantly, i use memory. If the data is randomly accessed, i save to a file.

Lets wait the answer from the experts.
Reply
#3

Bump?
I'd really like to hear the opinion of an expert on this topic.
Reply
#4

If your server has 8 GBs of ram (like most hosts) i'd use RAM as mysql queries take a while, and if you save in memory with 8 GBs you won't notice the extra 100 kb. Actually, scratch that, 100 KB you won't even notice on 512 mb RAM, use enum's, imo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)