mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-12 10:55:46 +02:00
feat(server): add oom guard (#1650)
1. add flag maxmemory_ratio 2. When current used memory * maxmemory_ratio > maxmemory_limit denyoom commands will return oom error. Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
parent
7c99d2d111
commit
116934b008
5 changed files with 51 additions and 4 deletions
|
@ -167,6 +167,7 @@ void BaseFamilyTest::ResetService() {
|
|||
Service::InitOpts opts;
|
||||
opts.disable_time_update = true;
|
||||
service_->Init(nullptr, {}, opts);
|
||||
used_mem_current = 0;
|
||||
|
||||
TEST_current_time_ms = absl::GetCurrentTimeNanos() / 1000000;
|
||||
auto cb = [&](EngineShard* s) { s->db_slice().UpdateExpireBase(TEST_current_time_ms - 1000, 0); };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue