armon / bloomd

C network daemon for bloom filters
http://armon.github.io/bloomd
Other
1.24k stars 112 forks source link

create in_memory option is ignored #27

Closed peczenyj closed 10 years ago

peczenyj commented 10 years ago

running bloomd with default options

create bar capacity=89000 prob=0.002 in_memory=0
Done

I am setting in_memory to 0, then

info bar
START
capacity 89000
checks 0
check_hits 0
check_misses 0
in_memory 1      # HERE
page_ins 0
page_outs 0
probability 0.002000
sets 0
set_hits 0
set_misses 0
size 0
storage 197730

seems bloomd is ignoring the in_memory option. why?

armon commented 10 years ago

@peczenyj This is an unfortunate naming overlap. When you specify "in_memory" in the create statement, it controls if the filter exists only in memory, meaning it is not persisted to disk. By default it is 0, meaning it is saved to disk.

When you do info on a filter, it returns various stats. The in_memory key represents if the filter is currently located in-memory, not if it is only in memory. Does that distinction make sense?

A filter that is in-memory only will never be faulted to disk, since there is no persistent representation. Normal filters will be removed from memory after a period of inactivity, and thus they will report "in_memory 0".