freebsd:zfs
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| freebsd:zfs [2020/10/20 06:47] – sleepy | freebsd:zfs [2025/07/07 23:10] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| < | < | ||
| < | < | ||
| - | + | ---- | |
| - | + | ||
| ====== Create ZFS dataset ====== | ====== Create ZFS dataset ====== | ||
| ===== PostgreSQL ===== | ===== 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 ==== | ==== zfs ==== | ||
| * **atime=off** -- disable access time recording for files when they are read | * **atime=off** -- disable access time recording for files when they are read | ||
| * **compression=lz4** -- turn on compression | * **compression=lz4** -- turn on compression | ||
| * **recordsize=8k** -- set record size to postgres' | * **recordsize=8k** -- set record size to postgres' | ||
| - | * **logbias=throughput** | + | * **logbias=throughput** |
| - | * **primarycache=metadata** -- ARC only cache metadata (dnode entries), not page data itself | + | * **primarycache=metadata** -- ARC only cache metadata (dnode entries), not page data itself. DO NOT disable if PostgreSQL' |
| * quota=500G | * quota=500G | ||
| Line 19: | Line 23: | ||
| * disable full_page_writes | * disable full_page_writes | ||
| * disable PostgreSQL TOAST compression | * 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, | ||
| + | ---- | ||
| ====== / | ====== / | ||
| < | < | ||
| Line 64: | Line 84: | ||
| </ | </ | ||
| + | ---- | ||
| ===== Benchmarks ===== | ===== Benchmarks ===== | ||
| {{tablelayout? | {{tablelayout? | ||
freebsd/zfs.1603176454.txt.gz · Last modified: (external edit)
