Skip to content

Dulanic/pghero

 
 

Repository files navigation

PgHero

A performance dashboard for Postgres

See it in action

Screenshot

🍊 Battle-tested at Instacart

Build Status

About this fork

This is a fork of ankane/pghero that normalizes query text out of pghero_query_stats into a pghero_queries lookup table.

Upstream stores the full query text on every capture row. With multi-database installs and a 5-minute capture interval that adds up fast — on the install this fork was developed against, 6.17 M stats rows held only 6.6 K distinct queries, with the same text repeated ~692 times each. pghero_query_stats was 2.4 GB; ~1.8 GB of it was duplicated text. After this patch and a VACUUM FULL, the same data fits in 785 MB plus an 8 MB lookup table (67% reduction).

The change implements ankane/pghero#381, which @ankane acknowledged and added to the roadmap in 2021 but hasn't shipped yet. This fork carries it forward against the current codebase. See the CHANGELOG entry for the rollout (Stage 1 additive migration → rake pghero:backfill_query_ids → Stage 3 drops the legacy columns). New installs go straight to the normalized schema; existing installs upgrade in place with the pghero:normalize_queries generator.

A docker/ directory ships a Dockerfile that layers the patch onto ankane/pghero:v3.8.0 and bakes both migrations so a container restart applies them.

Everything below this section is upstream documentation and applies unchanged.

Documentation

PgHero is available as a Docker image, Linux package, and Rails engine.

Select your preferred method of installation to get started.

Related Projects

  • Dexter - The automatic indexer for Postgres
  • PgBouncerHero - A dashboard for PgBouncer
  • pgsync - Sync Postgres data between databases
  • pgslice - Postgres partitioning as easy as pie

Credits

A big thanks to Craig Kerstiens and Heroku for the initial queries and Bootswatch for the theme.

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

About

A performance dashboard for Postgres

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Ruby 77.3%
  • HTML 20.7%
  • Dockerfile 1.6%
  • Shell 0.4%