I have a RDS MySQL Aurora DB(db.t2.medium) hosted in us-east region
A select query returning around 25k(5 MB) rows is taking around 3 mins.(When executed by my back-end(same VPC as DB) and executed by me via MySQL workbench from India)
Same query on the dump of same db on my local is taking around < 2 seconds(using MySQL workbench) and is returning same no of rows(25k).
I've checked out the CPU utilisation metrics of my db instance and there are no spikes/surprises there.
My db is hosted in us-east region and I am executing the query from India using MySQL workbench.
One thing to note that when the query is executed by my backed on db(they are in the same VPC) still the query is exactly slow.
When i hit the query from India via MySQL workbench to my RDS instance the duration time is under a second but the fetch time is around 3 mins(with or without VPN).
duration vs fetch
When i hit the same query on dump of same db on my local, the duration is almost same but the fetch time is around 1 second(same no of rows).
I am not sure why there is no much of difference is fetch time?
Related
We are in the process of migrating our databases from an MSSQL Server AWS RDS instance onto an AWS MySQL 8.0.17 RDS instance
Our web application uses ORM/hibernate for database interactions, with 1 application tied to 1 database
the database server currently contains 172 db's, with roughly 260 tables per db (44,479 tables in total), setup with 1 user with access to all db's (there are only 4 other system/aws users returned from "select * from mysql.user")
the process of starting up an application requires ORM to inspect the informaton_schema
unfortunately, this is currently taking over 10 minutes to start a single web application, as the MySQL database seems to be struggling with accessing the information_schema, usually stuck on the status "checking permissions" for upto 5 seconds and also seems to be performing hundreds of these lookups per database
on our staging server, the same web application started up in under a minute, due to only having 8 db's rather than 172
we have since recreated the same slowness issue by adding the additional 164 db's to the staging server, indicating that the issue lies with the number of db's/tables on the server
we've already applied the below settings but this hasn't improved the performance:
innodb_stats_on_metadata=0
innodb_stats_persistent=0
Does anyone have any ideas on how we can optimise MySQL further to get the desired performance.
Any help / advice to speed up our schema queries is greatly appreciated
Thanks
I'm using MyISAM table.
On the local server we didn't have any queries problems but when I moved to amazon rds we started having problems with long queries and big inner joins in the client application.
Configs:
max_execution_time = 0; (i try to set on maximum but have any changes).
Before on the local server it took a long time but brought the results to amazon I get a time out error image below..
Can someone help me?
Im using the official mysql node module in a node module.
The connecting to the database happens instantly. When I execute a query though, t takes almost ten/twenty seconds for a response. The next time the query (identical SQL) is executed it is near instantaneous.
This only happens on my local machine (speaking to the same mysql database) but not on my production server(where the mysql database is located).
I had to edit my timeout values on my local machine to allow the queries to not timeout.
Edit: to clarify, I am not running a local db. I'm speaking to the production DB when I'm running from my local machine.
What could be happening here?
I have noticed that my mysql instance on Amazon's RDS is running quite slow. When I run:
SELECT NOW()
From my local computer, it takes 0.2ms to run. When I run that same query on rds, it takes 35.1ms to run -- even running these multiple times to rule out caching it's about that value.
What are some things I can do or tools I can use to figure out why the rds server is running so slow?
I have a query that does multiple joins on several tables and uses a covering index. It seems to run a lot faster when executed directly from the mysql cli instead of from mysql workbench.
mysql > some query
...
250 rows in set (0.05 sec)
from mysql workbench it takes about ~0.200 sec duration / 0.100 sec fetch
Is there a reason beyond latency, authentication and transfer of data why it would be orders of magnitude faster on the console? Does a three-way tcp handshake occur each time a query is executed from mysql workbench or does that tcp connection stay open until you close the workbench session?
There's a persistent connection in Workbench, so there's no overhead in that regard. Executing a query should be equally fast in both CLI as well as Workbench, however data transfer is a bit slower sometimes because Workbench locally caches results first to be able to sort over it when the user clicks a header field in the resultset view (including multi column sort). Try repeating the query in both tools and see if the times still differ. The first run of a query is usually slower than following runs due to the execution cache.