php / php/php-src

php-fpm process: SQLSTATE[HY000] [2002] Connection timed out with database

Aperta
#14,911 8 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@SakiTakamachi ci sta già lavorando.

Dal 11/7/2024.

Bug Extension: pdo_mysql Status: Needs Triage
Lingua principale
C
Stelle
40.4k
Fork
8.1k
Merge medio
2g 13h
PR unite (30g)
96

Descrizione

Description

I have a problem with upgrading a server from Centos to Ubuntu (both use Nginx, php, mysql, laravel application)

OS version:
  • Centos: CentOS Linux release 7.9.2009 (Core)
  • Ubuntu: Ubuntu 22.04.4 LTS
Nginx version:
  • Centos: nginx/1.20.1
  • Ubuntu: nginx/1.18.0 (Ubuntu)
PHP version:
  • Centos: PHP 8.1.29 (cli)
  • Ubuntu: PHP 8.1.29 (cli)
mysql connection is the same for both servers
php-fpm config is the same for both servers, command check php-fpm8.1 -tt
pm = dynamic
pm.max_children = 500
pm.start_servers = 50
pm.min_spare_servers = 50
pm.max_spare_servers = 350
pm.max_spawn_rate = 32
pm.process_idle_timeout = 10
pm.max_requests = 0

When the number of requests is large, the Centos server will operate normally, but the Ubuntu server will have some requests with connection timeout errors as follows:

SQLSTATE[HY000] [2002] Connection timed out {"exception":"[object] (PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection timed out at /vendor/laravel/framework/src/Illuminate/Database /Connectors/Connector.php:70)

Could you please share more knowledge about this issue?

Thank you 🙇

PHP Version

PHP 8.1.29

Operating System

Ubuntu 22.04.4 LTS

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.