Reading precedence to slave (1 post)

  1. nikademo
    Posted 2 years ago #

    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 ?


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • HyperDB
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic