MySQL PHP API  /  ...  /  Architecture

10.4.1 Architecture

Copyright 1997-2014 the PHP Documentation Group.

The mysqlnd connection multiplexing plugin is implemented as a PHP extension. It is written in C and operates under the hood of PHP. During the startup of the PHP interpreter, in the module initialization phase of the PHP engine, it gets registered as a mysqlnd plugin to replace specific mysqlnd C methods.

The mysqlnd library uses PHP streams to communicate with the MySQL server. PHP streams are accessed by the mysqlnd library through its net module. The mysqlnd connection multiplexing plugin proxies methods of the mysqlnd library net module to control opening and closing of network streams.

Upon opening a user connection to MySQL using the appropriate connection functions of either mysqli, PDO_MYSQL or ext/mysql, the plugin will search its connection pool for an open network connection. If the pool contains a network connection to the host specified by the connect function using the transport method requested (TCP/IP, Unix domain socket, Windows named pipe), the pooled connection is 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.

Download this Manual
PDF (US Ltr) - 2.8Mb
PDF (A4) - 2.8Mb
EPUB - 456.0Kb
HTML Download (TGZ) - 395.4Kb
HTML Download (Zip) - 409.2Kb
User Comments
Sign Up Login You must be logged in to post a comment.