Octalys
asked on
500pts: When to use mysql_connect and when to use mysql_pconnect. Advantages/Disadvantages, and scenario examples. Thank you.
500pts: When to use mysql_connect and when to use mysql_pconnect. Advantages/Disadvantages, and scenario examples. Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi Octalys, did you have any further questions or concerns about mysql_connect and mysql_pconnect? Just curious if your questions have been answered sufficiently. Let me know. Thanks!
ASKER
I found out that my problem was not mysql_connect or mysql_pconnect. I have 400-600 concurrent users at the same time, I needed RAM.
But mysql_connect was better than mysql_pconnect.
But mysql_connect was better than mysql_pconnect.
The problem I've heard with mysql_pconnect() is that it can tie up mysql server slots and cause you to reach your connection limit when many users are accessing your site. This is because the connections are staying open for their entire session, even if they aren't querying the database.
Personally, I do not see an advantage to using mysql_pconnect() in most scenarios. I would suggest calling mysql_connect() once at the start of your script, and then calling mysql_close() at the end of your script for the best performance.
Hope this information helps ;)