简体   繁体   中英

Amazon RDS speed

I would like to know if this is ok. I signed up for amazon RDS web service to speed up my PHP application. I have basic debian virtual server and some queries take 4s to execute. So I thought hosting on amazon's cloud could speed up the running time. So I exported database, imported to amazon RDS and found out that running time is almost 2 times higher.

One of the reason could be type of account I have - free (db.t1.micro). Second - I am in EU and availability zone is set to US-WEST-1 (for some reason I couldnt select EU). However, I checked only SQL execution time, without network time so the distance shouldnt matter in this case.

So is it slower than non-cloud solution just because of type of account? My database is not that big - around 25MB.

There are many reasons why a database query could be slow:

  • complexity of the query
  • tables not set up well (eg no indexes)
  • power of the machine it's running on (AWS micro instances are likely weaker than your laptop)
  • network latency between database machine and client machine (I have a case on my hands in which the client does close to 1000 queries in a single page load; both the RDS instance and the web server are basically idle all the while, yet the page load is super slow (~2 secs) because close to 1000 queries need to traverse the AWS internal network between EC2 instance and RDS instance back and forth)

You need to figure out what of this applies to you and how you can mitigate it. There's no general answer for why something is slow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM