BlueG MySQL Plugin - Limitation Question
#1

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

BlueG's MySQL Plugin https://sampforum.blast.hk/showthread.php?tid=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.
Reply
#2

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.
Reply
#3

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
Reply
#4

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.
Reply
#5

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
Reply
#6

First things first: Why do you want to save -what- every minute for every player in a database?
Reply
#7

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/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)