一个根据系统资源计算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
标志方便地使用当前系统资源。 - 可以输出计算出的工作进程和内存限制值。
贡献
贡献使开源社区成为一个如此神奇的地方,可以学习、启发和创造。您所做的任何贡献都将被强烈赞赏。
如果您有任何使此工具更好的建议,请将存储库分叉并创建一个拉取请求。您也可以简单地创建一个带有“增强”标签的问题。
别忘了给项目加星!再次感谢!
- Fork 项目
- 创建你的功能分支 (
git checkout -b feature/AmazingFeature
) - 提交你的更改 (
git commit -m '添加一些AmazingFeature'
) - 推送到分支 (
git push origin feature/AmazingFeature
) - 提交拉取请求
许可证
此项目受 MIT 许可证的许可 - 详细信息请参阅 LICENSE 文件。
致谢
- 感谢 Odoo 社区持续的支持和启发。
- 特别感谢所有帮助维护和改进此项目的贡献者。
- 受 在 Odoo Experience '23 上的 "托管您的 Odoo 服务器在公网上:应该做什么和不应该做什么" 讲座启发
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。
源分布
odoo_resource_assessor-0.2.0.tar.gz (6.9 kB 查看哈希值)
构建分布
关闭
odoo_resource_assessor-0.2.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | c5481d944f1215ba49dfc827c0656a8d5637bb45292daf6760f46a218ab9a068 |
|
MD5 | ae4e7515a87ff38e62ad9294ae86aacf |
|
BLAKE2b-256 | 1b41f8b6a015f5d9eb34ad94dcd43e49eaf8656b05643f9be6acbd2f1f93ef7f |
关闭
odoo_resource_assessor-0.2.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 04a0ce47771274de7b5a78fb2102164628021fb4f38b4571735f6cb4601bb1d8 |
|
MD5 | 677658814a777f07910ab5dcad3c3421 |
|
BLAKE2b-256 | 2ea9c48d1ffab99ea0ecd9fcc4b381a2e272fab2d337a0300ee7588dd7a645c5 |