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

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:

/usr/local/ispconfig/server/lib/classes/db_mysql.inc.php

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

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

Code:
30 00 * * * /usr/bin/nice -n19 /usr/bin/ionice -c3 /usr/local/ispconfig/server/cron_daily.sh > /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 cron_daily.sh 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