Postgres using 100% of CPU

To see exactly what queries are being executed you can run something like the following from the console:

cd /var/discourse/
./launcher enter app
sudo -u postgres psql -c "select * from pg_stat_activity WHERE state='active'";

Try running this a couple of times with a 3/4 minute wait in-between, capturing the output each time.

4 Likes