Page 1 of 1

overlapping cronjobs

Posted: Tue Jul 18, 2017 11:51 pm
by joshsard
Hi,

I would like to know if all the rows in the table 'cron' should not be disabled or change the schedule? We are encountering some overlapping process, especially calcExceptions.php. Please see below screenshot:
overlapping cronjob processes running in timetrex production server
overlapping cronjob processes running in timetrex production server
overlapping process.JPG (27.3 KiB) Viewed 4686 times
Thanks
Josh

Re: overlapping cronjobs

Posted: Wed Jul 19, 2017 7:34 am
by shaunw
I would not recommend modifying anything in the 'cron' table as its likely to cause a lot of very hard to diagnose problems, and it just shouldn't be required.

TimeTrex also shouldn't allow multiple cron tasks to run at the same time unless they are taking more than 12 hours to run or something else is severely broken with your installation, such as the TimeTrex cache directory where it stores lock files being deleted out from under it.

Normally calcExceptions shouldn't take more than 60 minutes to run and even that would be considered a long time. According to your "ps aux" output it looks like they have both been running for about two hours, which is quite suspect. Additionally one was started at 12:30AM (midnight) and one was started at 12:30PM (noon). The midnight one is correct, but the noon one is not the schedule that TimeTrex uses by default, so that is strange too.

What database are you using with TimeTrex, and how many employees do you currently have in the database?

Re: overlapping cronjobs

Posted: Thu Jul 20, 2017 1:12 am
by joshsard
Hi,

We use PostgreSQL db and we have 7360 rows in the users table.

What does the calcExceptions do?
Also where could I find the timetrex cache directory?

Thanks
Josh

Re: overlapping cronjobs

Posted: Thu Jul 20, 2017 7:19 am
by shaunw
calcExceptions handles the exception policies, marking missed punches, emailing supervisors, etc...

The cache directory is specified in your timetrex.ini.php file.

What version of TimeTrex are you running?

Re: overlapping cronjobs

Posted: Thu Jul 27, 2017 7:40 pm
by joshsard
Hi,

We are using v9.0.2-20151106-210132 community edition. I've also checked out our timetrex.ini.php, and it seems like cache is disabled:

;
; Cache settings
;
[cache]
enable = FALSE
;Linux
dir = "/tmp/timetrex"

Is that setting okay?

Also, here is another screenshot of the process:
htop.JPG
htop.JPG (50.54 KiB) Viewed 4657 times
Thanks

Re: overlapping cronjobs

Posted: Thu Jul 27, 2017 10:53 pm
by joshsard
Hi,

The cache folder size is 39MB in size. Is that ok, or shall we delete it? Thanks

Re: overlapping cronjobs

Posted: Fri Jul 28, 2017 7:04 am
by shaunw
If the cache is disabled in your timetrex.ini.php file, that will make everything take significantly longer to run, its main purpose is to speed things up.

Also TimeTrex v9.0.2 hasn't been supported for quite some time and actually has a couple 3rd party libraries with major security vulnerabilities in them, we *highly* recommend that you upgrade to the latest version of TimeTrex immediately.