Re: REPOST: one long lived connection or one connection per query

2005-02-21 Thread Gleb Paharenko
Hello.



>queries will likely be spaced out by hours or days (idle disconnect?)



How long does it take to establish a new connection? If the time 

is large enough, may be you should make a temporary connection and

close it after timeout. If you deside to use a persistent connection,

don't forget about xxx_timeout variables.







Tommy McNeely <[EMAIL PROTECTED]> wrote:

> (REPOST: I never got my original post, or any answers, so I am 

> reposting, assuming it was lost in the mail)

> 

> Hi,

> 

> I apologize in advance, I am sure this question has been asked dozens

> of times, but my searches came up empty.

> 

> I am building an IRC based application "bot" (using libmysql) .. that

> will take commands from users (!mybugs, !mybugs KEY !newbugs, !bug ID, 

> etc), do

> SQL queries and of course dump formatted results back to the channel.

> Currently its setup to open a single DB connection at initialization

> and use that connection over and over... would it be better or worse to

> have it open/close a connection for each "command" in the way a web app

> would?

> 

> Some things to keep in mind :)

> 

> - IRC server/services bot is half way across the US from the mySQL

> server (connection reliability?)

> - queries will likely be spaced out by hours or days (idle disconnect?)

> - when one person does a query, its almost assured that there will be

> 10 more within 10 seconds, its contagious or something :)

> 

> - I would *like* to do SSL (still studying how to do that), so that

> will most certainly increase the mysql_real_connect() time?

> 

> Does the client library maintain a "pool" of connections or something

> like that?

> 

> Thanks in advance,

> Tommy

> 

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



REPOST: one long lived connection or one connection per query

2005-02-18 Thread Tommy McNeely
(REPOST: I never got my original post, or any answers, so I am 
reposting, assuming it was lost in the mail)

Hi,
I apologize in advance, I am sure this question has been asked dozens
of times, but my searches came up empty.
I am building an IRC based application "bot" (using libmysql) .. that
will take commands from users (!mybugs, !mybugs KEY !newbugs, !bug ID, 
etc), do
SQL queries and of course dump formatted results back to the channel.
Currently its setup to open a single DB connection at initialization
and use that connection over and over... would it be better or worse to
have it open/close a connection for each "command" in the way a web app
would?

Some things to keep in mind :)
- IRC server/services bot is half way across the US from the mySQL
server (connection reliability?)
- queries will likely be spaced out by hours or days (idle disconnect?)
- when one person does a query, its almost assured that there will be
10 more within 10 seconds, its contagious or something :)
- I would *like* to do SSL (still studying how to do that), so that
will most certainly increase the mysql_real_connect() time?
Does the client library maintain a "pool" of connections or something
like that?
Thanks in advance,
Tommy
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]