AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   dbi_connect is lagging server bad (https://forums.alliedmods.net/showthread.php?t=49677)

hlstriker 01-10-2007 17:16

dbi_connect is lagging server bad
 
Hi, when "dbi_connect" tries to connect to my database it lags the server so bad for 45+ seconds that you think the server crashed. Here is the code that is used, and maybe someone can help me fix this, or maybe there isn't a way to fix it.

Code:
new Sql:dbcSkills public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     set_task(7.0, "sql_init_db")         return PLUGIN_CONTINUE } public sql_init_db() {     // Connect to the database     new host[64], username[32], password[32], dbname[32], error[32]     get_cvar_string("amx_sql_host", host, 64)     get_cvar_string("amx_sql_user", username, 32)     get_cvar_string("amx_sql_pass", password, 32)     get_cvar_string("amx_sql_db", dbname, 32)         dbcSkills = dbi_connect(host, username, password, dbname, error, 32)         return PLUGIN_CONTINUE }

After 45+ seconds of major lag, it starts going again (it does connect to the database).

s p l i t 01-10-2007 21:13

Re: dbi_connect is lagging server bad
 
I imagine this is a remote host. Probably just a bad connection/route to the host as your code looks fine.

You may want to consider using SQLx!

Brad 01-11-2007 10:23

Re: dbi_connect is lagging server bad
 
I'd suggest using the SQLx natives to see what kind, if any, speed improvement you get.

Edit: Damn you, s p l i t !

hlstriker 01-11-2007 10:26

Re: dbi_connect is lagging server bad
 
Alright thanks, s p l i t and Brad. I am going to go learn to use SQLx now.


All times are GMT -4. The time now is 22:28.

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