Raised This Month: $ Target: $400
 0% 

Better save system than nvault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bcKq
Member
Join Date: Dec 2012
Location: Tczew, Poland
Old 10-30-2013 , 15:41   Better save system than nvault
Reply With Quote #1

Hello, does anyone know a better save system than nvault?
I have a problem with nVault that the bigger the db is the more lags are on my server, and after a week from server start (4k players passing by * 30 classes = 120 000 records) the server crashes and deletes half of the data (resets levels for players, or changes them, well it does weird stuff).
I need a system that can handle a biig database without crashes or lags.
I have mysql on localhost with the server but will that do better than nvault?
Or maybe you know any better system?
__________________
This is my signature.
bcKq is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 10-30-2013 , 15:50   Re: Better save system than nvault
Reply With Quote #2

SQLite is another option
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 10-30-2013 , 16:06   Re: Better save system than nvault
Reply With Quote #3

I wouldn't be a problem for MySQL do handle such a small amount of records for sure, unless you have wooden server.

...and make sure to use threaded queries.

Last edited by stigma; 10-30-2013 at 16:08. Reason: More info
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-03-2013 , 12:00   Re: Better save system than nvault
Reply With Quote #4

nVault is good because it's the easiest. Depending on the amount of data and the types of queries you need to make, SQL could be a better option. If you want to continue with nVault, is it possible to change how your data is being saved to less the number of entries per-player? Give an example of each players entries.
__________________
Bugsy is offline
bcKq
Member
Join Date: Dec 2012
Location: Tczew, Poland
Old 11-05-2013 , 15:36   Re: Better save system than nvault
Reply With Quote #5

PHP Code:
Buli&Soldat \y(SuperVIP)&cod#9834110#300#0#0#248#0 
First is nick, second is class. There are X number of player data entries where X stands for number of class (about 30). The remaining data are stats, split by # (I use replace_all in loaddata)

I already use SQL and nVault together, SQL is for storing player's clans (1st table, uses IDs of players from the second one) and orders (money) + passwords (second table).
Should I make another table for Player Class Data? It would make another 30 entries per each player. Would it be better optimized than nVault?

The queries I make with nvault are:
LoadData, SaveData and that's pretty much it.

For SQL it's a lot more queries (1000+ per second?) because I use it in a function that is called each 0.1 second for EACH player (so if there are 32 players it is 32 queries per 0.1 second). I know it's not optimized and I'm working on a rewrite of this part. There are also queries made when someone says in chat like /clan, /account, /login, player connect, disconnect, synchronize data with SQL etc.

I really don't know what save system would be best for that type of databases (I really work on them a lot).
I think now I will work on pure SQL, but I have a question:
Should I use SQL queries like I do now:
PHP Code:
new Handle:hPolaczenieiErrorszError[256];
    if((
hPolaczenie SQL_Connect(g_PojemnikSQLiErrorszError255)))
    {
        new 
Handle:hQuery SQL_PrepareQuery(hPolaczenie"SELECT * FROM gracze WHERE `nick` = '%s'"g_NickGracza[id]);
        new 
szHaslo[32];
        
        if(
SQL_Execute(hQuery))
        {
            
SQL_ReadResult(hQuerySQL_FieldNameToNum(hQuery"haslo"), szHaslo31);
            if( !
equali(szHaslo"") )
            {
                
g_bZarejestrowany[id] = true;
            }
            else
            {
                
g_bZarejestrowany[id] = false;
            }
        } 
SQL_FreeHandle(hQuery);
    } 
SQL_FreeHandle(hPolaczenie); 
Or would it be better to use that module:
http://forums.alliedmods.net/showthread.php?t=227170

If you have any suggestions please post below
__________________
This is my signature.
bcKq is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-06-2013 , 05:09   Re: Better save system than nvault
Reply With Quote #6

to save player data, do it on client_disconnect and when round ends.

not do it in a forward that's called 0.1 seconds per each player on the server...

Last edited by baneado; 11-06-2013 at 05:10.
baneado is offline
bcKq
Member
Join Date: Dec 2012
Location: Tczew, Poland
Old 11-06-2013 , 06:42   Re: Better save system than nvault
Reply With Quote #7

Save player data (on nvault) is done on client_disconnect, load is done on client_connect.
I use SQL queries each 0.1 second (they are small ones, just one select, but I will change it so it will be executed like each 5 seconds).
The problem is for sure with nVault, because I had the same problem in before, back then I didn't use SQL at all.
Of course I'm talking about MySQL on LOCAL server.

So, anyone can tell me if http://forums.alliedmods.net/showthread.php?t=227170 is better than using sqlx SQL_Connect and SQL_Execute? Because I'm rewriting my SQL code anyways and I need to find the most efficient functions.
__________________
This is my signature.

Last edited by bcKq; 11-06-2013 at 06:43.
bcKq is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode