1 (edited by mdubois 2024-05-02 23:48:05)

Topic: MySQLi compilation and persistent connection

Dear all,

We recently started to experiment with persistent connections using MySQLi (PHP 7.4 for now). As noted in the doc (https://www.php.net/manual/en/mysqli.persistconns.php), the behaviour and performance is largely determined at compile time by setting or not MYSQLI_NO_CHANGE_USER_ON_PCONNECT (which dictates whether or not to automatically clean the connexion when opening at the cost of performance).

I assume that the MySQLi extension is build without this flag (i.e. use automatic clean up) as is the default. Right?

Is there a way I can check that (other that the source RPM)?

Thanks in advance,
Mathieu

Re: MySQLi compilation and persistent connection

> the behaviour and performance is largely determined at compile time by setting or not MYSQLI_NO_CHANGE_USER_ON_PCONNECT

Never heard about this one
BTW, I have huge doubts about big perf changes

> I assume that the MySQLi extension is build without this flag (i.e. use automatic clean up) as is the default. Right?

Indeed

> Is there a way I can check that (other that the source RPM)?

No

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: MySQLi compilation and persistent connection

Hello,

Thanks for your answers and comments.

Indeed using persistent connections requires careful thinking and testing. We use persistent connections to reduce the load on our SQL server when facing web bot attacks so we are not looking for performance gains for now.

Mathieu