php / php/php-src

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

オープン
#14,911 コメント 8 件 リアクション 0 件 担当者 1 名 GitHub で見る

@SakiTakamachi がすでに取り組んでいます。

2024年7月11日 から。

Bug Extension: pdo_mysql Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.1k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。