Skip to content

Commit

Permalink
Merge pull request #4924 from ipfs/docs/config
Browse files Browse the repository at this point in the history
Add information about bloom filter to config.md
  • Loading branch information
whyrusleeping committed Jul 16, 2018
2 parents b126601 + c3e3da4 commit 419bfdc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/config.md
Expand Up @@ -146,8 +146,13 @@ A boolean value. If set to true, all block reads from disk will be hashed and
verified. This will cause increased CPU utilization.

- `BloomFilterSize`
A number representing the size in bytes of the blockstore's bloom filter. A
value of zero represents the feature being disabled.
A number representing the size in bytes of the blockstore's [bloom filter](https://en.wikipedia.org/wiki/Bloom_filter). A value of zero represents the feature being disabled.

This site generates useful graphs for various bloom filter values: <https://hur.st/bloomfilter/?n=1e6&p=0.01&m=&k=7>
You may use it to find a preferred optimal value, where `m` is `BloomFilterSize` in bits. Remember to convert the value `m` from bits, into bytes for use as `BloomFilterSize` in the config file.
For example, for 1,000,000 blocks, expecting a 1% false positive rate, you'd end up with a filter size of 9592955 bits, so for `BloomFilterSize` we'd want to use 1199120 bytes.
As of writing, [7 hash functions](https://github.com/ipfs/go-ipfs-blockstore/blob/547442836ade055cc114b562a3cc193d4e57c884/caching.go#L22) are used, so the constant `k` is 7 in the formula.


Default: `0`

Expand Down

0 comments on commit 419bfdc

Please sign in to comment.