I run a task in my Python application of ~100K jobs which takes around 5 hours, since the beginning my in RDS instance CPU starts growing...
Instance type: Postgresql 9.5 | db.t2.large
I have the following performance counters:
CPU 68.1%
Memory 7,250 MB
Storage 4,010 MB
Read IOPS 0.55/sec
Write IOPS 27.2/sec
Swap Usage 0 MB
Settings:
max_connections {DBInstanceClassMemory/12582880}
pg_stat_statements.track ALL
shared_preload_libraries pg_stat_statements
tcp_keepalives_count 1
tcp_keepalives_idle 120
tcp_keepalives_interval 60
temp_buffers {DBInstanceClassMemory/512}
track_activity_query_size 2048
I'm using pganalyze to monitor database.
Any pointers how to debug CPU increase? All 100K job consist of same queries (1 inserts/4 updates per job).