if i have a script which insert a data then exit the script will be opened by 100 user at same time or within 2 mins
actually im doing email tracking
so pconnect is bettwe or connect is better to reduce the resource
i have close when after insert
if i have a script which insert a data then exit the script will be opened by 100 user at same time or within 2 mins
actually im doing email tracking
so pconnect is bettwe or connect is better to reduce the resource
i have close when after insert
mysql_pconnect()
drops the open connection into a pool that can be used by any other request to the same process. As such, each worker keeps the connection open until it dies. This can be acceptable if you keep the number of workers low, but as soon as you raise the number of workers then you're better off switching to mysql_connect()
. It will take slightly longer per request since the connection has to be made each time, but you will only create as many connections as there are requests, not workers.
connect uses fewer resources (idle instances of the web server don't need to keep a database connection open), but pconnect is slightly faster (don't have to open a new connection, it's already there).
You can also check this page for more info
http://php.net/manual/en/function.mysql-pconnect.php
Napoleon