简体   繁体   中英

AWS RDS MySQL performance

I am running MySQL 8 on AWS RDS, I have an InnoDB type table with 260,000 rows inside, no extraordinary data size.

My development server features 1GB RAM, 1vCPU, and my AWS RDS server is t3.small.

SELECT Count operations take too long (average 33 seconds) and my data tables in my Laravel project time out, what could be the problem?

select count('special_cargo_id') from special_cargos

33seconds

Is special_cargo_id your PK, what is it's type, and does it fit into innodb_buffer_pool_size?

Run:

select count(1) from special_cargos;

a few times. Does it run quickly after the first time? If it does, then the reason it slows down sometimes is because you are memory starved and other data pushes your PK on that table out of the innodb_buffer_pool. If it is always slow, the PK most likely never fits into the buffer pool.

If you're trying to debug performance of your Database, RDS has a great built in tool for that.

With RDS Performance Insights you should be able to identify where the bottleneck is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM