We use a class for all our MySQL stuff that has some error stuff and
commonly used function combinations (like do a query then do a numrows).  In
that we create a connection only when the query method is called.  So, until
a query is run, no connection is made.  If the update server name does not
equal the select server name we make two connections.  The load saved on the
main server is well worth the connection.  MySQL is pretty fast with
connections compared to other DBMS I have used.

Brian.

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Brian Moon" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 8:57 AM
Subject: Re: MySQL over NFS


|
| > Also, what we have done is used a replicating box as a select only
server.
| > This requires you to write your code in such a way that only selects get
| > sent to the slave.  A simple function wrapper in PHP is all we needed.
|
|   I've been thinking of this idea too but it's a bit of a problem because
| we open one connection for every page request and it makes from 10 to 100
| querys (selects and updates). So it would be either opening and closing
| the connection for each query (not good I guess) or opening two
| connections, one to each server, at the beginning and then randomly
| serving them to both boxes if they're selects or to one of them if they're
| updates.
|
|   Anyway if anyone has more insights about this I'd love to hear them.
|
|   Cheers.
|
| --
|   L
|
|
|
| ---------------------------------------------------------------------
| Before posting, please check:
|    http://www.mysql.com/manual.php   (the manual)
|    http://lists.mysql.com/           (the list archive)
|
| To request this thread, e-mail <[EMAIL PROTECTED]>
| To unsubscribe, e-mail
<[EMAIL PROTECTED]>
| Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
|
|


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to