定時器UNIX crontab vs Quartz

來源:互聯網
上載者:User

標籤:定時器   quartz   unix   

  1. Using cron seems to add another entry point into your application, while Quartz would integrate into it. So you would be forced to deal with some inter-process communication if you wanted to pass some information to/from the process invoked from cron. In Quartz you simply (hehe) run multiple threads. cron是進程層級,Quartz是線程層級;如果任務之間有依賴、通訊關係,那麼cron將是一個大難題,而Quartz只需考慮線程之間如何調度的問題
  2. cron is platform dependent, Quartz is not. cron是依賴於unix平台的,而Quartz使跨平台的
  3. Quartz may allow you to reliably make sure a task is run at the given time or some time after if the server was down for some time. Pure cron wouldn‘t do it for you (unless you handle it manually).Quartz會保證即使服務重啟,任務仍然會在指定的時間重新執行,而cron不會
  4. Quartz has a more flexible language of expressing occurences (when the tasks should be fired).Quarz支援更豐富的執行命令
  5. Consider the memory footprint. If your single tasks share nothing or little, then it might be better to run them from the operating system as a separate process. If they share a lot of information, it‘s better to have them as threads within one process.Quartz佔用更少的記憶體,單進程內執行多任務,而 cron 每個任務都是一個單獨的進程
  6. Not quite sure how you could handle the clustering in the cron approach. Quartz might be used with Terracotta following the scaling out pattern (I haven‘t tried it, but I believe it‘s doable).
  7. 補充,Quartz支援秒層級的任務,而 cron支援分鐘層級的;Quratz有可視化的任務管理介面,監控、營運更方面,健壯性更強
  8. Quartz支援叢集

原文:http://stackoverflow.com/questions/1029383/time-triggered-job-cron-or-quartz參考:http://www.coderanch.com/t/63580/open-source/cron-Quartz

定時器UNIX crontab vs Quartz

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.