I was configuring WordPress with HyperDBexternal link plugin on PHP 7.0 but the only I get were constant 500 errors. As I found hereexternal link PHP 7.0 is not supported by HyperDB for now - it’s rely on mysql php extension but in PHP 7.0 there is only mysqli extension. But few folks fixed it and it’s possible to use it.

curl -O https://raw.githubusercontent.com/soulseekah/hyperdb-mysqli/master/db.php
mv db.php /var/www/wordpress/wp-content/

And configure it ex. like this:

cat <<DBCONFIG > /var/www/wordpress/db-config.php
<?php
\$wpdb->save_queries = false;
\$wpdb->persistent = false;
\$wpdb->max_connections = 10;
\$wpdb->check_tcp_responsiveness = true;

\$wpdb->add_database(array(
'host'     => "master.db.host",
'user'     => "wordpress",
'password' => "random_password",
'name'     => "wordpress",
'write'    => 1,
'read'     => 1,
));
\$wpdb->add_database(array(
'host'     => "slave.db.host",
'user'     => "wordpress",
'password' => "random_password",
'name'     => "wordpress",
'write'    => 0,
'read'     => 1,
));
DBCONFIG

Now WordPress could handle crash of master database.

Sources

https://www.digitalocean.com/community/tutorials/how-to-optimize-wordpress-performance-with-mysql-replication-on-ubuntu-14-04external link