Oracle 5.0 Reference Manual page 2646

Table of Contents

Advertisement

Mysqlnd replication and load balancing plugin (mysqlnd_ms)
bool
master_on_write
string
trx_stickiness
$mysqli->set_charset("latin1");
$mysqli->real_escape("this will be escaped using latin1");
/* server_charset implicitly set - utf8 connection */
$mysqli->query("SELECT 'This connection will be set to server_charset upon
/* latin1 used from now on */
$mysqli->set_charset("latin1");
?>
If set, the plugin will use the master server only after the first
statement has been executed on the master. Applications can
still send statements to the slaves using SQL hints to overrule the
automatic decision.
The setting may help with replication lag. If an application runs an
the plugin will, by default, use the master to execute all
INSERT
following statements, including
avoid problems with reads from slaves which have not replicated the
yet.
INSERT
Example 20.289. Master on write for consistent reads
{
"myapp": {
"master": {
"master_0": {
"host": "localhost"
}
},
"slave": {
"slave_0": {
"host": "192.168.78.136",
"port": "3306"
}
},
"master_on_write": 1
}
}
Please, note the
quality_of_service
1.2.0-alpha. It gives finer control, for example, for achieving read-
your-writes and, it offers additional functionality introducing
levels.
All
transaction stickiness
settings, including trx_stickiness=on,
are overruled by master_on_write=1.
Transaction stickiness policy. Supported policies:
(default), master.
The setting requires 5.4.0 or newer. If used with PHP older
than 5.4.0, the plugin will emit a warning like
trx_stickiness strategy is not supported before
PHP
5.3.99.
If no transaction stickiness policy is set or, if setting
trx_stickiness=disabled, the plugin is not transaction
aware. Thus, the plugin may load balance connections and switch
connections in the middle of a transaction. The plugin is not
transaction safe. SQL hints must be used avoid connection switches
during a transaction.
2626
statements. This helps to
SELECT
filter introduced in version
disabled
(mysqlnd_ms)
service

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents