pgBadger: A fast PostgreSQL log analyzer

pgBadger is a PostgreSQL log analyzer build for speed with fully detailed reports from your PostgreSQL log file. It’s a single and small Perl script that outperform any other PostgreSQL log analyzer.

It is written in pure Perl language and uses a javascript library (flotr2) to draw graphs so that you don’t need to install any additional Perl modules or other packages. Furthermore, this library gives us more features such as zooming. pgBadger also uses the Bootstrap javascript library and the FontAwesome webfont for better design. Everything is embedded.

pgBadger is able to autodetect your log file format (syslog, stderr or csvlog). It is designed to parse huge log files as well as gzip compressed file. See a complete list of features below.

All charts are zoomable and can be saved as PNG images.

 

How to scale PostgreSQL on Amazon RDS using pg_shard

Apart from simplifying database administration, using Amazon RDS or a similar solution with pg_shard has another benefit. RDS instances have automatic failover using streaming replication, which means that it is not necessary to use pg_shard’s built-in replication for high availability. Without replication, pg_shard can be used in a multi-master / masterless set-up.

At this week’s PGDay UK, we demonstrated a distributed PostgreSQL cluster consisting of 4 worker nodes on RDS and 2 master nodes on EC2 with pg_shard installed (as shown below). We showed how the cluster automatically recovers when you terminate workers or master nodes while running queries. To make it even more interesting, we put the master nodes in an auto-scaling group and put a load-balancer in front of them. This architecture is somewhat experimental, but it can support a very high number of transactions per second and very large data sizes.

.. In our initial benchmarks using the CloudFormation template we saw well over 100k INSERTS/second across 4 RDS instances (db.r3.4xlarge).

PostgreSQL Performance Monitoring

VividCortex is the easiest, safest, and most detailed way to monitor PostgreSQL. Unlike other tools that just capture a few status metrics or check that a SELECT 1 query executes OK, VividCortex measures every query, every process, and every metric on your entire system, down to the microsecond, in industry-leading 1-second resolution, with no performance impact to the system itself.