Posts: 887
Threads: 251
Joined: Jun 2011
Reputation:
0
So there's been an issue i've been having for some time, for example I have an admin command that gives a player a vehicle. And that command sends a query to insert it into the database and once the query is finished a callback is called to set up the needed info in-game. I sometimes encounter lag spikes that have a delay on the query and the query will have a three seconds delay before the cache gets called. My question is, is there a way to prevent that delay by like preventing the query from being executed again not until it has been executed successfully.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Are you using the MyISAM engine by any chance? Try switching to InnoDB. MyISAM uses table level locking which may be a problem in case of lots of concurrent inserts. InnoDB uses row level locking making this much less of a problem.
Your original inquiry can be solved by setting a variable when the query is sent and unsetting it when it has been processed.
Posts: 887
Threads: 251
Joined: Jun 2011
Reputation:
0
I am using InnoDB but the problem still persists sometimes even though the sql server is hosted on my computer, so setting a variable would solve it you say?
Posts: 887
Threads: 251
Joined: Jun 2011
Reputation:
0
17.08.2015, 22:21
(
Последний раз редактировалось PaulDinam; 18.08.2015 в 17:31.
)
I actually fixed it by using mysql_pquery instead of mysql_tquery as pquery sends simultaneous queries.