|
Posted by Jerry Stuckle on 12/07/06 02:34
Vincent Delporte wrote:
> On Tue, 05 Dec 2006 22:41:06 -0500, Jerry Stuckle
> <jstucklex@attglobal.net> wrote:
>
>> Don't use persistent connections
>> Open the connection to the database once per page
>> Ensure your database queries are optimized (see the appropriate
>>database newsgroup)
>> Make as few requests as you need to to get the data
>
>
> Thanks everyone. I'll see with him how he organized his data on the
> DBMS, and go through the above too.
>
> BTW, what are "persistent connections"? Is there a different way than
> using mysql_connect() at the top of any page that needs access to the
> DBMS?
A persistent connection is one which hangs around - that is, when you
close the connection, it doesn't really "close" it - as in it doesn't
disconnect from MySQL.
When the program issues a mysql_pconnect(), the system uses an
already-established connection. This saves a little time connecting to
the database.
The down side is these connections are around, even when they are not
being used - and taking up system resources. The vast majority of
websites should use mysql_connect() instead - you don't save much in
overhead doing the connection, and save a lot of resources when no
connections are required.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|