0

We have a Linux server with a RAID 1 using two HDDs on which runs a Apache server managing multiple sites and some other services that interact intensively with the databases and produce massive amounts of logs. Because the drives are not SSD but HDD, the databases is becoming very big and the I/O load is very high on the server, the database performance is very bad. We managed to make our hosting company to add to the server two HDDs.

Now I have two questions:

  1. What's the best setup for the server to increase I/O performance? I thought it would be better to put the two added HDDs into an another RAID 1 array and to move only the MySQL database to the new RAID device. That way the database would not be affected by other factors such as high quantity of logs produced by some services. Are there any better options? (OS re-install is not an option and I need the least possible down-time)

  2. Is it safe to do so? Are there risks of data loss if moving the entire MySQL data directory to another device? (I know how to do this)

  • That sounds like the right thing to do and it should be safe. Just make sure you stop MySQL before moving the folder. – Florin Asăvoaie Mar 7 '15 at 9:41
  • Yeah, that should be a good course of action, assuming that the logging done by the other services is sufficient enough to cause MySQL to run in to performance problems. – GregL Mar 7 '15 at 13:44
0
  1. No, there are no better options. I mean you can get more beast out of your system if you use RAID 0 (stripe), but that is not a clever idea under a database server, because in RAID 0 if only one disk fails: you lost everything. So, create a RAID 1 device, shut down database, copy over the files, check the permissions, and mount the new device under /var/lib/mysql (or whatever is your data directory) and start the mysql server. I'd also remove all the old files from the original location to avoid bad mount - whith old data I mean. (In MySQL you can get more and more performance giving more RAM to server, and increase buffer pool)

  2. It is safe. If MySQL server is stopped during the copy operation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.