简体   繁体   English

Lucee突然高Java CPU使用率

[英]Lucee sudden high Java CPU usage

Running Lucee Lucee 5.2.7.62 on Ubuntu 16 / Java 8_181.在 Ubuntu 16/Java 8_181 上运行 Lucee Lucee 5.2.7.62。

A couple of days ago, CPU usage started running at around 50%, which appears to be due to two Java threads belonging to Lucee spinning.几天前,CPU 使用率开始以 50% 左右的速度运行,这似乎是由于属于 Lucee 的两个 Java 线程在旋转。 Restarting Lucee and the O/S have no effect - the spin behaviour starts as soon as Lucee is running.重新启动 Lucee 和 O/S 没有任何效果——只要 Lucee 运行,旋转行为就会开始。

Drilling down with FusionReactor, the issue seems to relate to scheduled tasks.深入研究 FusionReactor,问题似乎与计划任务有关。 No changes to scheduled tasks seem to have taken place prior to this error.在此错误之前似乎没有对计划任务进行任何更改。 The server is in the UK time zone - I am wondering if the issue relates to switching from GMT to BST this weekend, though the problem started a couple of days before.服务器位于英国时区 - 我想知道这个问题是否与本周末从格林威治标准时间切换到英国夏令时有关,尽管问题是在几天前开始的。

When I stack trace the spinning threads in Fusionreactor, I typically see something like this:当我在 Fusionreactor 中堆栈跟踪旋转线程时,我通常会看到如下内容:

java.util.SimpleTimeZone.getOffsets(SimpleTimeZone.java:551)
- waiting on <0x5d7f0b89> (a java.util.SimpleTimeZone held by thread 84, Thread-50)
java.util.SimpleTimeZone.getOffset(SimpleTimeZone.java:540)
sun.util.calendar.ZoneInfo.getOffsets(ZoneInfo.java:293)
sun.util.calendar.ZoneInfo.getOffsets(ZoneInfo.java:236)
java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2340)
java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2312)
java.util.Calendar.setTimeInMillis(Calendar.java:1804)
java.util.GregorianCalendar.add(GregorianCalendar.java:1076)
lucee.runtime.schedule.ScheduledTaskThread.calculateNextExecution(ScheduledTaskThread.java:219)
lucee.runtime.schedule.ScheduledTaskThread._run(ScheduledTaskThread.java:121)
lucee.runtime.schedule.ScheduledTaskThread.run(ScheduledTaskThread.java:87)


Fusionreactor pointed to an issue with Scheduled Tasks with the Thread Visiualizer showing two spinning tasks, with stack traces similar to the below. Fusionreactor 指出了 Thread Visiualizer 显示两个旋转任务的计划任务的问题,堆栈跟踪类似于以下内容。

I killed these threads, and the spinning stopped.我杀死了这些线程,旋转停止了。 I could then see two of my scheduled tasks marked in pink as permanently stopped in the Lucee administrator.然后我可以看到我的两个计划任务在 Lucee 管理员中标记为粉红色永久停止。 Re-enabling these processes and restarting Lucee brought the problem back, so I killed them again and again the tasks went pink in the Lucee Administrator.重新启用这些进程并重新启动 Lucee 将问题带回来,所以我一次又一次地杀死它们,Lucee Administrator 中的任务变成粉红色。 They did not run on their normal schedule either.他们也没有按正常时间表运行。 Other scheduled tasks remained running OK, and after a few hours things were still normal.其他计划任务仍然运行正常,几个小时后一切仍然正常。

I then removed and recreated the two scheduled tasks that seemed to be the issue, and restarted Lucee.然后我删除并重新创建了两个似乎是问题的计划任务,然后重新启动了 Lucee。 The two tasks ran on schedule.两项任务如期进行。 I have therefore concluded that somehow the timing information for the two tasks had become corrupted, causing the spin when Lucee was trying to calculate the next run time.因此,我得出结论,这两个任务的计时信息不知何故已损坏,导致 Lucee 尝试计算下一次运行时间时出现旋转。 The Luce source code around the point it seemed to be spinning has a 'while(1)' loop which seemed to be incrementing a date variable - I suspect that's where things were stuck. Luce 源代码围绕它似乎旋转的点有一个“while(1)”循环,它似乎在增加一个日期变量——我怀疑这就是问题所在。

In summary, get shot of the scheduled tasks and recreate, and you may have a workaround.总之,拍摄计划任务并重新创建,您可能有一个解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM