![]() |
Hosting Gods: How do you keep a site up and running normally when performing a backup?
I have a site with a good amount of users on it.
Everyday when my site does a backup it creates a dump of the database. It takes about a minute to dump that database, so the tables can not be written to for that time. It bothers me when this happens because the site is down for 30-60 seconds. My members think my site sucks, tell each other it sucks, and they leave to go to my competitors. It happens everyday. That's bad for my business. Is this lock normal? Or can something be done about it? My competitors sites are much bigger than mine and I dont see them crash. So I dont understand how they do it. :helpme:helpme:helpme:helpme:helpme:helpme |
Use mysql replication.... then backup from the slave. That way no mysql downtime at all.
|
Quote:
|
Quote:
|
Quote:
|
I use rsync to avoid downtime.
|
LOL!
I don't use SQL. |
Quote:
Another option would be to take a cheap 250GB dedi box at ?15/month, run the mysql slave there and use that too for backups, that way everything is spread across 3 drives, but I like the cloud availability (100%) for a replication server... |
Quote:
For technical how to - follow this tuto. It's for centos, but effectively shows all the mysql configs which is distro-independent. :2 cents: |
1. Having a secondary MySQL server as a slave and backing up from that is the best option
2. Rsyncing the binary files, while not recommended, can be "safe" for INNODB based tables, however you cannot guarantee consistency and may need to check/repair the table once restored. This is not recommended at all for InnoDB tables as you will also need to restore the binary log data, which may cause unforseen issues with other data in the database. 3. For InnoDB you can either use InnoDB hot copy, or use mysqldump with the "?single-transaction" option enabled. #1 and 3 are the preferred methods :) |
No it's not normal.
The site should not be effected by the backups. I assume they are not using rcync and doing a full backup each time which is overloading your server. Mysql can be rsynced just like everything else. |
borked is right... Best way is to back up from a slave however...
In the interim and if your site's traffic doesn't justify a separate slave box... There are a plethora of flags/options to set in mysqldump to make sure you aren't tanking your MySQL instance during a backup ;) EDIT: Check out mysqlhotcopy |
Quote:
simply copying the /var/lib/mysql/mysql directory is asking for trouble :error |
Quote:
|
well the best answer is of course never mentioned - stop using mysql.
flat files are the future. well they'll been my present for half a decade. they are fast, easy to backup, and easy to transfer. look into it. |
Quote:
|
Quote:
|
Quote:
|
Quote:
What the problem is often frequently craply designed databases. Anyone saying mysql is a hog should run something like mysqltuner on their server and see if all green lights come up. Mine do, and my most used db is 6.5GB in size, and yet mysql is only set to use 4GB of RAM. phooey. |
Quote:
|
Quote:
"What the problem is often frequently craply designed databases. Anyone saying mysql is a hog should run something like mysqltuner on their server and see if all green lights come up. Mine do, and my most used db is 6.5GB in size, and yet mysql is only set to use 4GB of RAM." Well said, & well done! :) |
Most of the time just doing a simple mysqldump of one database then the sites actual files will work fine without any downtime. As long as you do site1db, site1files, site2db, site2files, etc (instead of dumping all dbs then all files) and the databases aren't massive it will be within sync enough. It's even less of a big deal if you keep multiple backups instead of relying on one. Sure to be technical you should lock it all before the backup then unlock it but it usually isn't a big deal for a normal site or small group of them on a server.
|
Quote:
|
Quote:
|
Quote:
Curious who you use for the cloud service? |
Quote:
|
Quote:
Have you tried scheduling the backup for a very slow time when there are the fewest users on? -if no, check your logs to see when that usually is and change the backup time to match. Many people do maintenance between 12AM Midnight to 3 AM, but that can often be a bad time when factoring in the location of the server and time zone of most visitors. So don't be surprised if the slowest, more ideal time ends up being somewhat later, such as around 6 AM. Ron |
Quote:
|
Quote:
|
Quote:
:thumbsup |
chaze aka "DWHS" is a complete newbie, pretty obvious from his posts and hosting operation.
|
Your members run for the hills over 60 seconds of downtime? I have trouble with both Google and Yahoo every day, have never considered going somewhere else? Temporary glitch.
|
Quote:
|
Do you backup when you know you have the least amount of people on your site?
|
Quote:
http://www.ovh.ie/cloud/ |
Quote:
|
All times are GMT -7. The time now is 02:17 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123