Do I need to rebuild caches or indexes after moving MySQL to a new drive?

0
4
Asked By CreativeCoder79 On

Hey everyone,

I've run into a bit of an issue after moving my MySQL database to a new drive. I'm a software engineer, and my site and app are growing quickly, but I'm not the best with sysadmin stuff. I had to migrate my growing MySQL DB to a new drive because it got too big for the old one. After a long setup process involving mounting the new drive, migrating MySQL, and reconfiguring everything, I've noticed that the performance has dropped significantly. Queries that used to run quickly now take an absurdly long time (like 45 minutes for a simple query!).

It seems like things might need rebuilding because when I execute a query the second time, it runs much faster, almost as if it's getting cached. My I/O performance has decreased drastically too—about 20 times slower than it used to be. I followed a guide for the migration and ensured all permissions were correct, but I'm left wondering if there's a deeper issue at play. My new disk is an HDD compared to the previous NVMe, and while I expected some slowdown, I didn't foresee it being this extreme.

Here's some info about my setup:
- Server: Ubuntu
- RAM: 128GB
- Processor: AMD Ryzen 9 7950X3D (16 cores)
- MySQL config based on mysqltuner recommendations

I guess my main question is: do caches or indexes need to be rebuilt after moving MySQL to a different drive, especially since I'm dealing with a notable performance drop?

1 Answer

Answered By DiskDude42 On

Well, moving from NVMe to a good old spinning HDD will definitely impact your performance. Databases require a lot of random access, which is where HDDs struggle. The only time you notice speed is when the data is cached in RAM, making the subsequent queries faster. You might want to consider getting another NVMe drive if the performance is that critical.

TechSavvyNick -

I get it, but I just want to ensure I’m not missing something else in the migration process. If it is just the HDD, I'm ready to upgrade!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.