Skip to Content

Contributors

Perhaps an Odoo Performance Issue ?!

Dear all OCAler,

I have noticed a performance behavior with Odoo, and want to clarify if I am wrong, or not :)

In my opinion, Odoo clears too often the complete LRU Cache. So all ir.qweb, ir.model.access, and so on, has to be reloaded.
In that case, you find the Log message: "At least one model cache has been invalidated, signaling through the database."

Here just two examples when this happens:

 - Deleting a record which has got an IrModelData Entry e.g. through exporting
   https://github.com/odoo/odoo/blob/c9609c62efe163901f8c2b1a30355b60dd34ad51/odoo/models.py#L3695
   https://github.com/odoo/odoo/blob/c9609c62efe163901f8c2b1a30355b60dd34ad51/odoo/addons/base/models/ir_model.py#L1968

 - Changing a user-defined default value
   https://github.com/odoo/odoo/blob/c9609c62efe163901f8c2b1a30355b60dd34ad51/odoo/addons/base/models/ir_default.py#L32


In our scenario( ~1.000.000 Sale Orders, ~350 Modules installed), this results, that an F5 Browser Refresh need's ~5 seconds.
Without clearing the LRU Cache, the reload is done in < 1 second.

My question:
Is this really necessary to invalid all ir.qweb, ir.model.access data, when I just change one default value of a user, or delete one IrModelData entry ?

Is there a way to change this behavior ?

Thank you all and Best regards,
Stefan



Vielen Dank und viele Grüße

Stefan Wild
Geschäftsführer
sewisoft.de - Logo

sewisoft GmbH
Örtleinsweg 39
96148 Baunach

info@sewisoft.de
Tel. +49 (0) 160 / 99 11 25 69
www.sewisoft.de

Sitz der Gesellschaft: Baunach
Registergericht: Amtsgericht Bamberg, HRB 8508
Geschäftsführer: Günter Selbert, Stefan Wild




by Stefan Wild - 02:31 - 5 Oct 2022

Follow-Ups

  • Re: Perhaps an Odoo Performance Issue ?!
    As a workaround, stop doing a lot of exports including the XML-ID (being export-import compatible). And anyway, it shouldn't be very frequent to remove records to have such problems: you don't delete sale.order, product.product and so on. Maybe res.partner as deduplication processes. But then go again to the point 1 of my suggestion.

    Regards.

    by Pedro M. Baeza - 03:16 - 6 Oct 2022
  • Re: Perhaps an Odoo Performance Issue ?!
    > Is this really necessary to invalid all ir.qweb, ir.model.access data, when
    
    > I just change one default value of a user, or delete one IrModelData entry
    
    > ?
    
    no
    
    
    > Is there a way to change this behavior ?
    
    you can start at
    https://github.com/OCA/OCB/blob/15.0/odoo/modules/registry.py#L557
    and try to detect there what cache you actually need to clear.
    
    But note this is tricky, as you'd also have to instruct other workers to only 
    selectively clear their caches. Very error prone.
    
    
    -- 
    Your partner for the hard Odoo problems
    https://hunki-enterprises.com

    by "Holger Brunn" <mail@hunki-enterprises.nl> - 03:01 - 5 Oct 2022
  • Re: Perhaps an Odoo Performance Issue ?!
    Hi Stefan

    Yes, you are correct.

    I have created the following issue related to

    For v16.0 they have worked to improve this:
     - 

    For old versions we had headaches to have gtmetrix green for our production customers



    --
    Moisés López Calderón
    Mobile: (+521) 477-752-22-30
    Twitter: @moylop260
    hangout: moylop260@vauxoo.com
    http://www.vauxoo.com - Odoo Gold Partner
    Twitter: @vauxoo

    by Moisés López Calderón - 02:51 - 5 Oct 2022