Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Full text search extremely slow on a AWS RDS large instance

I have a table having 14 million rows and i am trying to perform a full text search on this table. The query for this is performing really slow, it is taking around 9 seconds for a simple binary AND query. The same stuff executes instantly on my private cluster. Size of this table is around 3.1 GB and it contains 14 million rows. Can someone explain this behavior of RDS instance?

SELECT count(*) 
FROM table_name WHERE id=97
AND match(body) against ('+data +big' IN BOOLEAN MODE) 
like image 547
user883499 Avatar asked May 22 '13 07:05

user883499


People also ask

Why is AWS RDS so slow?

Your Amazon Relational Database Service (Amazon RDS) system resources are over utilized. This can happen because of high CPU, low memory, or a workload that exceeds what your DB instance type can handle. The database is locking and the resulting wait events are causing SELECT queries to perform poorly.

How do I improve my AWS RDS performance?

An Amazon RDS performance best practice is to allocate enough RAM so that your working set resides almost completely in memory. The working set is the data and indexes that are frequently in use on your instance. The more you use the DB instance, the more the working set will grow.

How do I find slow queries in MySQL RDS?

For more information, see Monitoring DB load with Performance Insights on Amazon RDS. You can also use the slow query log (enabled in your custom parameter group) to identify slow running queries. You can then use the Amazon CloudWatch metrics to check if the amount of work done on your instance has increased.

What is read latency in RDS?

Latency – The elapsed time between the submission of an I/O request and its completion. This metric is reported as the average latency for a given time interval. Amazon RDS reports read and write latency separately at 1-minute intervals. Typical values for latency are in milliseconds (ms).


1 Answers

A high IO rate often indicates insufficient memory, or buffers too small. A 3GB table, including indexes, should fit entirely in memory of a (much-less-than) 500$-per-month dedicated server.

MySQL has many different buffers, and as many parameters to fiddle with. The following buffers are the most important, compare their sizes in the two environments:

If InnoDB: innodb_buffer_pool_size

If MyISAM: key_buffer_size and read_buffer_size

like image 74
RandomSeed Avatar answered Nov 02 '22 22:11

RandomSeed