gpt4 book ai didi

quartz-scheduler - Quartz Scheduler 工作线程问题

转载 作者:行者123 更新时间:2023-12-02 00:05:20 25 4
gpt4 key购买 nike

我对 Quartz Scheduler 工作线程有疑问。我创建了一个调度程序任务,它将每 3 小时执行一次。我创建了一份工作和一个触发器。当我执行这个调度程序时,我观察到一个奇怪的行为,同一个作业被分配给 10 个工作线程。这 10 个工作线程正在执行相同的代码 10 次。我该如何解决这个问题...?

谁能帮我解决这个问题。我是 Quartz Scheduler 的新手。

提前致谢,阿马尔

最佳答案

来自quartz manualorg.quartz.threadPool.threadCount header 下

If you only have a few jobs that fire a few times a day, then 1 thread is plenty! If you have tens of thousands of jobs, with many firing every minute, then you probably want a thread count more like 50 or 100 (this highly depends on the nature of the work that your jobs perform, and your systems resources!).

这就是可以更改 threadCount 的方式。

<configSections>
<section name="quartz" type="System.Configuration.NameValueSectionHandler,System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>

<quartz>
<add key="quartz.scheduler.instanceName" value="ServerScheduler" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="80" />
<add key="quartz.threadPool.threadPriority" value="2" />
<add key="quartz.jobStore.misfireThreshold" value="60000" />
<add key="quartz.jobStore.type" value="Quartz.Simpl.RAMJobStore, Quartz" />
</quartz>

关于quartz-scheduler - Quartz Scheduler 工作线程问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18763667/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com