2

I have an application running on an ec2 m3 instance and mysql running on an dRDS instance. They're both in the same, region, VPC hwoever they appear to be in different availability Zones.

The issue is that running queries can be excruciatingly slow - I'm talking about delays that run above 700ms to over a second. I'm suspecting the delay is on account of connecting to the RDS server but am not particularly sure.

What exactly can I do to totally reduce / eliminate this delay. On my localhost the same queries take less than a quarter to half a millisecond at most. I've checked at off peak times with little to no traffic and even with a dump of my live data on my localhost. So the issue cannot be with regards to heavy traffic or data mass.

==EDIT===

Here are specs of the RDS instance:

Instance and IOPS

Instance Class: db.m3.medium

Storage Type: Provisioned IOPS (SSD)

IOPS: 1000 Storage: 100 GB

3
  • what are the specs of the RDS instance?
    – Mike
    Apr 16, 2016 at 12:43
  • @Mike Please check my edited question
    – Ali
    Apr 16, 2016 at 12:54
  • How are you measuring performance? What query are you running when you test this? Please connect using the command line client and run a trivial query (eg select 1) and post the time it takes. Run the same query from your PC, if you can connect from there. Inter-AZ latency is less than 2ms.
    – Tim
    Apr 21, 2016 at 0:39

1 Answer 1

2

Cross AZ latency should be quite low (e.g. Sub <25ms)

If your application queries are in series and not parallel then it will require round trip time across the AZ's (the time will be cumulative of the series).

I would create an ec2 machine in the same AZ as the RDS instance and use ping between your ec2 instances to work out your base latency.

Then you could try running your application out of the same AZ and benchmark the application performance (is it the same, is it better, is it worse). Logically the performance should improve.

1
  • I think your suggestion of testing from an instance (eg spot) in the same AZ is valid, but I doubt it's the AZ. AZ latency is < 2ms. It could be the query, it could be some weird configuration, database issue (as opposed to connectivity), etc. OP needs to do basic problem solving.
    – Tim
    Apr 21, 2016 at 1:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .