Pear DB - Connection compression

I've used the PEAR DB library for over the past ten years.

Whilst building a failover infrastructure project, I noticed that performance going cross-site was poor.
I eventually worked out that the MySQL library as part of PEAR DB doesn't turn on compression.

Turning it on is relatively simple - just a few lines to change in the mysqli.php file:

pear-db-diff.jpg

And the performance difference is quite striking.

Here's the network traffic stats from a MySQL server hosted on Digital Ocean and AWS Lightsail:

pear-db-diff-1.jpg
pear-db-diff-2.jpg



Want to get in touch?