Odoo Help

1

0
1 Answer
3
Xavier Brochard
13.01.18, 09:45

IMHO the error comes from the worker attached to longpolling. Disable `longpolling_port` first.

Regarding best practices, have a look at the slides and corresponding video from Olivier Dony (Odoo's SaaS Engineer), see slide 3 for a quick preview on values.

https://www.youtube.com/watch?v=A_BWyFeGgVA

https://www.odoo.com/slides/slide/performance-tips-tricks-399

About your config datas :

limit_memory_hard = 2147483648
limit_memory_soft = 1572864000
limit_request = 8192
limit_time_cpu = 600
limit_time_real = 1200
limit_time_real_cron = -1
workers = 9
xmlrpc = True
xmlrpc_interface =
xmlrpc_port = 8069
longpolling_port = 8072
max_cron_threads = 2

No need for this, it is default values (see server.py in Odoo code) :

limit_time_cpu = 600
limit_time_real = 120

Workers value is low, it could be around 16-18, because you need 6 workers per users (browser keepalive) :

workers = 9

But in this case you need to decrease the soft and hard limit for memory used (soft = ram / workers) :

limit_memory_soft = 268435456


But it really depends on how Odoo is used : how much apps are loaded, how long does it runs, etc.

Do not forget to tweak also Postgresql ! At least with pgtune http://pgtune.leopard.in.ua/

 

15 Comments
Carlo Štefanac
13.01.18, 16:42

Thanks, but I really have problem undestanding this and I would need some more explanation.

How do I disable lonpolling port ? Tried to comment in conf file but does not help.

How did you get memory soft 268435456.

When I divide 4gb ram by 9 workers I don't get that value.

My original question is little bit messy but when I try to edit post to style the question I get 403 error.

This errors doesent have anything to do with apache reverse proxy?

How to calculate soft and hard memory for my VM

workers = 16

8 cpu's

1 thread per core

8 core per socket

4 gb ram

how can I divide dedicated ram by worker soft memory limit when I don't know it's value.

Thanks

Xavier Brochard
13.01.18, 17:16

- To disable longpolling, just comment it out in config. You can also disable xmlrpc values because these are default.

- Memory is expressed in bytes. 4 GB = 4 x 1024 G x 1024 M x 1024 k. Result is divided by 16 workers, not 9.

- The error doesn't look related to Apache, it comes directly from Odoo. For checking this, you can bypass Apache by accessing odoo built-in http server on the 8069 port like that http://IP:80699 BTW, did you enable proxy-mode ? you need to.

- You will learn more on the error by enabling debug log. Look at the Command-line options in Odoo Developer documentation : https://www.odoo.com/documentation/10.0/reference/cmdline.html

Carlo Štefanac
14.01.18, 08:36

Raised RAM (8gb) to follow some guides online and still can't get this to work.

Let's say I want 9 workers

hard mem = 768 x 9 = 7247757312

soft mem = 640 x 9 = 6039797760

My conf :

....

#limit_memory_hard = 7247757312

#limit_memory_soft = 6039797760

limit_request = 8192

limit_time_cpu = 60

limit_time_real = 120

limit_time_real_cron = -1

list_db = True

log_db = False

log_db_level = warning

log_handler = :INFO

log_level = info

logfile = /var/log/odoo/odoo-server.log

logrotate = False

#longpolling_port = 8072

max_cron_threads = 2

osv_memory_age_limit = 1.0

osv_memory_count_limit = False

pg_path = None

pidfile = False

proxy_mode = True

reportgz = False

server_wide_modules = web,web_kanban

smtp_password = False

smtp_port = 25

smtp_server = localhost

smtp_ssl = False

smtp_user = False

syslog = False

test_commit = False

test_enable = False

test_file = False

test_report_directory = False

translate_modules = ['all']

unaccent = False

without_demo = False

workers = 9

xmlrpc = True

xmlrpc_interface =

#xmlrpc_port = 8069

proxy_mode = True

Carlo Štefanac
14.01.18, 08:39

I still get errors like

2018-01-14 13:38:36,480 3789 INFO ENECOM werkzeug: 192.168.10.70 - - [14/Jan/2018 13:38:36] "POST /longpolling/poll HTTP/1.1" 200 -

2018-01-14 13:38:49,766 3795 INFO ? odoo.sql_db: ConnectionPool(used=0/count=0/max=64): Closed 1 connections to 'user=odoo dbname=TEST'

2018-01-14 13:38:49,785 3795 INFO ? odoo.sql_db: ConnectionPool(used=0/count=0/max=64): Closed 1 connections to 'user=odoo dbname=ENECOM'

2018-01-14 13:38:50,659 3796 INFO ? odoo.sql_db: ConnectionPool(used=0/count=0/max=64): Closed 1 connections to 'user=odoo dbname=TEST'

2018-01-14 13:38:50,683 3796 INFO ? odoo.sql_db: ConnectionPool(used=0/count=0/max=64): Closed 1 connections to 'user=odoo dbname=ENECOM'

2018-01-14 13:38:56,474 3791 ERROR ENECOM odoo.http: Exception during JSON request handling.

Traceback (most recent call last):

File "/odoo/odoo-server/odoo/http.py", line 640, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/odoo/odoo-server/odoo/http.py", line 677, in dispatch

result = self._call_function(**self.params)

File "/odoo/odoo-server/odoo/http.py", line 333, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/odoo/odoo-server/odoo/service/model.py", line 101, in wrapper

return f(dbname, *args, **kwargs)

File "/odoo/odoo-server/odoo/http.py", line 326, in checked_call

result = self.endpoint(*a, **kw)

File "/odoo/odoo-server/odoo/http.py", line 935, in __call__

return self.method(*args, **kw)

File "/odoo/odoo-server/odoo/http.py", line 506, in response_wrap

response = f(*args, **kw)

File "/odoo/odoo-server/addons/bus/controllers/main.py", line 35, in poll

raise Exception("bus.Bus unavailable")

Exception: bus.Bus unavailable

I can see that it works better in browser but I just can't pass through errors and warnings in logs.

Xavier Brochard
15.01.18, 09:31

Please, enable debug log as I suggested.

Xavier Brochard
15.01.18, 09:53

Please, did you try direct access by using url like http://IP:8069 ? wat happened ?

Did you install the chat module ? then, uninstall it.

Carlo Štefanac
15.01.18, 12:50

I don't have website chat module installed, same errors when I access Odoo at ip:port.

When i start odoo-bin --log-handler :DEBUG --log-handler werkzeug:CRITICAL --log-handler odoo.fields:WARNING

then I get error 500

https://pastebin.com/8QFjQKB3

Xavier Brochard
15.01.18, 15:15

you have no database connection

Carlo Štefanac
18.01.18, 15:03

I don't know how to enable debug mode properly. I will respond to your message when I learn how.

Xavier Brochard
18.01.18, 16:46

Carlo, the log you have posted shows that you miss a database connection (10 last lines). That's why you get the error 500.

The Bus unavailable exception is common in various cases (I got it yesterday after a few changes in my config). So we need debug mode to get more informations and understand from where the error comes. Enabling debug is well documented in Documentation / Developer /Command-line interface: odoo-bin / Running the server / logging https://www.odoo.com/documentation/10.0/reference/cmdline.html You may also have a look in the file odoo/tools/config.py

Xavier Brochard
18.01.18, 16:50

To clarify : you server is up and running, right ? you have this exception in the log that you don't understand but it doesn't block functionalities ?

Carlo Štefanac
18.01.18, 17:10

Yes! My server is up and running and I work in Odoo normally. I’ve used install script for v10 and I dont relly know how to enable debug mode.

Whole deployment for my company is set through public modules on github. I want to learn more about odoo and maybe write some modules but I’m still learning.

Instance is started at boot because I added server to init.d and I can stop server using terminal but don’t really know how to start with debug params.

I start server with sudo service odoo-server start

Carlo Štefanac
18.01.18, 17:16

I only get that database related error when I try to start with debug mode

Xavier Brochard
18.01.18, 17:30

Ok. I didn't understood that at first. This exception happens because in multiprocess, live chat is automatically enable. If it is not configured, there is no bus available, that's all. For further information, look for LiveChat in "Deploying Odoo" in Developer documentation.

To fix, install the chat module and enable proxy for longpolling. There is a configuration sample in the same "Deploying Odoo" documentation.

I am also trying to learn Odoo. My setup is different : I use nightly builds packages and modules from Github. I clone the repositories (mainly from OCA) and link the modules I need to the addons folder. From time to time, I report bugs and improve modules. I'm sysadmin, not developer. So it is difficult for me to understand how code works. May be we could learn together ?

Dynamic IT Solutions Co., Ltd., APISAK SRIHAMAT
08.08.18, 10:21

Do you define the solution as install LiveChat module and enable proxy for longpolling ?

Ask a Question
Keep Informed
1 follower(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 E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now