İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

What's the right way to start cron worker jobs?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
gunicorncronv7multiprocess
8 Cevaplar
41124 Görünümler
Avatar
Andreas Brueckl

I have setup a multi-threaded environment with nginx and gunicorn. But since gunicorn does not run openerp-cron-workers, I need to start dedicated cron-workers.

As far as I understand I have to run the "oe cron" command. But for this command there are only two options available: "--addons" and "--database". When I call this command I get an exception because the PostgreSQL port is not correct.

So how can I specify configuration options (or a config file) for the "oe" command? What is the correct way to run cron-worker jobs in a productive environment?

I run gunicorn with the following command: "gunicorn openerp:wsgi.wsgi_server.application -c ../gunicorn.conf.py"

Here is my guniconf.conf.py file:

import openerp 
import multiprocessing 
bind = '0.0.0.0:8000' 
pidfile = '.gunicorn.pid'   
conf = openerp.tools.config

conf['addons_path'] =  "openerp/addons,../addons,../web/addons,../custom-addons"
conf['db_host'] = False 
conf['db_port'] = 5433 
conf['db_user'] = 'user1' 
conf['db_password'] = 'xx' 
conf['dbfilter'] = 'test.*'

conf['logfile'] = '/var/log/openerp-server-7.log'

workers = multiprocessing.cpu_count() * 2 + 1

When I look into the source in method "application" of wsgi_server.py I cannot see where the cron jobs will be started. There are only 2 files which handle "max_cron_threads": "server/openerp/service/workers.py" and "server/openerp/service/cron.py". Both of them are not called in gunicorn-mode.

Maybe I misunderstand something. How to I correctly run openerp in multiprocess-mode?

4
Avatar
Vazgeç
Avatar
Vo Minh Thu
En İyi Yanıt

In 6.1, there is an additional script called openerp-cron-worker to run a process dedicated to cron jobs.

In 7.0, the recommended way is to use the integrated multi-processing support (i.e. not Gunicorn although it should work). The option --workers sets how many HTTP workers are started, while the option --max-cron-threads sets how many cron workers are started. That option is misleading: both HTTP and cron workers, when using --workers, are real processes. If you still want to use Gunicorn, you may want to try --workers 0 and --max-cron-threads 1 to have a dedicated cron process.

Your question is tagged as 7.0 but refers to the oe script which has been recently added in trunk. If its features are too limited (which seems the case with what you say) or bugged, please create a bug report on launchpad. Otherwise this should be the right way to start cron workers in the future (independently of the integrated multi-process support with the --workers option).

7
Avatar
Vazgeç
ABC

Is it possible when defining conf['workers'] = '0' and conf['max_cron_threads'] = '1' in gunicorn.conf.py ? . I've tried that but it didnt worked .

Avatar
Vasiliy Birukov
En İyi Yanıt

Try our module cron for manual start cron from odoo interface.

5
Avatar
Vazgeç
Avatar
Guewen Baconnier
En İyi Yanıt

Since version 7.0, the cron workers are launched automatically when you start openerp in multi-process mode.

It spawn n HTTP workers where n is a number in the configuration key workers, and it spawn m Cron workers where m is a number in the configuration key max_cron_threads.

4
Avatar
Vazgeç
Avatar
Viktor Nagy
En İyi Yanıt

I just run into this same problem running an instance with uwsgi (not gunicorn). The instance was running fine for more than a month, but no cron jobs were running.
The reason behind this unexpected behavior was pretty simple. The cron jobs are never started running only a simple wsgi application.

I've followed the code base as much as I could, and the only places where cron jobs are started are when openerp is started from the command line. Thus cron is never started for wsgi apps.
For this reason, you have 2 possibilities:

  1. run a separate openerp-server instance that is initialised, and will only consume your cron job
  2. add the cron init code to your wsgi initialisation

I've tried the latter. My current setup seems to work well, but I'm not sure if it's really OK or not. Here follows what I did:

  1. Add an `import cron` line towards the top of openerp/service/wsgi_server.py.
  2. Add `cron.start_service()` around line 413, after the `openerp.service.start_internal()` call.
  3. Restart your server

--------------

NB: finally my solution is to drop gunicorn from the stack, and use the openerp-server command with workers and max-cron-threads set as suggested above

1
Avatar
Vazgeç
Avatar
Eugen Don
En İyi Yanıt

Hi my Friend, there is an app to start cron workers manually espacially for cases where users run their instances in wsgy mode.

You can also assign a automated action to the function of this module.


https://www.odoo.com/apps/modules/8.0/manual_cron/


Best Regards Eugen

0
Avatar
Vazgeç
Avatar
Andreas Brueckl
Üretici En İyi Yanıt

Thank you for the answer.

I run gunicorn with the following command: "gunicorn openerp:wsgi.wsgi_server.application -c ../gunicorn.conf.py"

Here is my guniconf.conf.py file:

import openerp 
import multiprocessing 
bind = '0.0.0.0:8000' 
pidfile = '.gunicorn.pid'   
conf = openerp.tools.config

conf['addons_path'] =  "openerp/addons,../addons,../web/addons,../custom-addons"
conf['db_host'] = False 
conf['db_port'] = 5433 
conf['db_user'] = 'user1' 
conf['db_password'] = 'xx' 
conf['dbfilter'] = 'test.*'

conf['logfile'] = '/var/log/openerp-server-7.log'

workers = multiprocessing.cpu_count() * 2 + 1

When I look into the source in method "application" of wsgi_server.py I cannot see where the cron jobs will be started. There are only 2 files which handle "max_cron_threads": "server/openerp/service/workers.py" and "server/openerp/service/cron.py". Both of them are not called in gunicorn-mode.

Maybe I misunderstand something. How to I correctly run openerp in multiprocess-mode?

0
Avatar
Vazgeç
Daniel Reis

Andreas, to add more details to your question you should edit it expanding the additional details, instead of posting them as an "answer".

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
How to run V7.0 in multi-threaded mode?
gunicorn v7 nginx multiprocess
Avatar
Avatar
Avatar
3
Mar 15
18311
What is batter Gunicorn over WSGI Benchmarking or WSGI
gunicorn v7 multiprocess benchmark
Avatar
0
Mar 15
8023
Difference between built-in multiprocessor-mode and gunicorn Çözüldü
gunicorn setup installation v7 multiprocess
Avatar
Avatar
1
Nis 23
42123
Why max-cron-threads default value is 2? Çözüldü
cron multiprocess
Avatar
Avatar
1
Kas 21
12889
Where is the status of scheduled jobs (ir.cron) logged? Çözüldü
cron v7
Avatar
Avatar
Avatar
2
Oca 24
18321
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now