I only want to have 1 instance of the dataskq run at a time


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » DirectAdmin

I only want to have 1 instance of the dataskq run at a timeLast Modified: Feb 2, 2009, 3:44 pm
Every minute, the dataskq is run via cronjob.  If things like backups are issued at different times, say 5 minutes after the first run of a backup, then you'll end up having 2 backups being created at the same time which can generate slow performance because of the drive being forced to bounce between 2 locations on disk at the same time.

The solution for that is to only have 1 instance of the dataskq ever running at one time.  Note that the consequence to that is that any actions that need to be run while a backup is executing will not be processed.  Eg:  service monitoring, service restarts, or other task.queue commands.  They will be stored in the task.queue file and executed once the first instance of the dataskq has finished.

The easiest way to ensure there is only 1 instance running at a time, is to run a check of the system before executing the dataskq every minute.  The way you can do that is to edit:

/etc/cron.d/directadmin_cron

(or /etc/crontab on freebsd) and change the code that says:

* * * * * root /usr/local/directadmin/dataskq

to become

* * * * * root if [ "`ps ax | grep -v grep | grep -c dataskq`" -eq 0 ]; then /usr/local/directadmin/dataskq; fi;

then restart your cron program

/etc/init.d/crond restart

Might be just "cron" without the d on some systems.
 
Related Helpfiles
The task.queue is not being processed

2003 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST