downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Estadísticas> <Incompatibilities
[edit] Last updated: Fri, 24 May 2013

view this page in

Conexiones persistentes

Utilizar conexiones persistentes

Si mysqli se utiliza con mysqlnd, cuando se crea una conexión persistente, se genera una llamada COM_CHANGE_USER (mysql_change_user()) en el servidor. Esto asegura que la re-autenticación de la conexión se lleva a cabo.

Dado que hay una cierta sobrecarga asociada con la llamada COM_CHANGE_USER, es posible apagar esto en el tiempo de compilado. La reutilización de una conexión persistente entonces generará una llamada COM_PING (mysql_ping) para simplemente probar si la conexión es reusable.

La generación de COM_CHANGE_USER se puede apagar con el marcador de compilación MYSQLI_NO_CHANGE_USER_ON_PCONNECT. Por ejemplo:

shell# CFLAGS="-DMYSQLI_NO_CHANGE_USER_ON_PCONNECT" ./configure --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --enable-debug && make clean && make -j6

O, alternativamente:

shell# export CFLAGS="-DMYSQLI_NO_CHANGE_USER_ON_PCONNECT"
shell# configure --whatever-option
shell# make clean
shell# make

Observe que solamente mysqli sobre mysqlnd utiliza COM_CHANGE_USER. Otra combinación de extensión-controlador emplea COM_PING en el uso inicial de una conexión persistente.



add a note add a note User Contributed Notes Conexiones persistentes - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites