freebsd:zfs
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| freebsd:zfs [2020/09/27 01:54] – created sleepy | freebsd:zfs [2025/07/07 23:10] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== ZFS Commands ===== | + | ====== ZFS Commands |
| < | < | ||
| < | < | ||
| + | ---- | ||
| + | ====== Create ZFS dataset ====== | ||
| - | === / | + | ===== PostgreSQL ===== |
| + | ~~REFNOTES~~ | ||
| + | ==== notes ==== | ||
| + | * use ZFS's cache is postgresql dataset exceeds RAM, use postgres' | ||
| + | * disable postgres cache, enable ZFS cache | ||
| + | * enable postgres cache, disable ZFS cache | ||
| + | |||
| + | ==== zfs ==== | ||
| + | * **atime=off** -- disable access time recording for files when they are read | ||
| + | * **compression=lz4** -- turn on compression | ||
| + | * **recordsize=8k** -- set record size to postgres' | ||
| + | * **logbias=throughput** | ||
| + | * **primarycache=metadata** -- ARC only cache metadata (dnode entries), not page data itself. DO NOT disable if PostgreSQL' | ||
| + | * quota=500G | ||
| + | |||
| + | ==== postgres ==== | ||
| + | * disable full_page_writes | ||
| + | * disable PostgreSQL TOAST compression | ||
| + | * dedicate 15%-25% physical ram to ARC, and 50% to shared_buffers | ||
| + | === raw benchmark data === | ||
| + | {{tablelayout? | ||
| + | ^ pgbench -c 10 -j 2 -t 10000 ^ inc. connections est. ^ exc. connections est. ^ latency ^ | ||
| + | | BASE | 6775 | 6776 | 1.476 ms | | ||
| + | | primarycache=metadata | 3850 | 3850 | 2.597 ms | | ||
| + | | primarycache=metadata compression=lz4 | 4815 | 4816 | 2.077 ms | | ||
| + | | primarycache=metadata compression=lz4 recordsize=16k | 4160 | 4160 | 2.404 ms | | ||
| + | | primarycache=metadata, | ||
| + | | primarycache=metadata, | ||
| + | | primarycache=metadata, | ||
| + | | primarycache=metadata, | ||
| + | | compression=lz4, | ||
| + | | compression=lz4, | ||
| + | | compression=lz4, | ||
| + | | compression=lz4, | ||
| + | |||
| + | |||
| + | ---- | ||
| + | ====== / | ||
| < | < | ||
| # ZFS tuning. arc min at 2GB, max at 8GB. ashift to 12 for 4k sectors | # ZFS tuning. arc min at 2GB, max at 8GB. ashift to 12 for 4k sectors | ||
| Line 45: | Line 84: | ||
| </ | </ | ||
| + | ---- | ||
| ===== Benchmarks ===== | ===== Benchmarks ===== | ||
| {{tablelayout? | {{tablelayout? | ||
freebsd/zfs.1601171688.txt.gz · Last modified: (external edit)
