-1

I have an m4.10xlarge EC2 instance and a AWS RDS, both running MySQL 5.7 with same data.

I tried running a few complex queries (cross joins, nested select) on them, and found that the EC2 instance has consistently better performance (lower duration and fetch time).

Can I safely conclude the EC2 database, which has more CPUs, has better performance than RDS, which has Provisioned IOPS (SSD)?

RDS specs:

enter image description here

Avery235
  • 3,198
  • 6
  • 32
  • 72
  • 1
    Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. – Asdfg Dec 22 '17 at 13:07
  • 1
    It is not a fair comparison that you are using `m4.10xlarge` EC2 instance and the RDS instance is `db.t2.medium`. The "t" series gives you burst CPU and hence won't give a consistent CPU performance – krishna_mee2004 Dec 22 '17 at 13:39
  • To put some numbers to @KrishnaKumarR: an `m4.10xl` has 40 virtual CPUs and 160 GB RAM, while a `db.t2.medium` has a fractional allotment of 2 virtual CPUs and 4 GB RAM. – kdgregory Dec 22 '17 at 13:46
  • @KrishnaKumarR Since fetch time depends on disk I/O and not CPU, why does the RDS (SSD) has slower fetch time than EC2 (HDD)? – Avery235 Dec 22 '17 at 13:47
  • @Avery235 - because fetch time is almost never the determining factor in how a database performs. Also: why did you configure the EC2 instance with HDD and not SSD? – kdgregory Dec 22 '17 at 13:50
  • @kdgregory oh my mistake, it's actually SSD. I suppose there's no point using RDS unless I'm starting an instance that costs more than the EC2... – Avery235 Dec 22 '17 at 13:56
  • 2
    @Avery235 - the point is that RDS is a managed service. Which means that AWS handles updates and backups, along with monitoring, and gives you the ability to create read-replicas and automatic failover. For that you pay about a 50% premium over the cost of the same-size EC2 instance. I don't know about you, but my time is _far_ more expensive than that. – kdgregory Dec 22 '17 at 14:10
  • 1
    @Avery235 a t2.medium does not have as large of an Ethernet connection to the EBS volumes (remembering that they are network-attached storage) as an m4.10xlarge. The numbers aren't published but anecdotally I would expect the m4.10xlarge to have perhaps 8x the network throughput of the t2.medium, multiple Gbit/s vs. < 1 Gbit/s. – Michael - sqlbot Dec 22 '17 at 15:20
  • 1
    This is not fair comparison in the first place, i.e. m4.10xlarge (40 vCPU 160GB RAM) vs db.t2.medium(24vpcu 4GB RAM) . DBMS engine with huge amount of RAM can play many tricks compare to a system with less RAM. Nevertheless, db.m4.10xlarge $7 is a premium compare to ec2 m4.10xlarge $2 price tag. But it is about your requirement. If you don't need a 24x7 DBMS and just need batch processing, you can even take risk of loading the DBMS on a spot instance e.g. m4.16xlarge – mootmoot Dec 22 '17 at 15:43

1 Answers1

0

No. You cant conclude so. You should use equivalent specs in RDS too. Also,right configuration of the db parameter groups play a great role in giving the optimal perfomance output from RDS.

  1. You should use a better spec for your rds instance.
  2. Configure the parameter group variables to match the global variables of your Ec2 setup to get similar performance.
Nans
  • 669
  • 3
  • 10