WordPress.org

Ready to get started?Download WordPress

Forums

HyperDB
Reading precedence to slave (1 post)

  1. nikademo
    Member
    Posted 1 year 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 ?

    http://wordpress.org/extend/plugins/hyperdb/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic