Odoo Aide

1

1
7 Answers
1
André Pereira
19/05/2015 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.

1
Aristóbulo Meneses
18/05/2015 06:11

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

1
Avatar

Daniel Reis

--Daniel Reis--
3701
| 8 8 11
Linda-a-Velha, Portugal
--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/05/2015 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 Comments
bloopark systems GmbH & Co. KG, Christoph
18/05/2015 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/05/2015 06:07

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

0
Jon Knowles
16/10/2018 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;
}
Poser une question
Writer
Étiquettes
Keep Informed
3 Abonné(e)s
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.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now