Skip to content

Commit 141108f

Browse files
committed
Add cache configuration
1 parent cc0868a commit 141108f

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,33 @@ Every node runs this algorithm independently. The access log is moved along with
10511051

10521052
#### Configuration of eviction mechanisms
10531053

1054+
Here is a simple configuration block for `olricd.yaml`:
1055+
1056+
```
1057+
cache:
1058+
numEvictionWorkers: 1
1059+
maxIdleDuration: ""
1060+
ttlDuration: "100s"
1061+
maxKeys: 100000
1062+
maxInuse: 1000000 # in bytes
1063+
lRUSamples: 10
1064+
evictionPolicy: "LRU" # NONE/LRU
1065+
```
1066+
1067+
You can also set cache configuration per DMap. Here is a simple configuration for a DMap named `foobar`:
1068+
1069+
```
1070+
dmaps:
1071+
foobar:
1072+
maxIdleDuration: "60s"
1073+
ttlDuration: "300s"
1074+
maxKeys: 500000 # in-bytes
1075+
lRUSamples: 20
1076+
evictionPolicy: "NONE" # NONE/LRU
1077+
```
1078+
1079+
If you prefer embedded-member deployment scenario, please take a look at [config#CacheConfig](https://godoc.org/github.com/buraksezer/olric/config#CacheConfig) and [config#DMapCacheConfig](https://godoc.org/github.com/buraksezer/olric/config#DMapCacheConfig) for the configuration.
1080+
10541081

10551082
### Lock Implementation
10561083

olric.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var (
6161
)
6262

6363
// ReleaseVersion is the current stable version of Olric
64-
const ReleaseVersion string = "0.2.0-rc.5"
64+
const ReleaseVersion string = "0.2.0"
6565

6666
const (
6767
nilTimeout = 0 * time.Second

0 commit comments

Comments
 (0)