Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

How are the caches cleaned in multi-process mode (i.e. under Gunicorn)?

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
gunicorndevelopmentwsgiv7multiprocess
2 Besvarelser
31351 Visninger
Avatar
Nicolas Bessi

When developing I use @tools.ormcache() or @tool.ormcache_multi(multi=x) to gain performance. From time to time I need to clean caches. For this I use my_model.clear_caches().

When we are in Gunicorn mode does clean_caches notify all worker to automatically clean their own cache, or do I have to do some other calls? Is there some latency?

This is not really clear or maybe I missed some documentation.

4
Avatar
Kassér
Avatar
Vo Minh Thu
Bedste svar

Each registry (i.e. the self.pool variable on any model instance) is kept in sync across workers through the database. Two sequences in database are used, one for the caches and one for the registry itself (e.g. to keep track of the fact a module has been installed), and each worker checks those sequences.

Whenever the sequences have a different value than what the worker was assuming, the workers will either clean their caches or reload the registry (thus loading any newly installed module, as it would have been flagged as "installed" in ir.module.module).

The check on the sequences is done right when a new RPC call is done. Sequences are updated at the end of an RPC call. So there is some latency between a cache invalidation on a worker and the corresponding invalidation on another worker. But this is in fact ok: when the signaling occurs, it is itself part of the database transaction associated to the RPC call. Since the check is done right at the beginning of a new RPC call, that call/transaction will see correctly cleaned caches and updated registry.

See Guewen Baconnier's answer for the few places where the logic is implemented.

To have all that signaling occur, the openerp.multi_process symbol must be set to True. This should be set in the configuration file used with Gunicorn or other WSGI servers.

In trunk, the oe web command sets also openerp.multi_process to True so that multiple oe web processes can be run side by side.

7
Avatar
Kassér
Avatar
Guewen Baconnier
Bedste svar

From what I can read, when clear_caches is called, it sets _any_cache_cleared to true on the pool registry.

This attribute is used to know if a model cache has been cleared so it can be signaled to the other processes (see openerp.modules.registry, methods check_registry_signaling and signal_caches_change).

The check of signaling is done before each RPC request on models (openerp.service.web_services.objects_proxy) or print of a report (openerp.service.web_services.report_spool) and the signaling is done after the request or the print of the report. ir.cron calls the check and signaling itself (openerp.addons.base.ir_cron) too.

The signaling use a sequence in the database: base_cache_signaling. Each time the sequence is increased, it means that the caches have to be cleared.

4
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
What's the right way to start cron worker jobs? Løst
gunicorn cron v7 multiprocess
Avatar
Avatar
Avatar
Avatar
Avatar
8
feb. 17
40839
What is batter Gunicorn over WSGI Benchmarking or WSGI
gunicorn v7 multiprocess benchmark
Avatar
0
mar. 15
7838
How to run V7.0 in multi-threaded mode?
gunicorn v7 nginx multiprocess
Avatar
Avatar
Avatar
3
mar. 15
18041
Difference between built-in multiprocessor-mode and gunicorn Løst
gunicorn setup installation v7 multiprocess
Avatar
Avatar
1
apr. 23
41793
How to run OpenERP behind Circus ?
server wsgi v7 multiprocess circus
Avatar
Avatar
1
mar. 15
6259
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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