跳转到主要内容

一个根据系统资源计算Odoo配置的工具。

项目描述

Odoo资源评估器

本工具基于可用的系统资源计算Odoo配置。它旨在通过根据服务器的规格计算Odoo的最佳工作进程数量和内存限制来自动化配置过程。

输出示例

$ 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

安装

要安装Odoo资源评估器,请运行以下命令

pip install odoo-resource-assessor

用法

交互式模式

要评估资源并获得推荐的Odoo配置,只需执行该工具。它将提示您输入CPU数量和RAM(以GB为单位)

resource-assessor

自动模式

要自动评估当前系统,请使用--self标志让脚本确定可用的系统资源

resource-assessor --self

--self模式下,您可以传递额外的标志以输出特定值

$ resource-assessor --self --workers

9

有效的标志有--workers--soft--hard

输出到文件

要将整个生成的配置写入文件,请使用--output标志

resource-assessor --output odoo.conf

帮助

您可以通过传递--help标志来检查所有功能

$ 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

功能

  • 自动计算Odoo的HTTP工作进程数量。
  • 根据系统RAM确定最佳内存限制。
  • 可以使用--self标志方便地使用当前系统资源。
  • 可以输出计算出的工作进程和内存限制值。

贡献

贡献使开源社区成为一个如此神奇的地方,可以学习、启发和创造。您所做的任何贡献都将被强烈赞赏。

如果您有任何使此工具更好的建议,请将存储库分叉并创建一个拉取请求。您也可以简单地创建一个带有“增强”标签的问题。

别忘了给项目加星!再次感谢!

  1. Fork 项目
  2. 创建你的功能分支 (git checkout -b feature/AmazingFeature)
  3. 提交你的更改 (git commit -m '添加一些AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 提交拉取请求

许可证

此项目受 MIT 许可证的许可 - 详细信息请参阅 LICENSE 文件。

致谢

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分布

odoo_resource_assessor-0.2.0.tar.gz (6.9 kB 查看哈希值)

上传

构建分布

odoo_resource_assessor-0.2.0-py3-none-any.whl (7.6 kB 查看哈希值)

上传 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面