agligich wrote:tx
it was very usefull to read about pconnect
and proved me that i definatly need to stick to using it
i have seportate boxes for db and web servers and i have high traffic
Can u recomd anything to help me deal with this issue
You have misunderstood what you read. Not unusual, I did myself at first, and most people do. That was why I pointed you to our discussions on this issue.
- persistent connections are NOT closed when you use mysql_close(), they are only killed when you restart the server. (which is why you currently have to keep restarting it to keep your app running) AND THERE IS NO WAY ROUND THIS
- they are not pooled for other processes to use, they are only reused if the very same process, NOT SCRIPT BUT INSTANCE OF THAT SCRIPT, needs to reconnects - unlikely to actually happen with a web app.
- this means that you end up with a whole load of running connections that are not being used, nor can they be used since the web server process that created them no longer exists.
- so you hit your max connections limit - and will do however big you make it - cos you cannot make it infinite
Persistent connections would be of value if you had a server script permanently running to e.g. mirror you db, log transactions, or process something for client scripts; since that process would still have the same identity every time it needed to use a db connection and so would get the benefit of pconnect.