From f17d2fe9c4ab320b0a92c553c2a281ccba1a84b0 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Tue, 11 Apr 2023 00:10:22 +0800 Subject: [PATCH] chore: update change logs --- changes/v4.4.17-en.md | 11 +++++++---- changes/v4.4.17-zh.md | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/changes/v4.4.17-en.md b/changes/v4.4.17-en.md index 4044b6bdf..efbfdb189 100644 --- a/changes/v4.4.17-en.md +++ b/changes/v4.4.17-en.md @@ -21,10 +21,13 @@ [error] Accept error on 0.0.0.0:1883: EMFILE (Too many open files) ``` -- Improve the performance of the rule engine when there are many rules [#10283](https://github.com/emqx/emqx/pull/10283) - Before this change, when there were many rules, the execution of the rule engine became a bottleneck, it consumed a lot of CPU time on rule queries and matches. - In this optimization, the efficiency of rule execution in this scenario was greatly improved by simply adding a cache to the rule list. - In our tests (with over 700 rules), the rule engine achieved a performance improvement of about 5 times after applying this optimization. +- Improve the performance of the rule engine when there are a large number of rules [#10283](https://github.com/emqx/emqx/pull/10283) + Before this change, when there were a large number of rules, the execution of the rule engine became a bottleneck, as the rule engine consumed a lot of CPU time on rule queries and matching. + In this optimization, we simply added a cache to the rule list, which greatly improved the efficiency of rule execution in this scenario. + In our tests, we created 700 rules that did not perform any actions (bound to the "do_nothing" debugging action) on a 32-core, 32GB virtual machine, + and sent MQTT messages to EMQX at a rate of 1000 messages per second (i.e. a rule trigger frequency of 700 * 1000 times per second). + After applying this optimization, the CPU usage of the rule engine dropped to 55% to 60% of its original level. + ## Bug fixes diff --git a/changes/v4.4.17-zh.md b/changes/v4.4.17-zh.md index 34a19d23e..737ff92f7 100644 --- a/changes/v4.4.17-zh.md +++ b/changes/v4.4.17-zh.md @@ -23,7 +23,9 @@ - 提升规则数量较多时规则引擎的执行性能 [#10283](https://github.com/emqx/emqx/pull/10283) 在此改动之前,当规则数量比较多的时候,规则引擎的执行会成为瓶颈,规则引擎将耗费大量 CPU 在规则的查询和匹配上。 本次优化中,通过简单地给规则列表添加一个缓存,大幅提升了此场景下的规则执行效率。 - 在我们的测试中(700多条规则),应用此优化后规则引擎获得了 5 倍左右的性能提升。 + 在我们的测试中,在一个 32 核 32G 的虚拟机上,我们创建了 700 条不执行任何动作的规则(绑定了 "do_nothing" 调试动作), + 并以 1000 条每秒的速度向 EMQX 发送 MQTT 消息(即,规则触发频率为 700 * 1000 次每秒), + 在应用此优化后,规则引擎的 CPU 使用率下降到了原来的 55% ~ 60%。 ## 修复