Oracle 5.0 Reference Manual page 2668

Table of Contents

Advertisement

Mysqlnd replication and load balancing plugin (mysqlnd_ms)
service_level_option
option_value
Return Values
Returns
if the connections service level has been switched to the requested. Otherwise, returns
TRUE
FALSE
Notes
Note
mysqlnd_ms_set_qos
1.2.0. Internally, it is using a
PHP 5.3.
Examples
Example 20.302.
mysqlnd_ms_set_qos
<?php
/* Open mysqlnd_ms connection using mysqli, PDO_MySQL or mysql extension */
$mysqli = new mysqli("myapp", "username", "password", "database");
if (!$mysqli)
/* Of course, your error handling is nicer... */
die(sprintf("[%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()));
/* Session consistency: read your writes */
MYSQLND_MS_QOS_CONSISTENCY_SESSION
MYSQLND_MS_QOS_CONSISTENCY_STRONG
An option to parameterize the requested service level. The
option can either be
MYSQLND_MS_QOS_OPTION_GTID
MYSQLND_MS_QOS_OPTION_AGE
The option
MYSQLND_MS_QOS_OPTION_GTID
the service level
MYSQLND_MS_QOS_CONSISTENCY_SESSION
. It must be combined with a fourth function parameter, the
option_value. The
option_value
ID obtained from mysqlnd_ms_get_last_gtid. If set, the plugin
considers both master servers and asynchronous slaves for session
consistency (read your writes). Otherwise, only masters are used
to achieve session consistency. A slave is considered up-to-date
and checked if it has already replicated the global transaction ID
from option_value. Please note, searching appropriate slaves is
an expensive and slow operation. Use the feature sparsely, if the
master cannot handle the read load alone.
The
MYSQLND_MS_QOS_OPTION_AGE
with the
MYSQLND_MS_QOS_CONSISTENCY_EVENTUAL
level, to filter out asynchronous slaves that lag more seconds
behind the master than option_value. If set, the plugin will
only consider slaves for reading if
Slave_IO_Running=Yes,
Seconds_Behind_Master <=
searching appropriate slaves is an expensive and slow operation.
Use the feature sparsely in version 1.2.0. Future versions may
improve the algorithm used to identify candidates. Please, see
the MySQL reference manual about the precision, accuracy and
limitations of the MySQL administrative command
STATUS.
Parameter value for the service level option. See also the
service_level_option
requires PHP >= 5.4.0 and PECL mysqlnd_ms >=
mysqlnd
example
2648
.
.
shall be a global transaction
option can be combined
SHOW SLAVE STATUS
Slave_SQL_Running=Yes
option_value. Please note,
parameter.
library C functionality not available with
or
or
can be used to refine
service
reports
and
SHOW SLAVE

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents