php / php/php-src

Non-persistent MySQL connections are not being closed in Cacti.

オープン
#11,750 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

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

説明

Description

I have been investigating a problem with Cacti where it opens a new database connection on every 5 minute poll interval, and never closes them, eventually running the DB server out of connections, even with the max_connections set to 1000. It is a new install of Cacti, I am not upgrading.

Eventually I figured out that configuring Cacti to use persistent database connections solved the issue. So there is a workaround.

I am seeing the biggest problem with the long-running daemons, one for cacti itself called cactid, the other for a cacti plugin called flowview. The service for that one is called "flow-capture".

The cacti project is claiming that they have never had to worry about closing connections before and they think something probably changed in PDO.

This is the issue I opened on Cacti for the problem:

https://github.com/Cacti/cacti/issues/5401

PHP Version

PHP 8.1.2-1ubuntu2.13

Operating System

Ubuntu 22.04

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

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

はじめの一歩

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

調査の方向性

まず、リンクされたCacti issueをコンテキストとして使用し、PHP 8.1.2で非永続的なMySQL接続を使った場合のcactidおよびflow-captureデーモンにおける接続数の増加を再現します。5分間隔のポーリングを繰り返す間のPDO接続のライフサイクルを追跡します。完了の条件は、接続が蓄積してMySQLが上限に達するのではなく、解放されることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
mysql, php
領域
backend, database
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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