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

SQL lags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 02-11-2015 , 10:57   SQL lags
Reply With Quote #1

I write plugins using MySQL, but then data sends in base on server occurs 0.5 s lags. Then i off data send lags off. Why it happen? Any ways to store data without MySQL? Data gets only on plugin start. Game - CSGO. Data - 7x (10x (int, string(40), string(1, float)).
Kailo is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 02-11-2015 , 11:03   Re: SQL lags
Reply With Quote #2

Do you use threaded mysql?
KissLick is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 02-11-2015 , 12:20   Re: SQL lags
Reply With Quote #3

I use SQL_FastQuery for sending data.
Kailo is offline
aexi0n
AlliedModders Donor
Join Date: Nov 2014
Location: bhop_deluxe
Old 02-11-2015 , 12:39   Re: SQL lags
Reply With Quote #4

You need to use threaded MySQL queries or your server will lag every time you send a query.
https://wiki.alliedmods.net/SQL_%28S...g%29#Threading
aexi0n is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 02-11-2015 , 13:39   Re: SQL lags
Reply With Quote #5

Quote:
Originally Posted by aexi0n View Post
You need to use threaded MySQL queries or your server will lag every time you send a query.
https://wiki.alliedmods.net/SQL_%28S...g%29#Threading
Yep
KissLick is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 02-11-2015 , 15:22   Re: SQL lags
Reply With Quote #6

just to understand quickly, fastquery will send a query to sql and will freeze the server proccess until it done, threaded sql will send the query into an thread so the game proccess is not affected and it will call a function callback when done.
Mathias. is offline
ClassicGuzzi
Veteran Member
Join Date: Oct 2013
Location: Argentina
Old 02-11-2015 , 15:33   Re: SQL lags
Reply With Quote #7

Quote:
Originally Posted by Black-Rabbit View Post
just to understand quickly, fastquery will send a query to sql and will freeze the server proccess until it done, threaded sql will send the query into an thread so the game proccess is not affected and it will call a function callback when done.
Exactly and you can send one argument to that callback.

Also if you are just checking for errors on the callback, you could reuse the same function multiple times.
ClassicGuzzi is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 02-11-2015 , 16:00   Re: SQL lags
Reply With Quote #8

I understand. I alredy fix it. Solved.

Last edited by Kailo; 02-11-2015 at 16:01.
Kailo 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 20:21.


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