Before installing Odoo

Last week, we recived the following enquiry:

 

We are an odoo official partner and we are interested to have a right technical implementation more secure and with performance for odoo.
How you can help us.
What we search is a Document or a user manual to configure and setup odoo and secure it.

 

And here is our reply, since this is something you should do before installing Odoo :

To be honest with you, I have been implementing data management infrastructures for almost 2 decades now and I am still learning every day. One thing you must understand about Odoo is that it is using third party technologies: PostgreSQL, Python, XML, WkHTMLTOPDF, QWEB etc…etc….

The basic advice I would give you is the following:
– NEVER go for a production system based on Windows.
– DO NOT USE standard DEB or other automatic installers: fast result / shitty outcome.
– Have a full understanding of client’s data, accesses, transactions and relational database models in PostgreSQL.
– Know what each parameter of PostgreSQL is meant to change and tweak and NEVER install it “by default”.
– NEVER run a production server with workers=0 inside your conf file….unless we are talking about a very small system with a few users.
– Understand that EVERY CLIENT is different:
– Calculate the hardware needs from the PostgreSQL and Workers projected consumption of CPU threads and RAM. IE: Do NOT buy any serer and then try to install….
– Do not dive into delivering a large Odoo installation without an expert in both Linux and PostgreSQL.

Example: a client with a big “partners”  or  “products / product_variant” table but few transactions and not many users will have totally different settings than a client with smaller partner or product tables but many users and multi-access…

The knowledge I had perfected over PostgreSQL 9.3 is not satisfactory anymore and I am now adapting myself to new PostgreSQL 9.5 while testing 9.6 Beta and concurrent computation instructions. 1 month ago, I would tell you:
– Ubuntu 14.04 LTS + PostgreSQL 9.3 + Reverse Proy NGINX + customized CERT SSL encryption.

Now, I am moving to:
– Ubuntu 16.04 LTS + PostgreSQL 9.5 + Reverse Proxy APACHE2 + CERT SSL 256 bits

All the setup, memory management, CPU cores usage depend on so many factors:
– Physical server OR Virtual Machine?
– Is this a LOCAL server or a WEB BASED INTERNET server?
– Mechanical Hard Drives or SSD?  Did you know that the same PostgreSQL simple request can go 50 times faster on a SSD hard drive than on a standard SAS Mechanical one?  The consequences on Segmentation and pre-buffering are just TREMENDOUS.
– Independant disk with short lapse dedicated driver reserverd for PostgreSQL or standard ext4 system partition?
– 1 server for everything? Or 1 server for Odoo and 1 server for PostgreSQL? Or 1 server for load-balancing, 1 server for Odoo and 1 server for PostgreSQL?
– 1 PostgreSQL server or 2 or 3 ?  Cluster or replication? Or none of these?
– How many CPU cores available? A few cores with high frequency or a high number or cores with low frequency?
– How have your written your complementary modules? Are you using the API or have you also coded things in Python directly?
– What is your approach of coding inside the additional modules you have made for your clients: Are you pulling a lot of data “by function” or are you using a “store through” pattern?

Each reply to these above questions will have an impact on your server implementation and must be considered when you setup your system. After it is running, you will still need to fine-tune your setup. The fact that it is running does NOT mean it is good enough. You should do the following:
– Use your Odoo in Debug mode.
– Use Munin or similar tools to pull out statistics regarding the CPU, RAM, DISK and POSTGRESQL activities and see issues.
– PGTOP, IFTOP and TOP can also help troubleshooting on the spot.

I hope these few guide-lines are giving you clues. I could talk about this for days since I am doing this intensely 50 hours per week and am still learning every day.