Quartz.Net ZeroSizeThreadPool CPU 使用率高

发布于 2024-10-10 04:35:36 字数 1093 浏览 4 评论 0原文

由于某种原因,当我如下配置并启动 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

耀眼的星火 2024-10-17 04:35:37

没有理由启动 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文