SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/05/2014, 12:25 PM   #1
Grimrandomer
Big Clucker
 
Grimrandomer's Avatar
 
Join Date: Dec 2011
Posts: 131
Reputation: 64
Default BlueG MySQL Plugin - Limitation Question

This is more of a question than help, but not sure where else to post.

BlueG's MySQL Plugin http://forum.sa-mp.com/showthread.php?t=56564

Basically I want to insert into my database for each player every minute, so this will be a loop called once a minute for a max 64 players.

I use 'mysql_function_query' which has a callback and is threaded I believe.

Would 64 INSERT Queries a minute be reasonable or not (Assuming max players online)?

Thanks,

Grim.
__________________
Grimrandomer is offline   Reply With Quote
Old 15/05/2014, 12:54 PM   #2
dusk
High-roller
 
dusk's Avatar
 
Join Date: Jul 2008
Posts: 1,113
Reputation: 46
Default Re: BlueG MySQL Plugin - Limitation Question

Well yes mysql_function_query is threader and yes it is reasonable. Think about it, your server doesn't need to send those queries to the database. The plugin manages that and I'm sure it doesn't have problems with it.

If you are still not sure, upgrade to the newest version - R38 and use mysql_pquery. It let's you send parallel queries which are even faster.
dusk is offline   Reply With Quote
Old 15/05/2014, 02:24 PM   #3
Grimrandomer
Big Clucker
 
Grimrandomer's Avatar
 
Join Date: Dec 2011
Posts: 131
Reputation: 64
Default Re: BlueG MySQL Plugin - Limitation Question

I was considering writing the data it collects to files,

but i wonder if the database would store more efficiently, and since threaded, quicker than saving in files.


It would also allow me to search the data batter if stored in a database (data will be linked to the players database id)

I will be updating to r38, im on r34 I believe, is mysql_function_query supported by r38 still, avoiding updating all references would be desirable :P
__________________
Grimrandomer is offline   Reply With Quote
Old 15/05/2014, 02:29 PM   #4
Kar
Banned
 
Join Date: May 2010
Location: Black Asylum
Posts: 2,938
Reputation: 538
Default Re: BlueG MySQL Plugin - Limitation Question

mysql_tquery and the plugin supports much larger stress, 64 per minute is fine, my server sometimes does more queries than that depending on the playercount.
Kar is offline   Reply With Quote
Old 15/05/2014, 03:03 PM   #5
Grimrandomer
Big Clucker
 
Grimrandomer's Avatar
 
Join Date: Dec 2011
Posts: 131
Reputation: 64
Default Re: BlueG MySQL Plugin - Limitation Question

Ah ok.

Was just looking at my mysql server's 'Status' for the last 17 Days:


Gets an average of 31 Queries a minute at the moment, so im sure an extra (MAX 64) few more per minute wont do any harm.

Calculated average player count for the server over the last 4 months at anytime to be 7.1 ( I record player count every 5 minutes )

My only concern, is if i'm recording say 20 players a minute average ( In the future ), that's 892,800K Records a month, but this kind of data is not really needed to be kept at a one minute accuracy for more than a month, so I may instead have a cron to take 10 min averages of the data in a separate table, then a cron to remove all minute data that's older than a month. Any suggestions for a better implementation welcome and appreciated xD
__________________
Grimrandomer is offline   Reply With Quote
Old 15/05/2014, 03:08 PM   #6
Campbell-
Big Clucker
 
Join Date: Jan 2012
Location: Germany
Posts: 140
Reputation: 12
Default Re: BlueG MySQL Plugin - Limitation Question

First things first: Why do you want to save -what- every minute for every player in a database?
Campbell- is offline   Reply With Quote
Old 15/05/2014, 03:16 PM   #7
Grimrandomer
Big Clucker
 
Grimrandomer's Avatar
 
Join Date: Dec 2011
Posts: 131
Reputation: 64
Default Re: BlueG MySQL Plugin - Limitation Question

I intend to store data such as users position, speed etc. Mainly for use in reports in the forums to help validate/invalidate claims of rule breaking, but then by keeping a historical average, (So after a week data is grouped and reduced) potentially use it to build up cool maps such as grouping users position on the map into 10m squares, calculating average time users stay in said square and building up a sort of heat map, or where all the most popular robbery spots are etc



I just love having raw data, and lots of it, for analysis and looking for patterns xD
A good example here: http://playercp.lv-cnr.com/
__________________
Grimrandomer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
BlueG MYSQL plugin SlonCHL Scripting Help 2 29/11/2013 06:02 AM
BlueG MySQL plugin - Failed (plugins/mysql.so: undefined symbol: _Z13stringvprintfPKcPc) linuxthefish Plugin Development 10 13/07/2013 10:56 AM
[Ajuda] MySQL Plugin do BlueG AiaN Português/Portuguese 12 20/04/2013 04:16 AM
Question info: MySQL Plugin - BlueG Speed++ Scripting Help 3 08/07/2012 12:47 AM


All times are GMT. The time now is 11:53 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.