M
M
Mikhail Konyukhov2012-10-13 23:16:56
PHP
Mikhail Konyukhov, 2012-10-13 23:16:56

Want to write a module for PHP 5.4+?

Preface… Tested: using pdo-mysql, php-mysql driver, php 5.4, 1 database connection, 10 queries (1 row, 20 columns).
I got the following results:
0.0020718574523926s - creating a connection
0.0010368824005127s - 10 requests I
thought, can I make a module for php that will open connections to the database in the required amount (pool) (by the number of php-fpm processes) and keep constant connections? in my case of the above test - 66% of the time was spent on the connection, 33% - on requests. can we save 66% of the time? I can show you the test here.
actually a question (and the offer):
1. Nobody saw already ready decisions for this purpose?
2. If no one has seen, let's write them, I can write in C and PHP, do load tests, but I need a team, because I alone am rather weak in C and I will do it for a long time and not qualitatively. I propose to release the module under GPLv3 and develop it on github.
Who is ready to help?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2012-10-13
@piromanlynx

There is actually such a thing as a persistent connection (From the translation it is clear that this is a “permanent connection”). It does not rush from session to session and allows you to seriously unload the database (they will pull it less for each sneeze).
True, this is not without problems ... so you need to think before you use it. For reference, everything is fine with both PDO and mysqlii.
And another interesting read on the topic: www.mysqlperformanceblog.com/2006/11/12/are-php-persistent-connections-evil/

Y
Yuri Popov, 2012-10-13
@DjPhoeniX

connect?

A
Alexey Huseynov, 2012-10-13
@kibergus

This is called persistent connections. Included in php.ini.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question