I am using AWS RDS PostgreSQL 9.4. I am facing an issue of very high CPU utilization. Instance type is t2.xlarge (16 gb ram).
All the time I can see very low ram usage i.e. 14-1 GB free.
But in contrast, cpu utilization is 100%, with 100 active connection.
I have checked all my query in pg_stat_activity, slow query logs. Nothing found wrong. Though it touches 100% CPU utilization and my app becomes non functional even for very less active connections.
What is solution to reduce high CPU utilization against such high RAM?
When it reaches 100% CPU, my write IOPS was 400 count/second and read IOPS was 8.5 count/second.
I need to handle 300 concurrent connections sometimes when there is very high traffic on my website. What should be the ideal configuration of the RDS instance?