Thread: Web backups
View Single Post
Old 7th November 2012, 20:36
tio289 tio289 is offline
Join Date: Mar 2009
Posts: 70
Thanks: 2
Thanked 14 Times in 9 Posts

Hi guys, I was finally figure out problem:

it was with mysql connection timeout. I set wait_timeout and interactive_timeout to small values (60s), because many sites,cms etc. don't correctly close connections.

ispconfig backup script is running long time and mysql close connection. So I contribute path:


105 105	public function query($queryString) {
    106		parent::ping();
106 107 	$this->queryId = parent::query($queryString);
ping check for connection and if lost and mysqli.reconnect is enabled them reconnect it.

So enable reconnect in /etc/php5/cli/php.ini

mysqli.reconnect = On
Here is question if is not better to have custom php.ini for ispconfig cronjobs, which will have preddefined values, because backup files have UTC time by default. I have to set timezone also.

It's working now

I also edit cron job, I change nice and ionice, because backuping is intensive task

30 00 * * * /usr/bin/nice -n19 /usr/bin/ionice -c3 /usr/local/ispconfig/server/ > /dev/null 2>> /var/log/ispconfig/cron.log
I don't know, what is better:

Calling ping direct in query function, or call it in long time scripts before every query?
Changing nice and ionice for whole or only in backup section when calling zip/tar/gzip commands?
Independent Senior Webdeveloper

Last edited by tio289; 8th November 2012 at 17:07.
Reply With Quote