1
0
Fork 0

Update PERFORMANCE.md

[ci skip]
master
Philip O'Toole 3 years ago committed by GitHub
parent 1b36e9c959
commit cfddb0310c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -43,13 +43,15 @@ An alternative approach would be to place the SQLite on-disk database on a disk
# In-memory Database Limits
In-memory databases are currently limited to 2GiB in size. One way to get around this limit is to use an on-disk database, by passing `-on-disk` to `rqlited`. But this would impact performance significantly, since disk is slower than memory.
However by telling rqlite to place the SQLite database file on a memory-backed filesystem you can use larger databases, and still have good performance. To control where rqlite places the SQLite database file, set `-on-disk-path` when launching `rqlited`. **Note that you should still place the `data` directory on an actual disk, to ensure your data is not lost if a node retarts.**
However by telling rqlite to place the SQLite database file on a memory-backed filesystem you can use larger databases, and still have good performance. To control where rqlite places the SQLite database file, set `-on-disk-path on-disk-startup` when launching `rqlited`. **Note that you should still place the `data` directory on an actual disk, to ensure your data is not lost if a node retarts.**
Setting `-on-disk-startup` is also important because it disables an optimization rqlite performs at startup, when using an on-disk SQLite database. rqlite, by default, initially builds any on-disk database in memory first, before moving it to disk. It does this to reduce startup times. But with databases larger than 2GiB, this optimization can cause rqlite to fail to start. To avoid this issue, you can disable this optimization via the flag.
## Linux example
An example of running rqlite with a SQLite file on a memory-backed file system, and keeping the data directory on persistent disk, is shown below. This example would allow up to a 4GB SQLite database.
```bash
# ~/node1 is assumed to be a path on persistent disk.
mount -t tmpfs -o size=4096m tmpfs /mnt/ramdisk
rqlited -on-disk -on-disk-path /mnt/ramdisk/node1/db.sqlite ~/node1
rqlited -on-disk -on-disk-path on-disk-startup /mnt/ramdisk/node1/db.sqlite ~/node1
```

Loading…
Cancel
Save