tags:

views:

20

answers:

2

Hi.

On my database server there is a cronjob that backups all the databases in a way that makes it easy to restore them.

It is something like this:
0 5 * * * /usr/local/bin/backup.php

The problem is that the website (using that db server) is very slow during that process. Even, Pingdom sends me a 'website down' alert at the start of the process.

To solve the problem, I have tried this change:
0 5 * * * /bin/nice -n 19 /usr/local/bin/backup.php

but it doesn't seem to improve the situation.

How is that possible?

How would you solve the problem under these requirements? 1. no purchase of any hardware 2. easy to implement and maintain 3. no proprietary solutions

+1  A: 

You could put a delay in your backup.php script that ensures a maximum backed up records per second rate or similar, ie using sleep().

gauteh
A: 

The general strategy to solve the general situation of a task that takes a long time to run is to try and run it incrementally, over a longer period.

That is, perhaps your backup can take place in parts; or perhaps you can swap to a temporary database during the backup procedure, etc. It's hard to tell what would work for you, without knowing more.

Noon Silk