Non-persistent MySQL connections are not being closed in Cacti.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.2k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie damit, das Wachstum der Verbindungen in den cactid- und flow-capture-Daemons unter PHP 8.1.2 mit nicht persistenten MySQL-Verbindungen zu reproduzieren, wobei das verknüpfte Cacti-Issue als Kontext dient. Verfolgen Sie den Lebenszyklus der PDO-Verbindungen während wiederholter Abfragen im Abstand von fünf Minuten; als abgeschlossen gilt dies, wenn die Verbindungen freigegeben werden, anstatt sich anzusammeln, bis MySQL sein Limit erreicht.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- mysql, php
- Bereich
- backend, database
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100