ID:151778
![]() Apr 21 2009, 1:22 pm
|
|
When I connect to my MySQL database (not on localhost... not exactly anyway) the entire game locks and waits for the process to complete. Is there any way to make the game NOT wait for the result or is this something I must suffer through?
|
CriticalBotch wrote:
Run the query on a spawn()? Not a query, initial connection. Ran in a verb... tried adding spawn() on the new (its a datum) for giggles, didn't change anything. |
AJX wrote:
CriticalBotch wrote: Hmm. As far as I know, then, no. Best option is to generate the connection when the world loads, so you at least front-load the delay. I could be wrong of course; love to have someone correct me :) |
Yeah, the world will also lock up if you query large amounts of data, so be careful(spawn() doesn't help). I make one global connection in my game and just do a check to make sure the connection has not dropped.
var You could also set the connect_timeout in MySql really high so it never drops the connection. |
I'm curious if you're sure about this. I've inserted over 2000 rows all at once in less than a quarter of a second.
|
You need to select alot of data in order to cause the lock up, not insert data. Insert a large amount of data and then write a select statement to get all the data. You will see that the world will lock up until the data is returned. It takes about 25000 rows for my configuration to start locking up.
|
This really seems related to the connection speed between you and the MySQL server. Being on dial-up I've seen some pretty bad hang-ups from MySQL and Export() due to how long they take.
|
Nadrew wrote:
This really seems related to the connection speed between you and the MySQL server. Being on dial-up I've seen some pretty bad hang-ups from MySQL and Export() due to how long they take. My server is on my network... In fact it is on my computer, running through a virtual machine of ubuntu. My ping to my virtual computer is 1-4 MS. (1 being average, 4 being rare) But I get about a 2 second freeze when trying to connect with BYOND. (Whereas my MySQL Administrator/Query Browser will connect instantaneously.) |
I am doing the same thing on my computer. My host OS is Vista and Ubuntu is running in VMware with mysql 5.0 installed. I host the game on Vista and Connecting to mysql is instant for me, just like using Query Browser or another mysql manager program.
What is your computer specs? |
What is your computer specs?X2 2.01 1.5 G ram Surely that couldn't be making it so I can connect instantly with query browser and not with byond? :S |
Yeah. your right that was a pointless question :) .I am curious as to how bad your connection time is. What if you ran a simple recurring Connect() and Disconnect() loop like in the code below. Is the game playable? can you move around? On my system I don't notice any difference between before or after I run it.
var |
Soldierman wrote:
Yeah. your right that was a pointless question :) .I am curious as to how bad your connection time is. What if you ran a simple recurring Connect() and Disconnect() loop like in the code below. Is the game playable? can you move around? On my system I don't notice any difference between before or after I run it. Huge... Unplayable. 1 tick of function, 2 seconds of fail. |
Run the above code he supplied in an entirely new project please, and then run profiler and post the results here.
|
Run the query on a spawn()?