Raised This Month: $ Target: $400
 0% 

dbi_connect is lagging server bad


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 01-10-2007 , 17:16   dbi_connect is lagging server bad
Reply With Quote #1

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).
hlstriker is offline
s p l i t
Senior Member
Join Date: May 2006
Location: US, NC
Old 01-10-2007 , 21:13   Re: dbi_connect is lagging server bad
Reply With Quote #2

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!

Last edited by s p l i t; 01-10-2007 at 21:17.
s p l i t is offline
Send a message via AIM to s p l i t Send a message via MSN to s p l i t
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 01-11-2007 , 10:23   Re: dbi_connect is lagging server bad
Reply With Quote #3

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 !
__________________
Brad is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 01-11-2007 , 10:26   Re: dbi_connect is lagging server bad
Reply With Quote #4

Alright thanks, s p l i t and Brad. I am going to go learn to use SQLx now.
hlstriker 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 22:28.


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