Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOPS or Throughput? - Determining Write Bottleneck in Amazon RDS Instance

We have nightly load jobs that writes several hundred thousand records to an Mysql reporting database running in Amazon RDS.

The load jobs are taking several hours to complete, but I am having a hard time figuring out where the bottleneck is.

The instance is currently running with General Purpose (SSD) storage. By looking at the cloudwatch metrics, it appears I am averaging less than 50 IOPS for the last week. However, Network Receive Throughput is less than 0.2 MB/sec.

Is there anyway to tell from this data if I am being bottlenecked by network latency (we are currently loading the data from a remote server...this will change eventually) or by Write IOPS?

If IOPS is the bottleneck, I can easily upgrade to Provisioned IOPS. But if network latency is the issue, I will need to redesign our load jobs to load raw data from EC2 instances instead of our remote servers, which will take some time to implement.

Any advice is appreciated.

UPDATE: More info about my instance. I am using an m3.xlarge instance. It is provisioned for 500GB in size. The load jobs are done with the ETL tool from pentaho. They pull from multiple (remote) source databases and insert into the RDS instance using multiple threads.

RDS Cloudwatch Metrics

like image 523
Jeff Avatar asked Feb 18 '15 00:02

Jeff


People also ask

What is the difference between IOPS and throughput in AWS?

IOPS measures the number of read and write operations per second, while throughput measures the number of bits read or written per second. Although they measure different things, they generally follow each other as IO operations have about the same size.

What is write IOPS in RDS?

Read IOPS, Write IOPS – The average number of disk read or write operations per second. Read Latency, Write Latency – The average time for a read or write operation in milliseconds. Read Throughput, Write Throughput – The average number of megabytes read from or written to disk per second.

How are IOPS calculated AWS RDS?

Amazon RDS reports read and write IOPS separately on 1-minute intervals. Total IOPS is the sum of the read and write IOPS. Typical values for IOPS range from zero to tens of thousands per second.

How do I check my IOPS usage RDS?

You can view them by visiting cloudwatch, selecting RDS and then finding the ReadIOPS and WriteIOPS metrics for your database. Once the graph shows up, select the 1 minute granularity and “average” from the dropdown. By summing up the ReadIOPS and WriteIOPS you will see how much IOPS your operations consume.


2 Answers

You aren't using up much CPU. Your memory is very low. An instance with more memory should be a good win.

You're only doing 50-150 iops. That's low, you should get 3000 in a burst on standard SSD-level storage. However, if your database is small, it is probably hurting you (since you get 3 iops per GB- so if you are on a 50gb or smaller database, consider paying for provisioned iops).

You might also try Aurora; it speaks mysql, and supposedly has great performance.

If you can spread out your writes, the spikes will be smaller.

like image 200
tedder42 Avatar answered Nov 01 '22 21:11

tedder42


A very quick test is to buy provisioned IOPS, but be careful as you may get fewer than you do currently during a burst.

Another quick means to determine your bottleneck is to profile your job execution application with a profiler that understands your database driver. If you're using Java, JProfiler will show the characteristics of your job and it's use of the database.

A third is to configure your database driver to print statistics about the database workload. This might inform you that you are issuing far more queries than you would expect.

like image 42
Chris Betti Avatar answered Nov 01 '22 22:11

Chris Betti