问题原文
原帖链接 · trnc · CC BY-SA 3.0
We deployed an update of our software today (3 EC2 instances) and made a migration to our RDS (db.t2.medium, Postgres) which added one column to a table with ~15 rows. Before migrating, we had a CPU usage of around "2". After the migration the CPU usage increased to "60". After a db reboot, it dropped, but went up again.
As a sidenote: After migration we tried to connect using a GUI and it hanged while SSL-verification. We restartet the GUI and it worked again.
Any advice on this? Here is a screenshot with current metrics. You can clearly see the increase in usage.
We currently use PostgreSQL 9.6.2!
已采纳解答
原帖链接 · trnc · CC BY-SA 4.0
We fixed this ourselves:
The problem was, we didn't shut down our background service, which made several transactions while updating our software and the db. These transactions polluted the database. We found these transactions using this snippet:
SELECT pid, age(query_start, clock_timestamp()), usename, query,state
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
After flushing our redis queue and restarting the background services, the CPU went down to 2% again.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
