|
#1
|
|||
|
|||
|
IMHO, it would probably save both support and customers much grief (ie. max connections errors, suspended accounts) by disabling persistent connections altogether in PHP.INI (especially if 25 concurrent is the max which is on the low side)
mysql.allow_persistent Off This way, even if the customers' software has persistent enabled, this directive will automatically and seamlessly switch it to mysql_connect without having to modify scripts or configurations on the user side. It'll be a win-win situation for everyone
|
|
#2
|
||||
|
||||
|
Sounds nice, but what about people who NEED persistent connections?
|
|
#3
|
|||
|
|||
|
Quote:
Actually, many shared hosts disable it outright because it causes A LOT of unnecessary problems with server resources. Dedicated servers, ok now that's a different story. If anything goes wrong then at least it won't affect other customers
|
|
#4
|
||||
|
||||
|
Oddly, you would use a persistent connection to reduce server load. Opening and closing connections puts a heavy load on mySQL/PHP. So a script that needed to read and write a lot to a database using mysql_connect() instead of mysql_pconnect() would greatly increase the server load as it opened and closed the connection many times.
Of course, if the mysql_pconnect() is used and sits idle it burns processor juice too, so that is why they don't want anyone using mysql_pconnect(). Correctly used, mysql_pconnect() is really a good thing in some cases. Neat! A way to handle the "too many connections" thing: http://dev.mysql.com/doc/refman/5.0/...nnections.html |
|
#5
|
|||
|
|||
|
Quote:
Furthermore, the default apache config is not set up to correctly deal with it. A lot of fine-tuning and tweaking is needed to make it work properly even when it may be a good idea to use it. Especially the MaxRequestsPerChild setting which defaults to 0 (unlimited). Otherwise runaway scripts / child processes cause all sorts of havoc with load and memory. Btw the new mysqli extension in PHP 5 has dropped support for persistent connections alltogether. Last edited by twisty; 12-02-2005 at 08:24 AM. |
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
All times are GMT -5. The time now is 09:55 PM.








