Raised This Month: $51 Target: $400
 12% 

Efficient Queries


Post New Thread Reply   
 
Thread Tools Display Modes
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-09-2015 , 08:10   Re: Efficient Queries
Reply With Quote #11

Quote:
Originally Posted by Potato Uno View Post
Is there a reason why non-threaded queries exist then? Everyone says not to use them like as if it's AIDS (for good reason too). Can't we make the API use threaded by default, and only use non-threaded as a fallback? (Rather than allowing people to voluntarily use them?)
The new MethodMap SQL API only exposes threaded queries.
__________________
asherkin is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 07-09-2015 , 12:11   Re: Efficient Queries
Reply With Quote #12

Quote:
Originally Posted by Potato Uno View Post
Is there a reason why non-threaded queries exist then? Everyone says not to use them like as if it's AIDS (for good reason too). Can't we make the API use threaded by default, and only use non-threaded as a fallback? (Rather than allowing people to voluntarily use them?)
Non threaded queries lock up the gameserver, so its best not to use them. I have never found a situation where it was required by design to use non threaded queries.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 07-09-2015 , 19:41   Re: Efficient Queries
Reply With Quote #13

Quote:
Originally Posted by Potato Uno View Post
Is there a reason why non-threaded queries exist then? Everyone says not to use them like as if it's AIDS (for good reason too). Can't we make the API use threaded by default, and only use non-threaded as a fallback? (Rather than allowing people to voluntarily use them?)
Eventually.™
__________________
VoiDeD is offline
Puppetmaster
Senior Member
Join Date: Jun 2015
Location: Probably at a computer.
Old 07-09-2015 , 23:38   Re: Efficient Queries
Reply With Quote #14

It does seem that using non-threaded queries is easier as its a quick & dirty solution. I personally have it that way in my ranks plugin because I do not maintain a local copy of player data. While this is probably against best practice it was quick to code rather than maintaining a copy of a slice of the DB. For my 5v5 server it only takes a few milliseconds at the end of each round to do it so I did not bother threading it. On the other hand my map render plugin was quickly coded in a few short hours and makes ok-ish use of threads and is seemingly lag free since it also does not hold a local copy of the database.

Since my server only has 512MB of ram is it really such a good idea to have a local copy of the DB in sourcemod and doing my functions on that and updating in a thread rather than letting my MySQL server handle it by using non-threaded queries? Wouldn't that increase the memory usage on my server by a fair bit?
__________________

GZS Servers
Puppetmaster is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 07-10-2015 , 01:00   Re: Efficient Queries
Reply With Quote #15

Offloadig the sql stuff to an offsite server is going to improve performance and decrease memory usage... But it will have to be threaded. Even mysql on the same machine can cause you some problems, as queries are not instant.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 07:23.


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