overlapping cronjobs

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Post Reply
joshsard
Posts: 55
Joined: Sun Feb 14, 2016 6:09 pm

overlapping cronjobs

Post 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 4601 times
Thanks
Josh
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: overlapping cronjobs

Post 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?
joshsard
Posts: 55
Joined: Sun Feb 14, 2016 6:09 pm

Re: overlapping cronjobs

Post 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
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: overlapping cronjobs

Post 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?
joshsard
Posts: 55
Joined: Sun Feb 14, 2016 6:09 pm

Re: overlapping cronjobs

Post 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 4572 times
Thanks
joshsard
Posts: 55
Joined: Sun Feb 14, 2016 6:09 pm

Re: overlapping cronjobs

Post by joshsard »

Hi,

The cache folder size is 39MB in size. Is that ok, or shall we delete it? Thanks
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: overlapping cronjobs

Post 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.
Post Reply