Sign inSign up

xolegator/pinba-engine

By xolegator

Updated 13 days ago

MySQL & MariaDB storage engine that collects app runtime stats (timing, memory, CPU) over UDP

Image
Databases & storage
0

6.2K

xolegator/pinba-engine repository overview

Pinba Engine

MySQL (8.0, 8.4 LTS) and MariaDB (10.11, 11.8 LTS) with the Pinba storage engine plugin pre-installed and initialized. Pinba is a passive, real-time performance monitoring and profiling system: an application sends a small UDP packet at the end of each request or operation, and this database plugin receives those packets and exposes them as virtual tables for querying and aggregation.

The wire protocol is language-agnostic — a Pinba client can be embedded in an application written in almost any language. The PHP pinba extension is the most common client, but Pinba is not limited to PHP: it is useful for profiling services in any language that can send the UDP packets.

This image is a drop-in database backend for Pinboard — a web dashboard that reads from these tables and displays request-time histograms, memory and CPU usage graphs, and slow-request logs.

The plugin is built from XOlegator/pinba_engine, an actively maintained fork of the original tony2001/pinba_engine (which supported MySQL ≤ 5.6 and is no longer maintained).

Tags

Pick the tag matching your database server — the plugin is ABI-bound to the server's major.minor version.

TagDatabase
8.0MySQL 8.0
8.4MySQL 8.4 LTS
mariadb-10.11MariaDB 10.11 LTS
mariadb-11.8MariaDB 11.8 LTS

Each series tag above tracks the latest release. Immutable, version-pinned tags are also published in the form <tag>-v<version> (for example 8.4-v2.11.1 or mariadb-11.8-v2.11.1).

Quick start

MySQL:

docker run -d \
  --name pinba-db \
  -e MYSQL_ROOT_PASSWORD=secret \
  -e MYSQL_DATABASE=pinba \
  -e MYSQL_USER=pinba \
  -e MYSQL_PASSWORD=pinba \
  -p 3306:3306 \
  -p 30002:30002/udp \
  xolegator/pinba-engine:8.4

MariaDB:

docker run -d \
  --name pinba-db \
  -e MARIADB_ROOT_PASSWORD=secret \
  -e MARIADB_DATABASE=pinba \
  -e MARIADB_USER=pinba \
  -e MARIADB_PASSWORD=pinba \
  -p 3306:3306 \
  -p 30002:30002/udp \
  xolegator/pinba-engine:mariadb-11.8

Verify the plugin is active:

# MySQL
docker exec pinba-db mysql -uroot -psecret -e "SHOW PLUGINS LIKE 'pinba';"
# MariaDB
docker exec pinba-db mariadb -uroot -psecret -e "SHOW PLUGINS LIKE 'pinba';"

Ports

PortProtocolDescription
3306TCPMySQL / MariaDB
30002UDPPinba stats receiver (clients send here)

Environment variables

Inherits all standard MySQL / MariaDB image variables. The MariaDB images additionally accept the MARIADB_* equivalents (MARIADB_ROOT_PASSWORD, MARIADB_DATABASE, MARIADB_USER, MARIADB_PASSWORD).

VariableDescription
MYSQL_ROOT_PASSWORDRoot password (required)
MYSQL_DATABASEDatabase to create on first start (use pinba)
MYSQL_USERApplication user
MYSQL_PASSWORDApplication user password

What the image does on first start

  1. Starts the database server (MySQL or MariaDB).
  2. Installs the Pinba plugin (INSTALL PLUGIN pinba SONAME 'libpinba_engine.so').
  3. Creates the pinba database and initializes the schema with Pinba virtual tables.

Sending stats

Point any Pinba client at this container's UDP port 30002. Client libraries exist for many languages; the most common is the PHP pinba extension — install it on your application servers and configure:

pinba.enabled = 1
pinba.server  = <this-container-host>:30002
  • xolegator/pinboard — Symfony web dashboard that reads from this database and displays aggregated performance metrics.

Source

https://github.com/XOlegator/pinba_engine

Tag summary

Content type

Image

Digest

sha256:a4235049a

Size

229.6 MB

Last updated

13 days ago

docker pull xolegator/pinba-engine