High CPU usage - due to scheduled tasks

I tried to find a pattern for the bug. It’s directly related to the scheduled task interval :

  • 10000 (2,777778 hours) ok
  • 10400 (2,8888889 hours) ok
  • 10800 (3 hours) bug
  • 10810 (3,0027778 hours) ok
  • 14400 (4 hours) bug
  • 14700 (4,0833333 hours) ok
  • 18000 (5 hours) ok

At first I thought it was coming from a rounding issue and/or data type (int vs float), because it was buggy just with whole number like 3 and 4 hours, but it’s okay with 5 hours. It’s strange.

For now I just changed the interval 14400 to 14700 for my problematics scheduled tasks and the Lucee CPU dropped at 0%.

I wonder if it’s specific to our server configuration or if anybody who use an interval of 14400 will have this issue…

If I can help in anyway to solve this issue, let me know!

1 Like

I think it’s maybe something to do with this while(true) loop in revertDST

the code is slightly different in 5.3 as it includes a fix for this issue with DST

It makes sense.

Note that if my scheduled task use an interval of 14400 and start at {t ‘06:00:00’}, it’s fine. But if it’s start at 00:00:00, or 00:30:00, or 01:00:00 the bug still occur. This is indeed a bug depending on the combination of start time and interval, and maybe end time as well.

good detective work, can you post your findings in the task

I posted my findings in the bug report [LDEV-3214] - Lucee.

1 Like

this was addressed in 5.3.8.156, please try it out (when the build finishes)

1 Like

I too also had scheduled tasks high cpu when converting from railo to lucee. I binnary searched around 250 tasks and found 5 offenders. No rhyme or reason to what they were

Hi @Zackster,

I don’t see the version 5.3.8.156 in the Update section of the server admin. Is it normal?

I suppose the version 5.3.8.159-SNAPSHOT should be fine too? I tried the version 5.3.8.159-SNAPSHOT with my old scheduled tasks settings and everything look normal in the CPU usage.

Thank you!

1 Like

I had the same problem and by turning off Debugging*, everything was fine again.