We just restored a snapshot of one of our Postgres databases in RDS. The instance used to be a db.t2.xlarge, and we turned it into a db.r5.large. It has a GP2 SSD volume of 100GB.
r5.large instances are supposed to be "EBS optimized", yet I'm having a surprisingly low read IOPS, as shown in the graph below.
This is the result of a SELECT COUNT(*)
on a large table. For the same query, our t2.xlarge instance has no trouble reaching 1250 IOPS. There doesn't seem to be any bottleneck elsewhere: the CPU is roughly at 0%, and there's plenty of memory available.
Furthermore, the AWS documentation seems to indicate that I could expect at least 300 IOPS for a volume that size:
GP2 is designed to offer single-digit millisecond latencies, deliver a consistent baseline performance of 3 IOPS/GB (minimum 100 IOPS) to a maximum of 16,000 IOPS
(see https://aws.amazon.com/ebs/features/)
Why is the r5.large so slow?