How to tell if a MySQL query speed is bottlenecked by storage or CPU speed?
0
votes
1
answer
151
views
Using
MySQL 8.0.30
on Rocky Linux 9
For slow MySQL queries in general, not for a speciffic one, is there a way to tell if query speed was bottlenecked by storage speed, cpu speed, or maybe even ram memory speed ? (mainly **storage vs cpu**).
**Maybe there are certain mysql status variables related to tracking this ?**
For example I ran a slow query (~30 seconds) while looking at disk iotop
read speed, and because I seen it never read faster than around 20% of maximum ssd read speed, I assume that faster disk would not help speeding up my queries too much, and that maybe CPU (processing the data, not reading it) was the bottleneck.
**What are some better ways to do similar tests ?**
I also tried similar queries on 2 different SSDs, one having double read speed than the other, but I seen no performance differences, I always thought the storage is "weakest link" but now I need to do more tests.
Asked by adrianTNT
(206 rep)
Jan 16, 2023, 10:00 PM
Last activity: Jan 18, 2023, 01:32 AM
Last activity: Jan 18, 2023, 01:32 AM