Community mailing list archives
Re: Odoo Performance and concurrency locksby
Using the login patch will help reduce the problem you are describing, and making sure you write your code defensively as to not have the same thing happen with the same user at the same time. This is a big nono
It is a particularly nasty, frustrating problem. Other software that is open source but a completely different platform and purpose, Magento, handles transactional concurrency beautifully. It uses Mysql Innodb. You would not receive such a message.
The retry functionality you are referring to was only introduced in recent versions. In 6.1 when this functionality was first introduced it just failed, there was no retry. Only after the next major release did the address that problem.
Each time you open a browser or separate tab whatever was executing in the first window will fail because of the SELECT FOR UPDATE NOWAIT. In all of my implementations this has to be commented out. This system can almost be unusable depending on how you are batching jobs and using the system. For more information on transaction isolation see he Postgres documentation:
It is one of the worst plagues in this software and I think it has been ignored by the staff. Another example of how the stock code can cause this error is in https://github.com/odoo/odoo/blob/8.0/openerp/addons/base/res/res_users.py#L464.
Hello,Not that this will solve your problem, but IMO the implementation of postgres transaction functionality is not correct and is flawed. I have heard mention that Odoo uses serialized transactions but in the code the isolation level is set to Repeatable Read. Even using just the stock code you will see serialization failures. An example in Odoo 8.0 is the chat presence. Every time it updates you will see a concurrency error.
On Sun, Sep 13, 2015 at 2:57 PM, Shawn Varghese <email@example.com> wrote:
Hello everyone,I am fast approaching large volumes of data for one of our POS implementations and I would like to optimize Odoo and Postgres performance before the issue gets out of hand.Right now, an immediate concern is the concurrency locks in the DB. Once a lock occurs, Odoo only tries upto 5 times to resolve it and the delay between each retry is too small. The code for this is in the osv.py file and I tried to manually increase the MAX_TRIES_ON_CONCURRENCY_FAILURE value and restarted the server. But it did not seem to have any effect. Odoo still only tries 5 times. How can I update the osv file then?Also, to increase the number of HTTP workers, it is just a simple case of giving a non-zero number to the workers parameter in the config file?How exactly does one achieve load balancing?I would be very grateful to anyone who can help me out here.I have gone through Olivier Dony's presentation on Deploying Odoo and it provides very interesting insights but unfortunately, I have not been able to implement them.