Ir al contenido
Menú
Se marcó esta pregunta
8 Respuestas
6314 Vistas

Hello, 

It has been a year I didn't close the POS session by clicking the button : Validate closing and post entries

Now I am trying to close it after like more 1300 commands. However it time outs after like 30 minutes ...

When I check the odoo.log file I get : 


"

Many times this line :

   2020-09-02 23:49:45,009 5856 INFO Lib werkzeug: 127.0.0.1 - - [02/Sep/2020 23:49:45] "POST /longpolling/poll HTTP/1.1" 200 -

Then

2020-09-02 23:49:45,009 5856 ERROR Lib odoo.service.server: Exception happened during processing of request from ('127.0.0.1', 50937)

Traceback (most recent call last):

  File "SocketServer.pyc", line 599, in process_request_thread

  File "SocketServer.pyc", line 334, in finish_request

  File "SocketServer.pyc", line 657, in __init__

  File "SocketServer.pyc", line 716, in finish

  File "socket.pyc", line 283, in close

  File "socket.pyc", line 307, in flush

error: [Errno 10053] Une connexion établie a été abandonnée par un logiciel de votre ordinateur hôte

2020-09-02 23:51:23,036 5856 ERROR ? odoo.addons.bus.models.bus: Bus.loop error, sleep and retry

Traceback (most recent call last):

  File "C:\Program Files (x86)\Odoo 10.0\server\odoo\addons\bus\models\bus.py", line 180, in run

  File "C:\Program Files (x86)\Odoo 10.0\server\odoo\addons\bus\models\bus.py", line 166, in loop

OperationalError: server closed the connection unexpectedly

This probably means the server terminated abnormally

before or while processing the request.

"

Please help me bypass this problem. it is really making me afraid I will lose the app. because all my library is based on it.

Environnment : Windows 10, Odoo 10.

P.S : I will close it then I will try to slowly migrate to the latest Odoo version. 

P.S 2 : I copied the entire database to a more powerfull laptop, installed odoo 10 and restored the database. when I try to close the session i get the same timeout problem and same errors.

Thank you so much in advance.

Avatar
Descartar
Mejor respuesta

First of all, you should allways close the POS sessions on day to day.

To solve time out problems you need to tweak your Odoo and Postgresql config files. For instance, on a recent inventory operation I had to multiply the CPU time limit per 20.

In Odoo, do you use workers ? Did you setup CPU time limit and Ram limit ? In Postgresql, did you changed the config settings (may be with pgtune) ? If you answered "No" to one of these questions please copy-paste your odoo.conf and tell us more about your hardware (memory, cpu and disk).


How to fix your time-out problem

Tune Postgresql settings

Odoo is mostly data-driven and all those datas are handled by Postgresql. When you close the POS session, a lot of datas regarding accounting, stock and products are written in the Postgresql database. Obviously, the first thing to do is to improve Postgresql speed. And luckily this is quite easy : go to https://pgtune.leopard.in.ua fill the form and it will return all you need to change in postgresql.conf (type 200 in Number of Connections).

Tune Odoo settings

The reference document is Deploying Odoo in the developper documentation (https://www.odoo.com/documentation/13.0/setup/deploy.html) and the various talks from Olivier Dony at the Odoo Experience, like this one https://www.slideshare.net/openobject/performance2014-35689113 and this one https://www.youtube.com/watch?v=A_BWyFeGgVA

By setting up a reverse proxy and  a cache (with Nginx) you would be able to enable workers in Odoo and to save some CPU time. Unfortunatly, workers are not available on Windows. Following parameters are all per workers, in your case I calculate with one worker.

dbmaxconn = 190 a bit lower than Postgresql max_connections. Pgtune will probably give you 200

limits should keep rooms for Postgresql and should maximize CPU usage. Let's divide equally your Ram between Odoo and Postgresql. Postgresql will probably use less than 2GB so you will have 2GB free for Windows.

limit_memory_hard = 4294967296 (4GB)
limit_memory_soft
  = 3758096384 (3,5GB)

Following should be enough. These are big numbers.
limit_request = 8192
limit_time_cpu = 800
limit_time_real = 1400

Windows

There are usualy limits in the kernel. On a desktop system, they are lower than on a server. One can increase them but I don't know precisely how to do that on Windows. You should free windows as much as you can from userspace program. Keep it out of the network. It will save CPU time.

Try on Linux

I can't help with Windows tweaking, but I know how to increase Odoo performances on Linux (basicaly using Workers). Hence I suggest to install Linux on a small partition on your laptop. Odoo is nearly a one-click install on Debian, Ubuntu, Fedora, Red Hat and Centos. If you are not comfortable with command-line, you can install a Desktop version.

Check your Postgresql version from Windows 10 first and please report it. This will help with Linux choice

or use a small VPS server

This can be a good and low-cost option and I will be able to connect in if you want.

In any case, ask for more help if it don't work.
Avatar
Descartar
Autor

Hello Xavier,

Did you see my answer above ? I am really blocked and waiting for answer, if you can kindly help :-)

Thanks again

Autor

Hello Xavier,

I made all the changes. However still getting timeouts :s :s

I was also monitoring my cpu and memory usage, there is no overload at all. nothing is changing when closing the session.

do you have any other alternatives ?

thank you so much.

See my updated answer.

Le mar. 8 sept. 2020 à 00:43, abd <a.benhima@hotmail.fr> a écrit :

Hello Xavier,

I made all the changes. However still getting timeouts :s :s

I was also monitoring my cpu and memory usage, there is no overload at all. nothing is changing when closing the session.

do you have any other alternatives ?

thank you so much.

Envoyé par Odoo S.A. utilisant Odoo.



--

Cordialement
Xavier Brochard / zeroheure
Autor

Hi again,

I just set up a virtual machine with Centos 7.

6GB of memory and 2 CPU cores.

What can I do next please ?

Thanks a lot.

Autor Mejor respuesta

Hello Xavier, 

Thank you for your quick feedback. It is a long story why we didn't close the POS session but this is a mistake I agree.

The answer to all the question is no, no workers, no CPU or RAM limit, no change to Postgres config or odoo config.

my laptop is an i7 with 8G RAM and ssd hard drive so good enough I suppose.

my odoo.conf looks like : 

"

[options]

addons_path = C:\Program Files (x86)\Odoo 10.0\server\odoo\addons

admin_passwd = admin

bin_path = C:\Program Files (x86)\Odoo 10.0\thirdparty

csv_internal_sep = ,

data_dir = C:\Users\BENHIMA\AppData\Local\OpenERP S.A\Odoo

db_host = localhost

db_maxconn = 64

db_name = False

db_password = openpgpwd

db_port = 5432

db_template = template1

db_user = openpg

dbfilter = .*

demo = {}

email_from = False

geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb

import_partial = 

limit_memory_hard = None

limit_memory_soft = None

limit_request = None

limit_time_cpu = None

limit_time_real = None

limit_time_real_cron = None

list_db = True

log_db = False

log_db_level = warning

log_handler = :INFO

log_level = info

logfile = C:\Program Files (x86)\Odoo 10.0\server\odoo.log

logrotate = False

longpolling_port = 8072

max_cron_threads = 2

osv_memory_age_limit = 1.0

osv_memory_count_limit = False

pg_path = C:\Program Files (x86)\Odoo 10.0\PostgreSQL\bin

pidfile = None

proxy_mode = False

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 = None

xmlrpc = True

xmlrpc_interface = 

xmlrpc_port = 8069

"

I really appreciate your help and your time.

Best regards, 

Abdel.

Avatar
Descartar

OK, thanks. Let me answer in a couple of hours, I have to finish my work before.

See my complete answer above.

See my updated amswer

Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 24
5499
1
jul 23
2707
1
dic 22
3671
3
mar 22
16767
2
mar 22
18889