Increased CPU usage (+40%) - due to scheduled task threads

Description

Hello,
I recently upgraded Lucee from 5.2.1.9 to 5.3.8.138-SNAPSHOT and am seeing a considerable increase in CPU usage (+40%~).

This graph shows the CPU usage. The point where CPU usage increases coincides with the update of the Lucee version.

Environment

Version: Lucee 5.3.8.138-SNAPSHOT
Servlet Container: Apache Tomcat/9.0.19
Java: 11.0.8 (AdoptOpenJDK) 64bit
OS : Linux (4.15.0-130-generic) 64bit

Attachments

14

Activity

Pothys - MitrahSoft 9 March 2021 at 12:15

I've checked with lucee version 5.3.8.156-SNAPSHOT. This issue was fixed. No CPU usage was increased.

Michael Offner 9 March 2021 at 09:03

please give this another try

Michael Offner 8 March 2021 at 19:36

it happen in the calculation of DST offset compensation when the interval is bigger than an hour

Tony Monast 17 February 2021 at 13:05

When I have only my scheduled task “To Infinity and Beyond“ with the starting time at 00:00:00 and interval at 14400, here what I see with performance analyzer plugin

The last column is the CPU time. After few seconds I see CPU time jumping at 286,281.25, then 316,234.38, then 332,750.00, and going up and up and up…

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%.

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.

Zac Spitzer 16 February 2021 at 15:19

discussion on the dev forum

https://dev.lucee.org/t/high-cpu-usage/7950/20

My Performance Analyzer plugin now shows thread cpu time and the stack so you can easily see if you are hitting this bug

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 10 January 2021 at 09:56
Updated 12 March 2021 at 14:48
Resolved 12 March 2021 at 14:48