GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Hosting Gods: How do you keep a site up and running normally when performing a backup? (https://gfy.com/showthread.php?t=1011295)

Marcus 02-21-2011 11:10 AM

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

borked 02-21-2011 11:19 AM

Use mysql replication.... then backup from the slave. That way no mysql downtime at all.

blackmonsters 02-21-2011 11:25 AM

Quote:

Originally Posted by Marcus (Post 17930653)
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

I wondered about this too, although I don't have the problem myself.

pristine 02-21-2011 11:38 AM

Quote:

Originally Posted by borked (Post 17930681)
Use mysql replication.... then backup from the slave. That way no mysql downtime at all.

end of thread.

Marcus 02-21-2011 11:42 AM

Quote:

Originally Posted by borked (Post 17930681)
Use mysql replication.... then backup from the slave. That way no mysql downtime at all.

Do you need 2 servers for this? Im not technically savvy so dont know what the setup is for this.

Klen 02-21-2011 11:47 AM

I use rsync to avoid downtime.

blackmonsters 02-21-2011 11:52 AM

LOL!

I don't use SQL.

borked 02-21-2011 12:05 PM

Quote:

Originally Posted by Marcus (Post 17930742)
Do you need 2 servers for this? Im not technically savvy so dont know what the setup is for this.

well, technically I think you can run two instances of mysql on different ports, but by far the simplest is to run the slave on your backup server or a cheap dedi or even cloud setup. I run mine on a 256MB cloud instance that costs me 1c/hr and have no problems on it. Then that gets backed up to my remote 100GB backup space. Mysql (my most valuable data) is then spread across 3 servers... Backup of sites/configs is spread across 2 servers.

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...

borked 02-21-2011 12:26 PM

Quote:

Originally Posted by Marcus (Post 17930742)
Im not technically savvy so dont know what the setup is for this.

you need at least 2 mysql server instances, running on different ports if on the same server. Like I said above, best (and simplest) is to run mysql on another server.

For technical how to - follow this tuto. It's for centos, but effectively shows all the mysql configs which is distro-independent. :2 cents:

webair 02-21-2011 12:34 PM

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 :)

chaze 02-21-2011 01:05 PM

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.

BestXXXPorn 02-21-2011 01:40 PM

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

borked 02-21-2011 02:20 PM

Quote:

Originally Posted by chaze (Post 17930946)
Mysql can be rsynced just like everything else.

of course it can, but don't expect a simple restore, or any for that matter....

simply copying the /var/lib/mysql/mysql directory is asking for trouble :error

CYF 02-21-2011 02:23 PM

Quote:

Originally Posted by borked (Post 17931118)
of course it can, but don't expect a simple restore, or any for that matter....

simply copying the /var/lib/mysql/mysql directory is asking for trouble :error

agreed :2 cents:

plsureking 02-21-2011 02:37 PM

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.

borked 02-21-2011 02:49 PM

Quote:

Originally Posted by plsureking (Post 17931152)
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.

any chance of geospatial index support in your flat files?

chaze 02-21-2011 02:52 PM

Quote:

Originally Posted by plsureking (Post 17931152)
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.

I agree, databases are getting outdated but we still have a good 4-5 years before they are obsolete. MySQL it's simply a cpu hog and not as reliable as flat files.

plsureking 02-21-2011 02:58 PM

Quote:

Originally Posted by borked (Post 17931190)
any chance of geospatial index support in your flat files?

lol ya there's a lot of that going on in porn. nerd.

borked 02-21-2011 03:00 PM

Quote:

Originally Posted by chaze (Post 17931199)
I agree, databases are getting outdated but we still have a good 4-5 years before they are obsolete. MySQL it's simply a cpu hog and not as reliable as flat files.

This is such a fallacy - I have around 14 million mysql db hits and ~1million of those are on very complex joins involving very non-ordinary indexes. Not even taking into account the load added by apache for all those hits, my server load averages only 0.05. And I can back that up with stats to anyone who wants a private argument off the board over email...

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.

borked 02-21-2011 03:01 PM

Quote:

Originally Posted by plsureking (Post 17931217)
lol ya there's a lot of that going on in porn. nerd.

ehm, there are exactly 2-3 million daily hits using just those. Nerd :winkwink:

webair 02-21-2011 03:02 PM

Quote:

Originally Posted by borked (Post 17931218)
This is such a fallacy - I have around 14 million mysql db hits and ~1million of those are on very complex joins involving very non-ordinary indexes. Not even taking into account the load added by apache for all those hits, my server load averages only 0.05. And I can back that up with stats to anyone who wants a private argument off the board over email...

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.

My fav part:

"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! :)

signupdamnit 02-21-2011 03:12 PM

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.

woj 02-21-2011 03:20 PM

Quote:

Originally Posted by chaze (Post 17931199)
I agree, databases are getting outdated but we still have a good 4-5 years before they are obsolete. MySQL it's simply a cpu hog and not as reliable as flat files.

you are just trolling, right? :helpme

Alky 02-21-2011 03:39 PM

Quote:

Originally Posted by signupdamnit (Post 17931239)
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.

mysqldump locks the tables

wdsguy 02-21-2011 03:42 PM

Quote:

Originally Posted by borked (Post 17930811)
well, technically I think you can run two instances of mysql on different ports, but by far the simplest is to run the slave on your backup server or a cheap dedi or even cloud setup. I run mine on a 256MB cloud instance that costs me 1c/hr and have no problems on it. Then that gets backed up to my remote 100GB backup space. Mysql (my most valuable data) is then spread across 3 servers... Backup of sites/configs is spread across 2 servers.

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...


Curious who you use for the cloud service?

signupdamnit 02-21-2011 03:47 PM

Quote:

Originally Posted by Alky (Post 17931316)
mysqldump locks the tables

You can turn that off though with different options.

Ron Bennett 02-21-2011 03:57 PM

Quote:

Originally Posted by Marcus (Post 17930653)
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.

A minute or so of slowness / non-response per day isn't a biggie for most sites if that occurs at an odd time when relatively few visitors are on.

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

Alky 02-21-2011 03:57 PM

Quote:

Originally Posted by signupdamnit (Post 17931340)
You can turn that off though with different options.

didn't know that... i guess we never cared to look since we are just backing up from our slave and it doesnt effect us.

chaze 02-21-2011 07:25 PM

Quote:

Originally Posted by woj (Post 17931254)
you are just trolling, right? :helpme

And you are just wrong again right?

blackmonsters 02-21-2011 07:52 PM

Quote:

Originally Posted by plsureking (Post 17931152)
well the best answer is of course never mentioned - stop using mysql.

Please see post number 7.

:thumbsup

pristine 02-21-2011 08:00 PM

chaze aka "DWHS" is a complete newbie, pretty obvious from his posts and hosting operation.

Sly 02-21-2011 08:04 PM

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.

Marcus 02-21-2011 09:26 PM

Quote:

Originally Posted by Sly (Post 17931905)
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.

when it happens again and again they get irritated and angry. Ive had cancellations and increasingly angry emails.

Supz 02-21-2011 09:29 PM

Do you backup when you know you have the least amount of people on your site?

borked 02-21-2011 11:47 PM

Quote:

Originally Posted by wdsguy (Post 17931324)
Curious who you use for the cloud service?

miniCloud - very useful for this kind of stuff or for automation
http://www.ovh.ie/cloud/

plsureking 02-22-2011 12:15 AM

Quote:

Originally Posted by blackmonsters (Post 17931892)
Please see post number 7.

:thumbsup

haha ya i saw it too late. :upsidedow


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