|
Pinba Engine 2.11.3
MySQL Storage Engine for PHP Performance Statistics
|
Every PINBA table is a virtual view over the in-memory statistics aggregated by the engine. The table type is specified in the COMMENT of the CREATE TABLE statement. The engine ignores the physical column names and maps columns to statistics by their ordinal position.
These tables are created by default_tables.sql and are always present in a working setup.
| Table name | COMMENT | Description |
|---|---|---|
request | request | Ring buffer of raw incoming requests |
timer | timer | Per-request timer data |
timertag | timertag | Tag key-value pairs attached to each timer |
tag | tag | Tag name dictionary |
info | info | Aggregated engine-wide counters for the current time window |
status | status | Engine status: pool sizes, error counts, plugin version |
active_reports | active_reports | List of currently active report objects |
These tables are also created by default_tables.sql. Each groups requests by a fixed combination of built-in fields.
| COMMENT | Friendly name | Key fields |
|---|---|---|
report1 | report_by_script_name | script_name |
report2 | report_by_server_name | server_name |
report3 | report_by_hostname | hostname |
report4 | report_by_server_and_script | server_name, script_name |
report5 | report_by_hostname_and_script | hostname, script_name |
report6 | report_by_hostname_and_server | hostname, server_name |
report7 | report_by_hostname_server_and_script | hostname, server_name, script_name |
report8 | report_by_status | status |
report9 | report_by_script_and_status | script_name, status |
report10 | report_by_server_and_status | server_name, status |
report11 | report_by_hostname_and_status | hostname, status |
report12 | report_by_hostname_script_and_status | hostname, script_name, status |
report13 | report_by_schema | schema |
report14 | report_by_script_and_schema | script_name, schema |
report15 | report_by_server_and_schema | server_name, schema |
report16 | report_by_hostname_and_schema | hostname, schema |
report17 | report_by_hostname_script_and_schema | hostname, script_name, schema |
report18 | report_by_hostname_status_and_schema | hostname, status, schema |
Any report* type accepts an optional percentile suffix in the COMMENT:
This adds p90, p95, p99 columns (one per percentile value) after the standard columns.
These tables are user-defined — you create them for each tag name your PHP code sends. The tag name is embedded in the COMMENT.
COMMENT syntax: tag_report:<tag_name>
Columns (in order):
script_name varchar(128)tag_value varchar(64)req_count intreq_per_sec floathit_count inthit_per_sec floattimer_value floattimer_median floatru_utime_value floatru_stime_value floatindex_value varchar(256)COMMENT syntax: tag_report2:<tag_name>
Same columns as tag_report but keyed by tag_value alone (script_name not in the key).
COMMENT syntax: tagN_report:<tag1>,<tag2>,...
Groups by multiple tag values. Column order: tag value columns first (one per tag), then the standard timer/count columns.
Tag info tables aggregate timer statistics per tag value, decoupled from script name.
COMMENT syntax: tag_info:<tag_name>
COMMENT syntax: tag2_info:<tag1>,<tag2>
COMMENT syntax: tagN_info:<tag1>,...[,__server_name][,__hostname]::[percentiles]
Built-in field names prefixed with __ can be mixed into the tag list as additional grouping dimensions:
__server_name — groups by server_name field from the request__hostname — groups by hostname field from the requestPercentile suffix works the same as for report tables.
The rtag_* family mirrors the tag_* family but groups by tag value without script name as the primary key — useful for aggregating across all scripts.
| Type | COMMENT prefix |
|---|---|
rtag_report | rtag_report:<tag> |
rtag2_report | rtag2_report:<tag1>,<tag2> |
rtagN_report | rtagN_report:<tag1>,... |
rtag_info | rtag_info:<tag> |
rtag2_info | rtag2_info:<tag1>,<tag2> |
rtagN_info | rtagN_info:<tag1>,... |
The engine identifies columns by position only — the SQL column name is ignored. When defining a custom tag table:
__server_name, __hostname) follow in COMMENT order.Use scripts/smoke_test.sh to verify that your custom table definition works before deploying: