Reading precedence to slave
-
This is my conf
$wpdb->add_database(array( //MASTER
‘host’ => DB_HOST,
‘user’ => DB_USER,
‘password’ => DB_PASSWORD,
‘name’ => DB_NAME,
‘write’ => 1,
‘read’ => 1,
));$wpdb->add_database(array( //SLAVE
‘host’ => ‘xx.xxx.0.4’,
‘user’ => DB_USER,
‘password’ => DB_PASSWORD,
‘name’ => DB_NAME,
‘write’ => 0,
‘read’ => 1,
‘dataset’ => ‘global’,
‘timeout’ => 0.2,
));But cheching mysql load it seems that hyperdb uses the slave till it has no more resources for reading then it switch to master… but my slave is worse than the master so queries are quicker without hyperdb!!! how to config it to use the slave if master mysql load exceedes a threshold ?
- The topic ‘Reading precedence to slave’ is closed to new replies.