mirror of
https://github.com/fluencelabs/redis
synced 2025-04-22 09:02:13 +00:00
Defrag: test currently disabled, too many false positives.
Related to #3786.
This commit is contained in:
parent
a17390853d
commit
c861e1e1ee
@ -36,48 +36,50 @@ start_server {tags {"memefficiency"}} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
start_server {tags {"defrag"}} {
|
if 0 {
|
||||||
if {[string match {*jemalloc*} [s mem_allocator]]} {
|
start_server {tags {"defrag"}} {
|
||||||
test "Active defrag" {
|
if {[string match {*jemalloc*} [s mem_allocator]]} {
|
||||||
r config set activedefrag no
|
test "Active defrag" {
|
||||||
r config set active-defrag-threshold-lower 5
|
r config set activedefrag no
|
||||||
r config set active-defrag-ignore-bytes 2mb
|
r config set active-defrag-threshold-lower 5
|
||||||
r config set maxmemory 100mb
|
r config set active-defrag-ignore-bytes 2mb
|
||||||
r config set maxmemory-policy allkeys-lru
|
r config set maxmemory 100mb
|
||||||
r debug populate 700000 asdf 150
|
r config set maxmemory-policy allkeys-lru
|
||||||
r debug populate 170000 asdf 300
|
r debug populate 700000 asdf 150
|
||||||
set frag [s mem_fragmentation_ratio]
|
r debug populate 170000 asdf 300
|
||||||
assert {$frag >= 1.7}
|
set frag [s mem_fragmentation_ratio]
|
||||||
r config set activedefrag yes
|
assert {$frag >= 1.7}
|
||||||
after 1500 ;# active defrag tests the status once a second.
|
r config set activedefrag yes
|
||||||
set hits [s active_defrag_hits]
|
after 1500 ;# active defrag tests the status once a second.
|
||||||
|
|
||||||
# wait for the active defrag to stop working
|
|
||||||
set tries 0
|
|
||||||
while { True } {
|
|
||||||
incr tries
|
|
||||||
after 500
|
|
||||||
set prev_hits $hits
|
|
||||||
set hits [s active_defrag_hits]
|
set hits [s active_defrag_hits]
|
||||||
if {$hits == $prev_hits} {
|
|
||||||
break
|
# wait for the active defrag to stop working
|
||||||
|
set tries 0
|
||||||
|
while { True } {
|
||||||
|
incr tries
|
||||||
|
after 500
|
||||||
|
set prev_hits $hits
|
||||||
|
set hits [s active_defrag_hits]
|
||||||
|
if {$hits == $prev_hits} {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
assert {$tries < 100}
|
||||||
}
|
}
|
||||||
assert {$tries < 100}
|
|
||||||
|
# TODO: we need to expose more accurate fragmentation info
|
||||||
|
# i.e. the allocator used and active pages
|
||||||
|
# instead we currently look at RSS so we need to ask for purge
|
||||||
|
r memory purge
|
||||||
|
|
||||||
|
# Test the the fragmentation is lower and that the defragger
|
||||||
|
# stopped working
|
||||||
|
set frag [s mem_fragmentation_ratio]
|
||||||
|
assert {$frag < 1.55}
|
||||||
|
set misses [s active_defrag_misses]
|
||||||
|
after 500
|
||||||
|
set misses2 [s active_defrag_misses]
|
||||||
|
assert {$misses2 == $misses}
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO: we need to expose more accurate fragmentation info
|
|
||||||
# i.e. the allocator used and active pages
|
|
||||||
# instead we currently look at RSS so we need to ask for purge
|
|
||||||
r memory purge
|
|
||||||
|
|
||||||
# Test the the fragmentation is lower and that the defragger
|
|
||||||
# stopped working
|
|
||||||
set frag [s mem_fragmentation_ratio]
|
|
||||||
assert {$frag < 1.55}
|
|
||||||
set misses [s active_defrag_misses]
|
|
||||||
after 500
|
|
||||||
set misses2 [s active_defrag_misses]
|
|
||||||
assert {$misses2 == $misses}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user