Quartz.Net ZeroSizeThreadPool CPU 使用率高
由于某种原因,当我如下配置并启动 ZeroSizeThreadPool Quartz.net 调度程序时,CPU 使用率非常高,导致计算机无响应...有谁知道为什么会发生这种情况以及如何解决问题? TIA。
var properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = "MyScheduler";
properties["quartz.scheduler.instanceId"] = "instance_myscheduler";
properties["quartz.threadPool.type"] = "Quartz.Simpl.ZeroSizeThreadPool, Quartz";
properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
properties["quartz.jobStore.useProperties"] = "true";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
properties["quartz.jobStore.clustered"] = "false";
properties["quartz.dataSource.default.connectionString"] = "Server=(local);Database=mydb;Uid=user;Pwd=pass;";
properties["quartz.dataSource.default.provider"] = "SqlServer-20";
schedFact = new StdSchedulerFactory(properties);
Scheduler = schedFact.GetScheduler();
Scheduler.Start();
For some reason when I configure and start the ZeroSizeThreadPool Quartz.net scheduler as below, the CPU usage is very high making the computer unresponsive... Does anyone have any idea why this would be happening and how to fix the problem? TIA.
var properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = "MyScheduler";
properties["quartz.scheduler.instanceId"] = "instance_myscheduler";
properties["quartz.threadPool.type"] = "Quartz.Simpl.ZeroSizeThreadPool, Quartz";
properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
properties["quartz.jobStore.useProperties"] = "true";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
properties["quartz.jobStore.clustered"] = "false";
properties["quartz.dataSource.default.connectionString"] = "Server=(local);Database=mydb;Uid=user;Pwd=pass;";
properties["quartz.dataSource.default.provider"] = "SqlServer-20";
schedFact = new StdSchedulerFactory(properties);
Scheduler = schedFact.GetScheduler();
Scheduler.Start();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有理由启动 ZeroSizeThreadPool 调度程序。它可以在不启动的情况下调度作业,因此只需不调用 Start() 方法,CPU 使用率就不会激增。
There is no reason to start the ZeroSizeThreadPool scheduler. It can schedule the jobs without being started so just don't call Start() method and the CPU usage will not spike.