Oracle 5.0 Reference Manual page 2667

Table of Contents

Advertisement

SELECT 1 FROM DUAL should be run on a slave.
/*ms=last_used*/SELECT 2 FROM DUAL should be run on the server that has run the previous query
See Also
Predefined Constants
filter
user
Runtime configuration
mysqlnd_ms.disable_rw_split
mysqlnd_ms.enable
20.7.6.8.6.
mysqlnd_ms_set_qos
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysqlnd_ms_set_qos
Sets the quality of service needed from the cluster
Description
bool mysqlnd_ms_set_qos(
mixed connection,
int service_level,
int service_level_option,
mixed option_value);
Sets the quality of service needed from the cluster. A database cluster delivers a certain quality
of service to the user depending on its architecture. A major aspect of the quality of service is the
consistency level the cluster can offer. An asynchronous MySQL replication cluster defaults to
eventual consistency for slave reads: a slave may serve stale data, current data, or it may have not the
requested data at all, because it is not synchronous to the master. In a MySQL replication cluster, only
master accesses can give strong consistency, which promises that all clients see each others changes.
PECL/mysqlnd_ms hides the complexity of choosing appropriate nodes to achieve a certain level of
service from the cluster. The "Quality of Service" filter implements the necessary logic. The filter can
either be configured in the plugins configuration file, or at runtime using mysqlnd_ms_set_qos.
Similar results can be achieved with PECL mysqlnd_ms < 1.2.0, if using SQL hints to force the use of
a certain type of node or using the
more code and causes more work on the application side. The latter is less refined than using the
quality of service filter. Settings made through the function call can be reversed, as shown in the
example below. The example temporarily switches to a higher service level (session consistency,
read your writes) and returns back to the clusters default after it has performed all operations that
require the better service. This way, read load on the master can be minimized compared to using
master_on_write, which would continue using the master after the first write.
Since 1.5.0 calls will fail when done in the middle of a transaction if
and transaction boundaries have been detected. properly.
Parameters
connection
service_level
Mysqlnd replication and load balancing plugin (mysqlnd_ms)
master_on_write
A PECL/mysqlnd_ms connection handle to a MySQL server of
the type PDO_MYSQL,
level is to be set. The connection handle is obtained when opening
a connection with a host name that matches a mysqlnd_ms
configuration file entry using any of the above three MySQL driver
extensions.
The requested service level:
MYSQLND_MS_QOS_CONSISTENCY_EVENTUAL
plugin configuration option. The first requires
mysqli
or
2647
transaction stickiness
is enabled
ext/mysql
for which a service
,

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents