Skip to content

Commit 98c6102

Browse files
author
Pawan Rawal
authored
Change default to memorymap and update recommendation to one-third RAM in docs. (#2315)
1 parent ea30418 commit 98c6102

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

dgraph/cmd/server/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func init() {
6262
"Directory to store posting lists.")
6363
flag.String("posting_tables", defaults.PostingTables,
6464
"Specifies how Badger LSM tree is stored. Options are loadtoram, memorymap and "+
65-
"fileio; which consume most to least RAM while providing best to worst "+
65+
"fileio; which consume most to least RAM while providing best to worst read"+
6666
"performance respectively.")
6767
flag.StringP("wal", "w", defaults.WALDir,
6868
"Directory to store raft write-ahead logs.")

edgraph/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var Config Options
4242

4343
var DefaultConfig = Options{
4444
PostingDir: "p",
45-
PostingTables: "loadtoram",
45+
PostingTables: "memorymap",
4646
WALDir: "w",
4747
Nomutations: false,
4848

wiki/content/deploy/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ Dgraph cluster nodes use different ports to communicate over gRPC and http. User
198198
If you are using Dgraph v1.0.2 (or older) then the default ports are 7080, 8080 for zero, so when following instructions for different setup guides below override zero port using `--port_offset`.
199199

200200
```sh
201-
dgraph zero --idx=1 --lru_mb=<typically half the RAM> --port_offset -2000
202-
dgraph zero --idx=2 --lru_mb=<typically half the RAM> --port_offset -1999
201+
dgraph zero --idx=1 --lru_mb=<typically one-third the RAM> --port_offset -2000
202+
dgraph zero --idx=2 --lru_mb=<typically one-third the RAM> --port_offset -1999
203203
```
204204
Ratel's default port is 8081, so override it using -p 8000.
205205

@@ -258,8 +258,8 @@ For all other various flags, run `dgraph zero --help`.
258258
**Run dgraph server**
259259

260260
```sh
261-
dgraph server --lru_mb=<typically half the RAM> --my=IPADDR:7080 --zero=localhost:5080
262-
dgraph server --lru_mb=<typically half the RAM> --my=IPADDR:7081 --zero=localhost:5080 -o=1
261+
dgraph server --lru_mb=<typically one-third the RAM> --my=IPADDR:7080 --zero=localhost:5080
262+
dgraph server --lru_mb=<typically one-third the RAM> --my=IPADDR:7081 --zero=localhost:5080 -o=1
263263
```
264264
Notice the use of -o for the second server to add offset to the default ports used by server. Zero automatically assigns an unique ID to each Dgraph server, which is persisted in the write ahead log (wal) directory, users can specify the index using `--idx` option. Dgraph servers use two location to persist data and wal logs and have to be different for each server if they are running on the same host. User can use `-p` and `-w` to change the location of data and WAL. For all other flags, run
265265

@@ -293,11 +293,11 @@ docker run -it -p 5080:5080 -p 6080:6080 -v ~/zero:/dgraph dgraph/dgraph:latest
293293
```sh
294294
mkdir ~/server1 # Or any other directory where data should be stored.
295295

296-
docker run -it -p 7080:7080 -p 8080:8080 -p 9080:9080 -v ~/server1:/dgraph dgraph/dgraph:latest dgraph server --lru_mb=<typically half the RAM> --zero=HOSTIPADDR:5080 --my=HOSTIPADDR:7080
296+
docker run -it -p 7080:7080 -p 8080:8080 -p 9080:9080 -v ~/server1:/dgraph dgraph/dgraph:latest dgraph server --lru_mb=<typically one-third the RAM> --zero=HOSTIPADDR:5080 --my=HOSTIPADDR:7080
297297

298298
mkdir ~/server2 # Or any other directory where data should be stored.
299299

300-
docker run -it -p 7081:7081 -p 8081:8081 -p 9081:9081 -v ~/server2:/dgraph dgraph/dgraph:latest dgraph server --lru_mb=<typically half the RAM> --zero=HOSTIPADDR:5080 --my=HOSTIPADDR:7081 -o=1
300+
docker run -it -p 7081:7081 -p 8081:8081 -p 9081:9081 -v ~/server2:/dgraph dgraph/dgraph:latest dgraph server --lru_mb=<typically one-third the RAM> --zero=HOSTIPADDR:5080 --my=HOSTIPADDR:7081 -o=1
301301
```
302302
Notice the use of -o for server2 to override the default ports for server2.
303303

@@ -1416,7 +1416,7 @@ During bulk loading of data, Dgraph can consume more memory than usual, due to h
14161416

14171417
The recommended minimum RAM to run on desktops and laptops is 16GB. Dgraph can take up to 7-8 GB with the default setting `-lru_mb` set to 4096; so having the rest 8GB for desktop applications should keep your machine humming along.
14181418

1419-
On EC2/GCE instances, the recommended minimum is 8GB. It's recommended to set `-lru_mb` to half of RAM size.
1419+
On EC2/GCE instances, the recommended minimum is 8GB. It's recommended to set `-lru_mb` to one-third of RAM size.
14201420

14211421
## See Also
14221422

wiki/content/get-started/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Run 'dgraph-ratel' to start Dgraph UI. This can be used to do mutations and quer
150150
dgraph-ratel
151151
```
152152

153-
{{% notice "tip" %}}You need to set the estimated memory Dgraph server can take through `lru_mb` flag. This is just a hint to the Dgraph server and actual usage would be higher than this. It's recommended to set lru_mb to half the available RAM.{{% /notice %}}
153+
{{% notice "tip" %}}You need to set the estimated memory Dgraph server can take through `lru_mb` flag. This is just a hint to the Dgraph server and actual usage would be higher than this. It's recommended to set lru_mb to one-third the available RAM.{{% /notice %}}
154154

155155
#### Windows
156156

@@ -211,7 +211,7 @@ docker exec -it diggy dgraph-ratel
211211
If you are using Dgraph v1.0.2 (or older) then the default ports are 7080, 8080 for zero, so when following instructions for different setup guides override zero port using `--port_offset`.
212212

213213
```sh
214-
dgraph zero --lru_mb=<typically half the RAM> --port_offset -2000
214+
dgraph zero --lru_mb=<typically one-third the RAM> --port_offset -2000
215215
```
216216
Ratel's default port is 8081, so override it using -p 8000.
217217

0 commit comments

Comments
 (0)