Run-Odoo Brain AI leverages AI optimization for Odoo performance issues, offering programmatic database optimization and system optimization to enhance Odoo customization performance and Odoo modules performance on the Run-Odoo Hosting Platform.
While Odoo keeps conquering more market shares every year, the number of deployments and the daily volumes of data it manages keep increasing at a staggering rate. Meanwhile, many users, developers, and Odoo partners are facing more and more performance issues, with cases ranging from mere discomfort or slowness to unacceptable behaviors preventing the implementations from serving their initial purpose.
The outcome is always the same: User frustration, pressure on IT teams to find solutions in an emergency, and expensive code refactorings.
At Portcities, we became aware a couple of years ago that the new AI technologies had reached the required maturity level to address these performance issues programmatically. Thus, the Run-Odoo Brain project was born.
This is its story.
THE ODOO PERFORMANCE ISSUE
The major qualities of Odoo also contribute to its downfall when it comes to standardizing its performance improvements and overall maintainability in the long run:
Benefits | Challenges | |
Modularity: The Odoo apps and modules offer is huge | You can craft and deploy an Odoo DB for almost any business case | The deployment of different Apps and customized modules implies that your system is unique and shall require a personalized approach when it comes to performance analysis and troubleshooting |
Adaptability: Many settings are available per App and module as a standard | This allows to customize the user experience, SOPs, flows, and outputs even more | The deployment and its data structure/relations will be even more customized, which entails a fully dedicated and customized approach of performance issues |
Release pace: Odoo SA releases one new Odoo version per year for both Odoo Community and Enterprise | The product evolves very fast and offers more and more complete features out of the box | Each version has a different logic, a different database structure, and therefore requires specific analysis and troubleshooting per version |
At this stage, we are not even mentioning the direct consequences of the above-listed challenges, among which you could easily shortlist the following:
- The tables receiving most of the Odoo ERP load in terms of data volumes will completely depend on the modules installed and the type of business the client is running.
- Odoo does not allow to DROP data. This means that users keep adding and the databases and file-store keep growing as months and years go by.
- The more modules, the more module inter-dependancies and the more inter-table constraints and python-constrained accesses complexifying the calls and increasing the pressure on both the Python Workers and the PostgreSQL database.
- The more users, the more pressure, since more people need to use more data concurrently.
- APIs and automations will contribute to worsen the performance since their access rates and data volumes to process per call can be very challenging as well.
To put it nicely, and after more than a decade troubleshooting performance issues in all Odoo versions since “Open-ERP 7.0”, I would say that any Odoo implementation that goes live shall sooner or later require a performance optimization. While it is accurate to say that very small deployments with low data volumes would hardly be concerned after a decade of usage, I have already witnessed large deployments that were almost unusable less than 6 months after their Go-live.
THE GAUNTLET HAS BEEN THROWN
And yet…. Since Odoo is an assembled patchwork of third-party open-source technologies, troubleshooting its common performance issues requires an extensive knowledge covering the following specialities:
- Infrastructure: All systems, dedicated deployments, Cloud platforms, instances and services behave in a very different way and I have seen companies spending fortunes on bare metal servers of monthly Hosting bills while none of it made sense when compared with the number of users and operations involved.
- DevOps: The way CPU, memory and Storage I/O are consumed are primordial and so often overlooked or simply ignored while some of the root causes of performance sometimes arise from the wrong virtualization mode, or the wrong kernel settings or CPU allocation or memory usage etc…etc…
- Odoo Python coding: Most codes available on the Odoo App store or written by standard Odoo developers are focussed on the functional aspects. Very few are stress-tested or even assessed properly when it comes to measuring their potential impacts on a medium to large production system. Once there is no error in the logs and the end-user has validated the demo / test / UAT is passed, the modules are put into production. The performance issues shall arise later. The truth is: writing the same module with a performance-centric approach requires a lot more expertise since it requires a full understanding of what the Odoo ORM actually does asynchronously with the database and file store it operates and how the Python workers are consuming the code.
- PostgreSQL knowledge: PostgreSQL is a really impressive beast whose capabilities go in pairs with its complexity. There are hundreds of ways of setting it up and hundreds of settings that require specific attention; but most production systems I encounter are deployed on generic installations of the community package or using standard AWS or GCP and Azure offers which perform poorly since they are deployed with their standard general settings.
So, here we are, in need of systematic dedicated analysis combining a full infrastructure and full-stack expertise: The gauntlet has been thrown. But rather than letting humans pick it up and spend hundreds of billable hours partially fixing deployments one by one, at Portcities, we have decided to leverage AI by teaching it everything it needs to know so that it could do in a few minutes what the best engineers in our teams would not even fantasize doing in a few weeks.
CHAT GPT: THE CHALLENGE OF BUILDING INTELLIGENCE
When we first started playing with ChatGPT, we quickly realized that although the AI was capable of doing wonders explaining and solving standard topics, it fell very short once we started giving it more complex tasks.
While the results were in no way satisfactory, the consecutive endeavors came at a high cost: more reasoning, more bad answers, more excuses, more re-runs, etc.
We were going stupid and doing it in circles.
We quickly learnt from our mistakes and realized that the only way to leverage the AI efficiency was to apply the following rules:
- Build resilient AI models including flows of locked predetermined routings in order to give the adequate “reasoning structure” upfront and control any useless and vainly creative digression.
- Improve the AI cueing with a consistent syntax in order to avoid the typical “misunderstandings” leading to misinterpretation and pointless recommendations.
- Increase the AI knowledge by pointing relevant code, examples and publications that enhance best-practice.
- Feed the AI used cases encountered with each analysis and troubleshooting session. Each database comes with new unexpected cases and challenges. Leveraging these is a wonderful opportunity to learn and improve a pattern-detection method whose relevance will systematically hit the bull’s eye when making the best recommendations.
We played with a lot of different AIs before reaching the conclusion that they all required the same stream-lined approach guided by these same fundamental principles. At the end of the day, it is not about the dog, but rather how you teach the dog.
COLLECTING THE REWARDS
Finally, after months of thorough RnD and testing, here it was: BRAIN 0.1 was born.
We decided to run it on a large Odoo 16 deployment affected by medium-to-severe performance issues on a database containing roughly 2 years of operational data. Here are the results in a nutshell:
General Performance Gains
BRAIN AI compared the average response time of the Odoo backend before and after the optimization and measured that the average execution time had dwindled from 1184 ms to 293 ms after confirming it with the logs. This basically means that speed increased by a ratio of X4.
Performance improvements assessment per functionality / module
📒 Accounting & Finance
Modules: account, account_reports, account_accountant, l10n_*
Improvements: Invoice listing, reconciliation, financial reports, dashboard performance.
👥 HR & Payroll
Modules: hr, hr_expense, hr_payroll, hr_holidays, hr_attendance
Improvements: Faster employee record access, expense tracking, and payslip generation.
🛒 Sales & CRM
Modules: sale, crm, contacts
Improvements: Customer search, quotation, and order list responsiveness.
📦 Inventory & Purchase
Modules: stock, purchase, product
Improvements: Product lookup, transfer operations, purchase order navigation.
🌐 Website, Portal & Marketing
Modules: website, portal, mail
Improvements: Portal search, website loading, chatter/message performance.
🔐 Access Control & System
Modules: base, web, settings
Improvements: Faster UI loading, permission checks, access rule evaluation.
🛠️ Technical / Background Jobs
Modules: base_automation, queue_job, bus
Improvements: Cron jobs, async queue, log/event access.
Performance improvements summary
Actions and deliverables
To put it in a nutshell:
- A 22-minute execution cycle.
- 12 actions executed at the infrastructure level
- 680 actions executed at the Database Level
- 23 database settings modified
- 3 odoo configuration settings changed
- 16 coding and infrastructure recommendations to improve further-more
- Production of a full comprehensive detailed report of 460 pages detailing the changes.
This is a solid example although we just had as I write this article another win on a large deployment with a staggering 17.5 X speed increase shifting the Odoo narrative from “We are about to give up” to “We are going to extend this deployment and use it as our new back-bone”.
And yet, as a group CTO and initiator of Brain, I am still not satisfied with its “pro-active” intelligence. It needs to learn more and “experience” more data. An honest assessment at this point in time would be to say that it does and fixes just about 30 to 40% of what we want it to be competent with in the long run. Indeed, “practice makes perfect,” as they say.
MORE ABOUT THE PRODUCT ROADMAP
Given the daily results we are now getting with Brain, we are now utterly convinced that involving the AI in the optimization process was the right call. BRAIN AI shall soon be available for all deployments hosted on our Run-Odoo hosting platform and will become a major asset for any medium to large-size client requiring an impeccable SLA and qualitative user experience.
Meanwhile, since performance issues are a problem that evolves throughout the life-cycle of the Odoo deployment and upgrades, we are now shifting gear to not only allow a punctual “one-shot” usage of brain on any deployment, but also integrate BRAIN AI as a permanent service behaving very much like an agent whose function would be the “upgraded version” of a health check that:
- Monitors, detects issues and slowness in real-time.
- Implements counter-measures dynamically.
- Auto-reports on user behaviors, issues and resolutions.
- Makes recommendations
Discover unparalleled Odoo performance – contact us to explore the Run-Odoo Cloud Platform powered by Brain AI today!