Mysqlnd connection multiplexing plugin (
mysqlnd_mux
)
2793
linked to the user handle. Otherwise, a new network connection is opened, put into the poolm and
associated with the user connection handle. This way, multiple user handles can be linked to the same
network connection.
20.7.9.4.2. Connection pool
Copyright 1997-2012 the PHP Documentation Group. [2230]
The plugins connection pool is created when PHP initializes its modules (
MINIT
) and free'd when PHP
shuts down the modules (
MSHUTDOWN
). This is the same as for persistent MySQL connections.
Depending on the deployment model, the pool is used for the duration of one or multiple web
requests. Network connections are bound to the lifespan of an operating system level process.
If the PHP process serves multiple web requests as it is the case for Fast-CGI or threaded web
server deployments, then the pooled connections can be reused over multiple connections. Because
multiplexing means sharing connections, it can even happen with a threaded deployment that two
threads or two distinct web requests are linked to one pooled network connections.
A pooled connection is explicitly closed once the last reference to it is released. An implicit close
happens when PHP shuts down its modules.
20.7.9.4.3. Sharing connections
Copyright 1997-2012 the PHP Documentation Group. [2230]
The PHP mysqlnd connection multiplexing plugin changes the relationship between a users connection
handle and the underlying MySQL connection. Without the plugin, every MySQL connection belongs to
exactly one user connection at a time. The multiplexing plugin changes. A MySQL connection is shared
among multiple user handles. There no one-to-one relation if using the plugin.
Sharing pooled connections has an impact on the connection state. State changing operations from
multiple user handles pointing to one MySQL connection are not isolated from each other. If, for
example, a session variable is set through one user connection handle, the session variable becomes
visible to all other user handles that reference the same underlying MySQL connection.
This is similar in concept to connection state related phenomens described for the PHP mysqlnd
replication and load balancing plugin. Please, check the
PECL/mysqlnd_ms documentation
for more
details on the state of a connection.
The proof-of-concept takes no measures to isolate multiplexed connections from each other.
20.7.9.5. Installing/Configuring
Copyright 1997-2012 the PHP Documentation Group. [2230]
20.7.9.5.1. Requirements
Copyright 1997-2012 the PHP Documentation Group. [2230]
PHP 5.5.0
or newer. Some advanced functionality requires
PHP 5.5.0
or newer.
The
mysqlnd_mux
replication and load balancing plugin supports all PHP applications and all
available PHP MySQL extensions (
mysqli
,
mysql
,
PDO_MYSQL
). The PHP MySQL extension must be
configured to use
mysqlnd
in order to be able to use the
mysqlnd_mux
plugin for
mysqlnd
.
20.7.9.5.2. Installation
Copyright 1997-2012 the PHP Documentation Group. [2230]
Information for installing this PECL extension may be found in the manual chapter titled
Installation of
PECL extensions
. Additional information such as new releases, downloads, source files, maintainer
information, and a CHANGELOG, can be located here:
http://pecl.php.net/package/mysqlnd_mux
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...