Enable Dark Mode!
analysis-of-conf-file-parameters-in-the-odoo-16.jpg
By: Midhun Sankar

Analysis of Conf File Parameters in the Odoo 16

Technical Odoo 16

We are all familiar with the odoo.conf file that we use to configure Odoo. In this blog, we are going to discuss all the parameters in the odoo.conf file of Odoo 16 in detail.
Basically, when we install Odoo 16, the conf file will have only limited parameters, such as, 
admin_passwd = password
db_host = localhost
db_port = 5432
db_user = odoo16
db_password = password
addons_path = addons_path
xmlrpc_port = 8061
The admin_passwd parameter is used to specify the Master database password. This is the password that we give when we create, delete, or restore a database. We can change the Master password from the view as well by clicking on the Set Master Password button and providing the password. The password will be stored in the odoo.conf file in an encrypted format.
The db_host parameter is used to specify the database host. By default, it will be localhost. We can modify it to specify which server it should connect to for PostgreSQL.
The db_port parameter specifies the database port. The port number of PostgresQL is 5432.
Next is the db_user. It is used to specify the database user name. We can give the user name we have given in PostgresQL, who is a Super User.
The db_password parameter is used to specify the database password for the database user.
The addons_path parameter is used to define the addon path. We can give our addons a path, and if we have multiple addons, we can separate them using commas.
The xmlrpc_port parameter is used to define on which port odoo should run. We give the link to run Odoo as db_host: xmlrpc_port.
The other config file parameters that we can use are:
The csv_internal_sep parameter is used to specify how to separate the values when we import and export CSV files.
The data_dir parameter is used to specify the location where to store Odoo data. When we mention 'data_dir' in config, Odoo only checks that location. When the data_dir parameter is not passed, Odoo will find its path.
The db_maxconn parameter is used to specify the maximum number of connections to PostgreSQL. By default, the maximum number of connections to PostgreSQL is 64. What it practically means is that if there’s a deployment of Odoo with a large number of databases and many users, then there may occur an error:
psycopg2.OperationalError: FATAL: sorry, too many clients already
To resolve this, we need to configure the db_maxconn, workers, and max_cron_threads parameters in Odoo and the max_connections parameters in PostgreSQL.
The above mentioned must satisfy the condition in order to resolve the error: 
(1 + workers + max_cron_threads) * db_maxconn < max_connections
The db_name parameter is used to specify the database name. The default value is False. When the value is False, we can access all the databases we have created. To specify the database we want to use, we must give the exact name of the database in db_name as db_name = name_of_the_database.
The db_sslmode parameter is used to specify the database SSL connection mode. SSL stands for secure socket layer, and it is a protocol used for web browsers and servers that allows for authentication, encryption, and decryption of data that is transferred over the internet. We have some choices for defining the db_sslmode. 
disable - The disable choice disables security and encryption when connecting between Odoo and the database. When disabling the db_sslmode, the data transferred will not have any encryption and security. It doesn't provide any security for eavesdropping and MITM.
allow - The allow choice allows encryption only if the server insists on using it. It may provide eavesdropping protection but not MITM protection.
prefer - The prefer choice allows encryption if the server supports it. This choice also may provide eavesdropping protection but not MITM protection.
require - The require choice encrypts the data. It provides protection against eavesdropping. But it does not provide MITM protection.
verify-ca - The verify-ca choice encrypts the data and provides eavesdropping protection. It provides MITM protection depending on the ca policy.
verify-full - The verify-full choice provides maximum protection. Both eavesdropping and MITM protection.
The db_template parameter is used to specify the database template. By default, it will be template0. Using this parameter, we can specify custom database templates to create new databases.
The dbfilter parameter is used to filter the databases from WEB UI. We can set up the filter based on name, hostname, etc. We can filter out a single database or multiple databases that match the condition we give in the db_filter.
The email_from parameter is used to specify the SMTP email address for sending emails. The default value is False. That means if the email_from parameter is not given, no email address will be specified for sending emails.
The from_filer parameter is used to specify for which email address the SMTP configuration can be used. The default value is false. That means if from_filter parameter is not given, no email address will be specified for which the SMTP configuration can be used.
The geoip_database  parameter is used to specify the absolute path to the GeoIP database file. GeoIP is an IP-based geo-location mapping tool that is used for mapping IP addresses to a real-geographic locations on Internet-connected devices. You can learn more about geo ip installation in Odoo 15 the given blog
The default location of geoip_database is ‘/usr/share/GeoIP/GeoLite2-City.mmdb’.
The http_enable  parameter is used to enable or disable the HTTP and Longpolling services entirely. The default value passed is True. 
The http_interface parameter is used to specify the listen interface address for HTTP services. By default, it is kept empty so that it can listen on all interfaces.
The http_port parameter is used to specify the listen port for the main HTTP service. The default value is 8089.
The import_partial parameter is used for big data importation. If data import crashes, you will be able to continue at the current state. We can provide a filename to store intermediate importation states. The default value is ‘ ‘.
The limit_memory_hard parameter is the maximum allowed virtual memory per worker (in bytes). When reached, any memory allocation will fail. This defaults to 2560 MiB. The calculation for limit_memory_hard is 2560 X No of worker * 1024 * 1024. Workers imply the number of concurrent requests your instance will be able to handle.
The limit_memory_soft parameter is the maximum memory per worker (in bytes), when reached, the worker will be reset after the current request. This defaults to 2048MiB. The calculation for limit_memory_soft is 2048 X No of worker * 1024 * 1024.
The limit_request parameter specifies the maximum number of requests to be processed per worker. By default, it is 65536.
The limit_time_cpu parameter is used to specify the maximum time allowed for the  CPU per request. By default, it is set to 60. When encountered with,  Exception: CPU time limit exceeded , you should increase the limit_time_cpu value.
The limit_time_real parameter specifies the maximum allowed Real time per request. The default value for this is 120. This value doesn't have a limit, but keeping too high values can make the system slow and makes resources unavailable.
The limit_time_real_cron parameter specifies the maximum allowed Real time per cron job. The default value is the same as limit_time_real. If you don’t want to set a limit, you should set the value as 0. 
The list_db parameter disables the ability to obtain or view the list of databases. It also disables access to the database manager and selector, so be sure to set a proper --database parameter first. The default value is set to True.
The log_db parameter specifies the database to be logged into. The default value is set to False. In case, we want to specify the database to be logged into, we give the name of the database.
The log_db_level parameter specifies the level of logging for the database. By default, the level will be ‘warning’. The ‘warning’ logs messages with the level WARNING on this logger. The other levels are : debug, error, info, critical.
The log_handler parameter is used to set up a handler at LEVEL for a given PREFIX. An empty PREFIX indicates the root logger. The default log_handler parameter is INFO. 
The log_level parameter specifies the level of logging. The default value is info. Other logging levels are 'debug_rpc', 'warn', 'test', 'critical', 'runbot', 'debug_sql', 'error', 'debug', 'debug_rpc_answer' and 'notset'.
The logfile parameter specifies where the log files will be stored. If it’s not set, odoo uses stdout.
The longpolling_port parameter specifies the TCP port which is used for long-polling connections in multiprocessing or gevent mode. The default value is 8072.
The max_cron_threads specifies the maximum number of threads processing concurrently for cron jobs. By default, it is set as 2.
The osv_memory_age_limit is a deprecated parameter that serves as an alias to the transient_age_limit option.
The osv_memory_count_limit parameter is specified if we want to force a limit on the maximum number of records kept in the virtual osv_memory tables. By default, there is no limit set.
The pg_path parameter is used to specify the pg executable path.
The pidfile parameter specifies the file where the server pid will be stored. The default value is False.
The proxy_mode parameter specifies whether to activate reverse proxy WSGI wrappers. 
By default, it is set to false. We can set it to True if we are deploying under a trusted proxy.
The screencasts parameter specifies where the screencasts should go. By default, the screencasts will go in DIR/{db_name}/screencasts. We can change and set up the new location using the screencasts parameter.
Like the screencasts parameter, the screenshots parameter specifies where the screenshots should go. By default, Odoo will choose the directory of temporary tests location. 
The server_wide_modules parameter specifies a comma-separated list of server-wide modules. By default, the values will be base and web.
The smtp_password parameter specifies the SMTP password for sending the email. The default value is False. We can change the default value and set up an SMTP password if needed.
The smtp_port parameter specifies the SMTP port. The default port is set to 25.
The smtp_server parameter specifies the SMTP server for sending an email. The default value is 'localhost'.
The smtp_ssl parameter specifies whether the SMTP connections should be encrypted or not. The default value is False. If True, SMTP connections will be encrypted with SSL (STARTTLS).
The smtp_ssl_certificate_filename parameter specifies the SSL certificate used for authentication. The default value is False.
The smtp_ssl_private_key_filename parameter specifies the SSL private key used for authentication. The default value is False.
The smtp_user parameter specifies the SMTP username for sending email. If given, the SMTP username will be set. The default value is False.
The syslog parameter specifies where to send the log to the syslog server. The default value is False.
The test_enable parameter specifies whether to enable unit and YAML tests. The default value is False.
The test_file parameter specifies whether to launch a Python or YAML test file. The default value is False.
The test_tags parameter specifies a comma-separated list of specs to filter which tests to execute. It enables unit tests if set. A filter spec has the format: [-][tag][/module][:class][.method]. The '-' specifies whether we want to include or exclude tests matching this given specification. The tag given will match the tags added on a class with a @tagged decorator (all the test classes have 'standard' and 'at_install' tags until they are removed explicitly). '*' will match all tags. If the tag is omitted on include mode, its value is 'standard'. If the tag is omitted on exclude mode, then its value is '*'. The module, class, and method will respectively match the module name, test class name and test method name. Example: --test-tags :TestClass.test_func,/test_module,external. Filtering and executing the tests happens twice: right after each module installation/update and at the end of the modules loading. At each stage, tests are filtered by --test-tags specs and additionally by dynamic specs at_install' and 'post_install' correspondingly.
The transient_age_limit parameter specifies the Time limit (decimal value in hours) records created with a TransientModel (mostly wizard) are kept in the database. The default value is set to 1 hour.
The translate_modules specify modules to export. It is used in combination with --i18n-export. Default value is [‘all’].
The unaccent parameter tries to enable the unaccent extension when creating new databases. The default value is False.
The upgrade_path parameter is used to specify an additional upgrade path.
The without_demo parameter specifies whether to disable loading demo data for modules to be installed. We can specify the modules by separating them by commas or use “all” to apply for all modules. Default value is False.
The workers parameter specifies the number of workers. The default is set to 0.
The above mentioned are the most commonly used configuration parameters in odoo 16. We should set the appropriate values in order to set up Odoo more efficiently and improve its productivity.


If you need any assistance in odoo, we are online, please chat with us.



1
Comments

Oshomha Obemeata

Hi, I have a situation where the initial page for the first login to Odoo 16, on Windows, is given me the 500 Internal Error message. My PostgreSQL is installed separately why I used the Odoo 16 latest installer. Please, what should I do in this scenario?

08/05/2023

-

3:58PM



Leave a comment

 


whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message