A
A
alex--n2022-02-28 23:00:13
PHP
alex--n, 2022-02-28 23:00:13

Why do 30 fpm processes create 60 persistent db connections?

Hello! There is a postgress base with a limited number of connections. There is fpm with 30 processes. But if I make a request for pg_stat_activity, then it gives out 60 clogged connections. The connection is set up like this:

$dbh = new PDO(sprintf('pgsql:host=%s;dbname=%s;port=%s;sslmode=prefer', $dbHost, $dbName, $dbPort), $dbUser, $dbPass, [
                PDO::ATTR_PERSISTENT => true,
            ]);


Because everything is in the cuber cluster, I checked it scaled -1 under, then scaled +1 and the number of connections changed exactly to 60.
It happened after changing the php version from 8.0.1 to 8.0.15. Maybe there is information that has changed and what needs to be checked / changed so that the number of connections returns to normal?

Processes:
21 www-data 20 0 666060 71700 50208 S 3.7 0.6 0:45.89 php-fpm8.0
26 www-data 20 0 666044 69800 48336 S 1.7 0.6 0:44.46 php-fpm8.0
13 www-data 20 6614 6688 46428 S 1.0 0.5 0:44.48 php-fpm8.0
16 www-data 20 0 667504 74560 52532 S 1.0 0.6 0:45.77 php-fpm8.0
19 www-data 20 0 663388 69828 51072 S 1.0 0.6 0.6 .0
38 www-data 20 0 665048 73024 52352 S 1.0 0.6 0:48.26 php
-
fpm8.0 0:00.02 top
1 root 20 0 574192 36200 29060 S 0.0 0.3 0:02.01 php-fpm8.0
9 www-data 20 0 664396 67288 46724 S 0.0 0.5 0:46.43 php-fpm8.0
10 www-data 20 6136 48344 S 0.0 0.5 0:43.19 php-fpm8.0
11 www-data 20 0 670100 74988 50372 S 0.0 0.6 0:45.62 php-fpm8.0
12 www-data 20 0 663452 66036 46544 S 0.0 0.5 .0
14 www-data 20 0 666396 72892 50516 S 0.0 0.6 0:44.86 php-fpm8.0
15 www-data 20 0 663300 64524 46836 S 0.0 0.5 0:45.73 php-fpm8.0
17 www-data 20 0 663076 66492 48352 S 0.0 0.5 0:47.09 php-
fpm8.0 0.0 0.6 0:45.60 php-fpm8.0
20 www-data 20 0 661864 64768 48228
S
23 www-data 20 0 665052 67684 46764 S 0.0 0.6 0:49.23 php-fpm8.0
24 www-data 20 0 664900 66492 46436 S 0.0 0.5 0:44.87 php-
fpm8.0 0.0 0.5 0:46.19 php-fpm8.0
27 www-data 20 0 666896 73732 51564 S 0.0 0.6 0:49.01 php-fpm8.0
29 www-data 20 0 667776 71812 48196 S 0.0 0.6 0:44.88 php-fpm8.0 30 www-data 20 0 664168
66908 46708 S 0.0 0.5 0:45.69 php-fpm8.0
0.0 0.6 0:45.10 php-fpm8.0
32 www-data 20 0 667280 69756 48412
S
34 www-data 20 0 663408 70452 50488 S 0.0 0.6 0:42.07 php-fpm8.0
35 www-data 20 0 664876 65100 46780 S 0.0 0.5 0:48.69 php-
fpm8.0 0.0 0.6 0:44.22 php-fpm8.0
37 www-data 20 0 664712 69552 50228 S 0.0 0.6 0:44.03 php-fpm8.0
302 root 20 0 18512 3376 3016 S 0.0 0.0 0:00.00 bash

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question