rds sql query time out on aplication joins - mysql

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?

Related

First query or connection to AWS RDS is very very slow

I have a product built with laravel, with multi-tenancy.
Deployed on EC2 instance and using AWS RDS as the database server.
I am currently having around 100 databases on the production.
Laravel's hyn tenancy module is handling the connections.
Now, the problem is for each tenant after some idle time, the first request takes too long. around 15-20 seconds. and after that, it works smoothly.
In the test environment, we are not using RDS but a local MySQL instance. and the problem does not occur in the test environment. the only difference between test and production is the AWS RDS.
I have looked into max connections, query cache, and so on... but no luck so far.
Any suggestions?
The solution will depend on what kind of RDS you have.
I assume it's serverless (more common). In that case, there's a setting for min and max for ACU. It will (I believe) go down to zero by default if the DB is not accessed in a while. Check that and see if it is properly set.
If you have a Provisioned DB, then it's more complex. It will start caching things once queries are executed but until a particular query is run, you will be waiting for the DB to "wake up" and run a full query.
Check this page for relevant info.

AWS RDS MySQL Aurora extremely slow select queries

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?

AWS RDS MySQL performance issues

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

MySQL on AWS RDS facing SEARCH BY STRING performance issues

I have a development database and a production one. Both the database servers, hosted on AWS RDS (MySQL environment), were working fine till the production one has encountered major speed issues with SELECT statements for strings (using either = and LIKE). The size of the table (on production) I am searching from is about 100k rows but it can take 1min + to do a simple string search on phpmyadmin. The development db table is about 30k rows and results are returned in less than 0.1s.
Is this an AWS issue? Or some MySQL config problem. Note that this has only started occurring recently.
Extra: After I do a string search on the table, my read/write latency and queue depth shoots up. The only way I can resolve it is by making a snapshot of the server (reboot does not help).

How to find CPU utilazetion of mysql RDS instance

How to find which process/query consume CPU in amazon mysql RDS instance? I have medium instance on amazon RDS of mysql, and It is working smoothly previously, but since yesterday Its throwing error 'connection timeout' while accessing RDS instance. When I checked cloud watch, It shows me high CPU utilization during that period. Now I want to check what is the problem? So, can some one tell me how to check it?
thanks
use 'show processlist' in mysql. with this you can see which queries are in what state, doing what, since when
also check slow query log:
http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html
Using show process list, you can see only current running thread info, but as per context of your query, you want to see the historical status. You can achieve it via enabling the slow query log and setting long query time to 1 second. You can pass slow query logs to cloud watch and can set alerts according to your db system loads and types of queries.