Merge pull request #9625 from zmstone/1228-only-high-load-detect-in-linux

fix(kafka): Memory OLP is only applicable in linux systems
This commit is contained in:
Zaiming (Stone) Shi 2022-12-28 22:06:21 +01:00 committed by GitHub
commit 4e61e0602d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -438,10 +438,12 @@ emqx_ee_bridge_kafka {
desc {
en: "Applicable when buffer mode is set to <code>memory</code> or <code>hybrid</code>.\n"
"EMQX will drop old cached messages under high memory pressure. "
"The high memory threshold is defined in config <code>sysmon.os.sysmem_high_watermark</code>."
"The high memory threshold is defined in config <code>sysmon.os.sysmem_high_watermark</code>. "
"NOTE: This config only works on Linux."
zh: "缓存模式是 <code>memory</code> 或 <code>hybrid</code> 时适用。"
"当系统处于高内存压力时,从队列中丢弃旧的消息以减缓内存增长。"
"内存压力值由配置项 <code>sysmon.os.sysmem_high_watermark</code> 决定。"
"注意,该配置仅在 Linux 系统中有效。"
}
label {
en: "Memory Overload Protection"

View File

@ -1,6 +1,6 @@
{application, emqx_ee_bridge, [
{description, "EMQX Enterprise data bridges"},
{vsn, "0.1.1"},
{vsn, "0.1.2"},
{registered, []},
{applications, [
kernel,

View File

@ -236,10 +236,14 @@ producers_config(BridgeName, ClientId, Input) ->
mode := BufferMode,
per_partition_limit := PerPartitionLimit,
segment_bytes := SegmentBytes,
memory_overload_protection := MemOLP
memory_overload_protection := MemOLP0
}
} = Input,
MemOLP =
case os:type() of
{unix, linux} -> MemOLP0;
_ -> false
end,
{OffloadMode, ReplayqDir} =
case BufferMode of
memory -> {false, false};