Lack of interest Manual entry "Config.php options": document persistent MySQL connections

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

Steffen

Well-known member
I was wondering why I had about 2000 TCP connections in state TIME_WAIT after upgrading from vB4 to XenForo 2. The reason was that XenForo didn't use persistent database connections. Since XenForo uses the PHP extension MySQLi, you can enable persistent connections between PHP and your MySQL server by prepending p: to the hostname (http://php.net/manual/en/mysqli.construct.php). I think this should be documented. :)

Example:
Code:
$config['db']['host'] = 'p:localhost';
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
Hmm, connections to localhost should not use TCP but rather a unix socket.

Or do you have specifically disabled socket usage?
 
You are correct about the bad example, I just copy-pasted it from the manual and added p:. I think the general suggestion is still valid though (with an adjusted example).
 
Actually I wouldn't generally recommend persistent connections, though they do make sense in some cases - for example if XF is more or less the only application using the database server.
 
Back
Top Bottom