Skip to main content

A tool to calculate Odoo configuration based on system resources.

Project description

Odoo Resource Assessor

This tool calculates the Odoo configuration based on the available system resources. It is designed to automate the configuration process by calculating the optimal number of worker processes and memory limits for Odoo based on the server's specifications.

Output example

$ resource-assessor

Enter the number of CPUs: 4
Enter the amount of RAM in GB: 34
Do you want to customize the time limits? (current: cpu=600, real=1200) [y/N]: N


#####################################################
# Odoo configuration generated by resource-assessor #
# Paste it into your odoo.conf file under [options] #
#####################################################


; Odoo configuration generated by resource-assessor
workers = 3
cron_workers = 1

; Customize the Odoo timeouts
limit_time_cpu = 600
limit_time_real = 1200

; Customize the Odoo memory limits
limit_memory_hard = 5637144576
limit_memory_soft = 4563402752

; End of configuration generated by resource-assessor

Installation

To install the Odoo Resource Assessor, run the following command:

pip install odoo-resource-assessor

Usage

Interactive mode

To assess the resources and get a recommended Odoo configuration, simply execute the tool. It will prompt you to enter the number of CPUs and the amount of RAM in GB:

resource-assessor

Automatic mode

For assessing the current system automatically, use the --self flag to have the script determine the available system resources:

resource-assessor --self

In --self mode, you can pass extra flags to output specific values:

$ resource-assessor --self --workers

9

Valid flags are --workers, --soft, and --hard.

Output to file

To write the entire generated configuration to a file, use the --output flag:

resource-assessor --output odoo.conf

Help

You can check all the features by passing --help flag:

$ resource-assessor --help

usage: resource-assessor [options]

A tool to calculate Odoo configuration based on system resources.

Default values can be set using environment variables:
- LIMIT_TIME_CPU_DEFAULT
- LIMIT_TIME_REAL_DEFAULT
- CRON_WORKERS_DEFAULT


optional arguments:
  -h, --help            show this help message and exit
  --cpu CPU             Number of CPUs (will prompt if not provided)
  --ram RAM             Amount of RAM in GB (will prompt if not provided)
  -o OUTPUT, --output OUTPUT
                        Output file path to write the configuration
  -s, --self            Run using the current machine's resources without prompting
  -w, --workers         Output the number of workers based on current machine's CPUs (only with --self)
  --soft                Output the calculated limit_memory_soft value (only with --self)
  --hard                Output the calculated limit_memory_hard value (only with --self)
  --limit-time-cpu <seconds>
                        Limit time CPU (default: 600)
  --limit-time-real <seconds>
                        Limit time real (default: 1200)
  --version             show program's version number and exit

Example: resource-assessor --self

Features

  • Automatically calculates the number of HTTP workers for Odoo.
  • Determines optimal memory limits based on system's RAM.
  • Can use the current system's resources with the --self flag for convenience.
  • Can output the calculated values for workers and memory limits.

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repository and create a pull request. You can also simply open an issue with the tag "enhancement".

Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odoo_resource_assessor-0.2.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

odoo_resource_assessor-0.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file odoo_resource_assessor-0.2.0.tar.gz.

File metadata

File hashes

Hashes for odoo_resource_assessor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c5481d944f1215ba49dfc827c0656a8d5637bb45292daf6760f46a218ab9a068
MD5 ae4e7515a87ff38e62ad9294ae86aacf
BLAKE2b-256 1b41f8b6a015f5d9eb34ad94dcd43e49eaf8656b05643f9be6acbd2f1f93ef7f

See more details on using hashes here.

File details

Details for the file odoo_resource_assessor-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_resource_assessor-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04a0ce47771274de7b5a78fb2102164628021fb4f38b4571735f6cb4601bb1d8
MD5 677658814a777f07910ab5dcad3c3421
BLAKE2b-256 2ea9c48d1ffab99ea0ecd9fcc4b381a2e272fab2d337a0300ee7588dd7a645c5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page