Python-APScheduler, 一个interval job, 多达二十几个线程(虚拟机单核CPU), 是否是正常情况?
巴扎黑
巴扎黑 2017-04-18 10:23:40
0
0
707

实际现象

  • 利用APScheduler实现间隔任务调度

  • 单核CPU上有多达二十几个线程

预期现象

  • 应该利用 epoll 模型, 不应该用多线程模型 ?

  • 效率上, 这样会很低效吗?

相关代码

  • 间隔任务调度代码

仅展现实际逻辑
schedler.add_interval_jos(
    func=my_func, 
    args=(some-args),
    minutes=10,
    name='myfunc-scheduler' )
    
scheduler.start()

相关报错

DEBUG 2017-03-02 16:42:10,477  MainProcess APScheduler scheduler.py:561:_main_loop   [Next wakeup is due at 2017-03-02 16:52:10.474219 (in 599.997761 seconds)] 
DEBUG 2017-03-02 16:42:10,478  MainProcess Thread-21 threadpool.py:69:_run_jobs   [Started worker thread] 
WARNING 2017-03-02 16:42:10,478  MainProcess Thread-21 scheduler.py:479:_run_job   [Execution of job "mail-r

上下文环境

  • 产品版本: APScheduler 2.0.3

  • Python: 2.6

  • Linux (VMWare虚拟机, 单核CPU)

探索

打算结合tornado 的IOLoop, 来减少这种低效, 但是还没有尝试

巴扎黑
巴扎黑

reply all(1)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!