How can CPU utilization be low but the Average Active Sessions be high?

0

I was originally using a t2.micro db instance for my RDS Postgres db.
The queries became very slow, and when I looked at the rds console, I saw that cpu was low, but that the Current Activity sessions bar was red.

You can see in this screenshot when I looked at the perf insights, that Sessions was over the vCPU number. https://i.imgur.com/1QoVPBf.png
And the main issue looks like it is waiting for the CPU.

So now I have increased my db instance to a t3.large, and CPU util is very low, and Current Activity sessions is below the limit. https://i.imgur.com/K7sRLAi.png
But I don't understand why the RDS dashboard originally said the CPU util was low when it looks the issue was the CPU in the first place?

HTZ
질문됨 4년 전1918회 조회
1개 답변
0
수락된 답변

You are using a burstable instance. In the case of a t2.micro that means you are getting a baseline performance of 10% of a vCPU. When you use less than baseline you accumulate CPU Credits. When you use more than baseline you use CPU Credits. When you exhaust your CPU Credits you are stuck at baseline performance. So what you will see is CPU Utilization of 10%, but that means you are using 100% of baseline. You could verify you are running out of CPU Credits by looking at CPUCreditBalance and CPUCreditUsage https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MonitoringOverview.html

For more explanation on burstable instances see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-credits-baseline-concepts.html

You've addressed this in one of the two ways I'd recommend, going to a t2.small; now your baseline is 20% of a vCPU. The other way would be to use a t3.micro, which RDS supports in Unlimited Mode. Those still burst, but can accommodate much longer periods of bursting before (instead of limiting you to baseline) you are charged for the excess usage. The T3 is 30% faster than the T2, so between a faster CPU meaning you can do more without eating into your credits, the way Unlimited lets you borrow against future credits, and that if you do use up the credits you just pay more instead of being locked into the low baseline performance, the t3.micro might also solve your problem.

HalTemp
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠