Skip to content

Commit

Permalink
[fix](memory) Modified low water mark=min(6.4G, MemTotal * 5%) (apach…
Browse files Browse the repository at this point in the history
…e#37525)

On 64G machine, warning water mark is 12.8G. when system available
memory reaches the warning water mark, load memtable will flush, this is
not a good idea.

`mem_limit` default 10%, except for the memory used by the Linux kernel
, buffer may be around 5%, so low water mark=min(6.4G, MemTotal * 5%)
looks better.
  • Loading branch information
xinyiZzz committed Jul 12, 2024
1 parent 7bd8902 commit 6e2552b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ DECLARE_mInt32(max_fill_rate);
DECLARE_mInt32(double_resize_threshold);

// The maximum low water mark of the system `/proc/meminfo/MemAvailable`, Unit byte, default 6.4G,
// actual low water mark=min(6.4G, MemTotal * 10%), avoid wasting too much memory on machines
// with large memory larger than 64G.
// Turn up max. On machines with more than 64G memory, more memory buffers will be reserved for Full GC.
// actual low water mark=min(6.4G, MemTotal * 5%), avoid wasting too much memory on machines
// with large memory larger than 128G.
// Turn up max. On machines with more than 128G memory, more memory buffers will be reserved for Full GC.
// Turn down max. will use as much memory as possible.
DECLARE_Int64(max_sys_mem_available_low_water_mark_bytes);

Expand Down
2 changes: 1 addition & 1 deletion be/src/util/mem_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void MemInfo::init() {
// upper sys_mem_available_low_water_mark, avoid wasting too much memory.
_s_sys_mem_available_low_water_mark = std::max<int64_t>(
std::min<int64_t>(std::min<int64_t>(_s_physical_mem - _s_mem_limit,
int64_t(_s_physical_mem * 0.1)),
int64_t(_s_physical_mem * 0.05)),
config::max_sys_mem_available_low_water_mark_bytes),
0);
_s_sys_mem_available_warning_water_mark = _s_sys_mem_available_low_water_mark * 2;
Expand Down

0 comments on commit 6e2552b

Please sign in to comment.