in Education by
I have an EC2 instance (medium, us-east-1d), and RDS instance (us-east-1a, db.t2.medium). I have a PHP page with a few dozen queries. Every single query takes consistently about 22 to 23ms. Which is crazy slow, it should take perhaps 1 or 2 ms each (locally each query takes less than 1 ms). Any thoughts on how to find out why these queries are so slow? The database is fairly small, there are plenty of indexes, that's not the issue. It's RDS somehow being really slow. Partial list of queries and how slow they are: (check the first one which consistenly takes > 100ms). UPDATE We stopped using RDS and moved the database onto the EC2 instance itself, and now it's blazing fast. I still don't know what happened with the RDS instance, but this fixed it. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Probably a simple answer, relating to the speed of light... The "slow" server (usually 23ms) is hundreds of miles/kms from your client. The "fast" server (usually 0.5ms) is in the same building as your client. To further confirm time, run a simple SELECT 1, preferably several times. That should measure mostly the lag between client and server. If the server were on the other side of the globe, the timing, even for SELECT 1, would be over 200ms. The ultimate limit is the speed of light (until the next Einstein figures out that wormholes really exist). If you are stuck with a long network lag, and you need to avoid it, we can talk about writing a Stored procedure with several queries in it; and then a single cross-network CALL to execute it.

Related questions

0 votes
    I realize a couple of basic differences between the two, i.e. EC2 is going to be cheaper RDS I wouldn't ... just high SELECT volume. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I'm trying to enable Slow Query Logging on mysql 5.7 and getting this error: 2016-04-27T14:55:51 ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
0 votes
    By default, MongoDB automatically logs slow queries above _____ ms to the log. (1)16 (2)100 (3)64 (4)264...
asked May 23, 2021 in Technology by JackTerrance
0 votes
    I'm fairly new to python and web-scraping in general. The code below works but it seems to be ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I am facing issue of very slow result. I am sharing table structure as and results also. if you ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    So I have some code which copies files to 5 remote PCs on the network. I have a class which ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    In some cases, it is found that a large number of colliding molecules have energy more than thereshold value, yet the ... is slow. Why? Select the correct answer from above options...
asked Jan 4, 2022 in Education by JackTerrance
0 votes
    It's a sad fact of life on Scala that if you instantiate a List[Int], you can verify that your ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 4, 2022 in Education by JackTerrance
0 votes
    WHY AND WHEN DO WE ADD SPACES BEFORE OR AFTER A STRING?? please explain this VERY URGENT. HELP BRAINLY MEMBERS… WILL MARK BRAINLIEST.. Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    What statement BEST describes why the Big-O notation is a very useful way of analyzing algorithm complexity? ... analyzing algorithms Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    MAHESH FOUND IT VERY DIFFICULT TO COPY FILES ON DOS AND REQUESTED HIS BOSS TO GET WINDOWS LOADED ON HIS SYSTEM. GIVE THE REASON WHY Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    Am trying to create a proxy for my hana db which will be called from a lamda function to write to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    Am trying to create a proxy for my hana db which will be called from a lamda function to write to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I'm attempting to copy my MySQL database from an Amazon EC2 to an RDS: I successfully did a mysqldump of ... easy question. Thoughts? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I want to automate the launch of a set of Linux EC2 instances. Basically, I want to write a script/program that ... in Amazon AWS/EC2? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
...