Odoo Help


7 Answers
André Pereira โปรตุเกส
19/5/15 04:15

Have you tried the "sticky" option on your Nginx config? http://nginx.org/en/docs/http/ngx_http_upstream_module.html#sticky

It allows you to keep a user connecting to the same Odoo server without having to be tied to a specific IP. It distributes them randomly on the first connection, then uses a cookie to keep them on the same server.


Everything looks ok AFAIK, I think you should keep ip_hash parameter, because if an user logs into alpha and then balancer takes it over beta, it will loose its session and will have to login again.

I did it before (balancer) using ten instances and the only difference I see with your config is that I was not using https and I used weight for some of the servers. Maybe you should check this https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-load-balancing-with-ssl-termination it might be useful


Daniel Reis โปรตุเกส

--Daniel Reis--
| 8 9 11
Linda-a-Velha, โปรตุเกส
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt

Daniel Reis โปรตุเกส
15/5/15 05:55

Probably you are complicating: Odoo provides load balancing out of the box, you should try that before other more complex alternatives.

To activate it just set the "workers" option of your config file to a non-zero number. For documentation on this see: https://www.odoo.com/documentation/8.0/setup/deploy.html#builtin-server

Your nginx would work as a simple reverse proxy, with no load balancing. It can still be useful to provide HTTPS and to cache static content, avoiding that extra load on the Odoo workers.

2 ความคิดเห็น
bloopark systems GmbH & Co. KG, Christoph เยอรมันนี
18/5/15 05:55

I know what workers are and we use this workers. We have two odoo servers for the failover. So we use nginx to balance the requests to both servers. Because we have already two servers it would be good to use both servers at the same time to reduce the load of the first server.

Daniel Reis โปรตุเกส
18/5/15 06:07

OK, the question mentioned "odoo instances", so it was not clear that you were using two servers.

Jon Knowles แคนาดา
16/10/18 20:17

I noticed you have IP_hash commented out.  We have 6 Front End servers running using ip_hash in nginx, without any nginx related issues.  Don't forget the longpolling upstream to do the same.  The only difference is I used the local ip, vs the server name. But same principal.

upstream balancer {
# ip_hash;
server alpha:8069;
server beta:8069;
Ask a Question
Keep Informed
3 ผู้ติดตาม
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now