This question has been flagged

Hi,

I will try explain the best I can the problem I have with Odoo 10 CE running on Ubuntu 16.04 LTS VM placed on on-premise HP Proliant G6 running hyper-v.

`Physical server specs:`

` - Processor Intel(R) Xeon(R) CPUX5560 @ 2.80GHz, 2800 Mhz, 4 Core(s), 8 Logical Processor(s)

- OS Name Microsoft Windows Server 2012 R2 Datacenter

- Installed Physical Memory (RAM) 16,0 GB

- 5x 10k SAS drives raid 1+0 (one hot spare)`

`Ubuntu VM specs:`

`carlo@enecom:~$ lscpu

Architecture: x86_64

CPU op-mode(s): 32-bit, 64-bit

Byte Order: Little Endian

CPU(s): 8

On-line CPU(s) list: 0-7

Thread(s) per core: 1

Core(s) per socket: 8

Socket(s): 1

NUMA node(s): 1

Vendor ID: GenuineIntel

CPU family: 6

Model: 26

Model name: Intel(R) Xeon(R) CPU X5560 @ 2.80GHz

Stepping: 5

CPU MHz: 2762.494

BogoMIPS: 5524.98

Hypervisor vendor: Microsoft

Virtualization type: full

L1d cache: 32K

L1i cache: 32K

L2 cache: 256K

L3 cache: 8192K

NUMA node0 CPU(s): 0-7

Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl pni ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm kaiser

carlo@enecom:~$`

4Gb RAM machine

`carlo@enecom:~$ free -m

total used free shared buff/cache available

Mem: 3164 291 1984 113 889 2684

Swap: 4091 0 4091

carlo@enecom:~$`

I would like to enable workers to get better performance. There are only few users using the odoo instance.

Can someone please help me with error which I get every time when I change workers to value > 0 ?

`2018-01-13 11:23:36,666 9225 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`

This is my odoo-server.conf (part of it)

`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`

Can you please help me with this error?

Also I'm running Odoo on apache2 with reverse proxy.

Maybe my values in conf file are not correct?

Avatar
Discard
Best Answer

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/

 

Avatar
Discard
Author

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

- 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

Author

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

Author

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.

Please, enable debug log as I suggested.

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

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

Author

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

you have no database connection

Author

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

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

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 ?

Author

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

Author

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

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 ?

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