I can’t seem to find anything about setting up connection pooling in WordPress / PHP. Is this possible, and can someone provide some info on how to do it?

I did find some docs on editing wp-db.php and changing MySQL_connect to use mysql_pconnect by that seems hacky (and isn’t really connection pooling). I found that the MySQL drivers support putting a “Pooling=True;” parameter in the connection string, but I don’t see a way to do this in WordPress.

Any ideas?

2 s
2

If you just add p: then it conflicts with MySQL Port.

So wp-config.php file you should be able to do it by replacing

define('DB_HOST','localhost');

with

define('DB_HOST','p:localhost:3306');

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *