Skip to content

Commit

Permalink
[FIX] disable openblas threads
Browse files Browse the repository at this point in the history
When numpy is imported, it will load some dependencies, if they are
available. One of these is openblas, which will start some threads,
which we will not be using, but which are consuming precious memory
resources. By setting the OPENBLAS_NUM_THREADS environment variable to
1, we disable the creation of these threads and therefore reduce the
memory usage of the Odoo workers.

This fixes the memory consumption issue when ninja dashboard is
installed.
  • Loading branch information
gurneyalex committed Jan 22, 2025
1 parent 9753864 commit 89f42cf
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions 11.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ ENV ODOO_VERSION=11.0 \
PATH=/odoo-bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
OPENBLAS_NUM_THREADS=1 \
DB_HOST=db \
DB_PORT=5432 \
DB_NAME=odoodb \
Expand Down
1 change: 1 addition & 0 deletions 12.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ENV ODOO_VERSION=12.0 \
PATH=/odoo-bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
OPENBLAS_NUM_THREADS=1 \
DB_HOST=db \
DB_PORT=5432 \
DB_NAME=odoodb \
Expand Down
1 change: 1 addition & 0 deletions 13.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ENV ODOO_VERSION=13.0 \
PATH=/odoo-bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
OPENBLAS_NUM_THREADS=1 \
DB_HOST=db \
DB_PORT=5432 \
DB_NAME=odoodb \
Expand Down
1 change: 1 addition & 0 deletions 14.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ENV ODOO_VERSION=14.0 \
PATH=/odoo-bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
OPENBLAS_NUM_THREADS=1 \
DB_HOST=db \
DB_PORT=5432 \
DB_NAME=odoodb \
Expand Down
1 change: 1 addition & 0 deletions 15.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ ENV ODOO_VERSION=15.0 \
PATH=/odoo-bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
OPENBLAS_NUM_THREADS=1 \
DB_HOST=db \
DB_PORT=5432 \
DB_NAME=odoodb \
Expand Down
1 change: 1 addition & 0 deletions 16.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ ENV ODOO_VERSION=16.0 \
PATH=/odoo-bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
OPENBLAS_NUM_THREADS=1 \
DB_HOST=db \
DB_PORT=5432 \
DB_NAME=odoodb \
Expand Down
1 change: 1 addition & 0 deletions 17.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ ENV ODOO_VERSION=17.0 \
PATH=/odoo-bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
OPENBLAS_NUM_THREADS=1 \
DB_HOST=db \
DB_PORT=5432 \
DB_NAME=odoodb \
Expand Down
1 change: 1 addition & 0 deletions 18.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ ENV ODOO_VERSION=18.0 \
PATH=/odoo-bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
OPENBLAS_NUM_THREADS=1 \
DB_HOST=db \
DB_PORT=5432 \
DB_NAME=odoodb \
Expand Down

0 comments on commit 89f42cf

Please sign in to comment.