导读
Odoo创始人Fabien在2017年10月6日在Odoo 11.0的发布会上,有一个现场演示,SO单的确认操作,10.0版本大约要6秒钟,11.0版本只要2秒钟,性能上提升了3倍!
Odoo 10.0中,库存调整单的确认,100个明细行就会变得很慢,300个明细行的盘点单,确认操作超过30分钟。同样的操作,11.0中表现如何呢?
Odoo 11.0实际测试结果如下
- 测试环境:i5 CPU,4G内存,SSD 256G硬盘,Win10 的PC机。Odoo 11.0社区版
- 测试步骤:通过脚本自动插入500个产品(品名不同,成本价格随机),自动产生一个400个明细行的入库单,自动产生一个400个明细行的库存调整单;Odoo中成本计算方法设置为FIFO,实时会计凭证(入库出库自动产生会计凭证)
- 测试结果:入库单保留操作大约1分钟,验证入库操作不到2分钟;库存调整单确认操作不到2分钟;两个操作完成,系统自动产生了1600条会计分录(800个会计凭证);
- PO确认、入库、开票的完整周期测试。在Odoo8.0,9.0,10.0的时候,300条明细行的PO确认基本上要20分钟以上,经常导致浏览器TimeOut而无法确认PO。脚本自动产生一个400条明细行的PO,以demo用户身份(因为权限检查,Demo用户通常比admin操作速度慢一点),确认PO,用时约3分10秒;验证入库约2分钟(自动产生了800条会计分录);基于PO创建供应商账单约15秒;供应商账单确认约30秒(自动产生了401条会计分录)。
- Odoo中Message机制对性能有严重影响:如下面的新建一个User的SQL调用日志,大约有一半SQL和mail_关联表相关。批量数据导入时候,如果关掉Message功能,导入速度有明显提升。有下面一些选项可以关掉Message功能(参考 mail_thread.py文件):
- ``mail_create_nosubscribe``: at create or message_post, do not subscribe uid to the record thread
- ``mail_create_nolog``: at create, do not log the automatic '<Document> created' message
- ``mail_notrack``: at create and write, do not perform the value tracking creating messages
- ``tracking_disable``: at create and write, perform no MailThread features (auto subscription, tracking, post, ...)
- ``mail_save_message_last_post``: at message_post, update message_last_post datetime field
- ``mail_auto_delete``: auto delete mail notifications; True by default(technical hack for templates)
- ``mail_notify_force_send``: if less than 50 email notifications to send, send them directly instead of using the queue; True by default
- ``mail_notify_user_signature``: add the current user signature in email notifications; True by default
数据库响应测试报告
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: SQL LOG from:
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: ir_model: 0:00:00/1
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: mail_followers: 0:00:00/1
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: mail_activity: 0:00:00.016000/1
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: calendar_attendee: 0:00:00.016000/1
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: res_company: 0:00:00/2
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: mail_followers_mail_message_subtype_rel: 0:00:00/2
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: mail_message_subtype: 0:00:00/3
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: res_groups: 0:00:00/3
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: ir_config_parameter: 0:00:00/5
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: ir_attachment: 0:00:00/6
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: mail_message: 0:00:00/6
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: ir_model_data: 0:00:00.031000/8
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: res_users: 0:00:00/18
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: res_partner: 0:00:00.016000/28
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: SUM from:0:00:00.079000/137 [208]
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: SQL LOG into:
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: mail_followers: 0:00:00/1
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: res_partner: 0:00:00/1
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: res_users: 0:00:00.016000/1
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: mail_message: 0:00:00/2
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: table: ir_attachment: 0:00:00/3
2017-12-09 01:05:24,342 1396 DEBUG test05 odoo.sql_db: SUM into:0:00:00.016000/137 [208]