Slow queries to AWS RDS MySQL Database - mysql

Am building a project with Django REST Framework. I'm using Amazon RDS for my MySQL database, and for some reason the wait time on my calls are always around 200ms, if I connect to a local MySQL instance the time is around 8ms.
So first I thought it must be the connection time that is the problem, so I added 'CONN_MAX_AGE':60 to my database settings. This definitely made Django not create new connections looking at "SHOW PROCESSLIST;" on the DB, and brought the time down to about 190ms.
The thing is when I make queries to the RDS database vis HeidiSQL the time is around 16ms.
Anyone have any idea what is added all that time?

Related

AWS MySQL Database Disappearing

I have a MySQL database running on AWS RDS. I have a node.js server that queries the MySQL database. Everything is fine for most days but around once a week, my node server says "Unknown database."
I try to query the database with MySQL Workbench and receive the same message. I have checked my instance and it is running fine with the status being "available."
To fix the issue, I have to recreate the database which means I lose all my data.
Has anyone had issues with this? This is very frustrating since I have no idea what would cause this problem.
We‘re running MySQL RDS databases since AWS launch and never had such an issue. Are you sure the created database is really gone? Do you maybe have a job running at an interval that doesn’t work as intended? What do the RDS logs say?
To debug the issue you can
have a look at RDS server logs
enable query logging to table and analyze queries fired at the server
run a small instance which is not touched for the period to proof it’s not a RDS-related isssue
A few years later...lol. I had the same problem and realised you have to be connected to the same domain in AWS as your database. If you know the connection string of your database, find the domain it is in. Then in the top right hand side of the aws console you should see a drop down that shows the current domain you are logged into. My guess is the two are not the same. Change the value of the drop down and you should see your database.

Talend - mysql components vs amazon mysql components

I have migrated my MYSQL databases to Amazon RDS. I am trying to get the data from SQL server to Amazon RDS mysql through talend. However, the jobs run very slow. A 50000 rows insertion takes an hour of time. Whereas, when I use the Talend Amazon components, tAmazonMysqlOutput, the same job completes in less than a minute
May I know what is the reason for this? If I change all my regular mysql components to Amazon mysql components would there be any issues?
Any ideas on this would be of great help
Thanks
Rathi

How do I download an Amazon RDS database from an instance?

A while ago, I shut down an RDS instance and took a snapshot. Now, a year later, I'd like to download that database. So I restored the snapshot by creating a new instance which is up and running. But I cannot figure out how to download the db.
I have tried connecting to the database via phpMyAdmin but it keeps refusing to connect (even though I have added the IP for phpmyadmin to the security group on amazon). Is there a way to download the database via command line? Something else has to be easier...
There is no other way but connecting to your instance and using any tool you might want to use to do the job - backup
This question was answered before.
download RDS snapshot

MySQL mirroring on EC2

I'm running two MySQL server one on production and one on staging, both are EC2 Instance.
The same way i have two MySQL RDS Instances parallel to the production and staging.
Here want i wanted to do.
I would like to mirror the production database to the development server every few hours,
for 1. backup, 2. to run new features against the latest database changes.
I didn't find much information regarding this issue, can anyone help?
Thanks.
Additional information:
i'm running nginx on linux server, with php backend.
If you are running on RDS, you have two options.
Snapshot and restore your instance. You can automate this, but the time it make take more time the larger the DB is. Your endpoint will probably change too.
Dump the database from production, reload into development.

cloudfoundry tunneled mysqldump extremely slow on api.cloudfoundry.com

I am trying to backup a mysql database on a cloudfoundry app. The database in tunneled via caldecott and i can connect using mysql.
My database is 40k so far and when i use mysqldump it takes ages, i.e. after 10 min and dumping 30% - 60% of the database (depending on the run) it stops with error Lost connection to MySQL server during query (2013)
any hints?
Tricky one, I guess if your route to Cloud Foundry is a little slow you could dump each table in turn. You could do this by opting for no client when creating the tunnel and then issue the mysqldump commands yourself for the individual tables.
Failing that, you might try using VMC from a different node on the internet to see if the connection is any quicker.