Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
haf_api_node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
haf_api_node
Commits
f747db34
Commit
f747db34
authored
1 year ago
by
Dan Notestein
Browse files
Options
Downloads
Patches
Plain Diff
Switch ZFS datasets for postgres to the default 128k record size,
create a separate dataset for the WAL
parent
99a3daf0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
create_zfs_datasets.sh
+4
-2
4 additions, 2 deletions
create_zfs_datasets.sh
rollback_zfs_datasets.sh
+3
-0
3 additions, 0 deletions
rollback_zfs_datasets.sh
snapshot_zfs_datasets.sh
+2
-0
2 additions, 0 deletions
snapshot_zfs_datasets.sh
with
9 additions
and
2 deletions
create_zfs_datasets.sh
+
4
−
2
View file @
f747db34
...
...
@@ -61,7 +61,9 @@ echo " mounted on: $TOP_LEVEL_DATASET_MOUNTPOINT"
zfs_common_options
=
"-o atime=off"
zfs_compressed_options
=
"-o compression=lz4"
zfs_uncompressed_options
=
"-o compression=off"
zfs_postgres_options
=
"-o recordsize=8k"
# or "-o recordsize=16k", consider also "-o logbias=throughput"
# several sites recommend 8k blocks for optimizing postgres on zfs, but we have found that it
# kills compression ratios for haf_block_log, so we've decided to leave it at the default 128k
zfs_postgres_options
=
""
# or "-o recordsize=8k -o recordsize=16k", consider also "-o logbias=throughput"
zfs create
$zfs_common_options
$zfs_compressed_options
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
"
# create an uncompressed dataset for the blockchain. Blocks in it are already compressed, so won't compress further.
...
...
@@ -79,7 +81,7 @@ zfs create $zfs_common_options $zfs_uncompressed_options $zfs_postgres_options -
# create a dataset for the write-ahead logs, simply to reduce the size of snapshots of other datasets
# note: this is disabled, I'm not sure we really care about the size of the snapshots of other datasets, we
# only care about the total size, and I'm not sure this gives us any benefit
#
zfs create $zfs_common_options $zfs_uncompressed_options $zfs_postgres_options -o canmount=on "${ZPOOL}/${TOP_LEVEL_DATASET}/haf_db_store/pgdata/pg_wal"
zfs create
$zfs_common_options
$zfs_uncompressed_options
$zfs_postgres_options
-o
canmount
=
on
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata/pg_wal"
# create a dataset for the main HAF database itself
zfs create
$zfs_common_options
$zfs_compressed_options
$zfs_postgres_options
-o
canmount
=
on
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/tablespace"
...
...
This diff is collapsed.
Click to expand it.
rollback_zfs_datasets.sh
+
3
−
0
View file @
f747db34
...
...
@@ -68,6 +68,7 @@ echo " mounted on: $TOP_LEVEL_DATASET_MOUNTPOINT"
sync
;
sync
;
sync
echo
3
>
/proc/sys/vm/drop_caches
zfs umount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata/pg_wal"
zfs umount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata"
zfs umount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/tablespace"
zfs umount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/blockchain"
...
...
@@ -77,8 +78,10 @@ zfs rollback "${ZPOOL}/${TOP_LEVEL_DATASET}@${SNAPSHOT_NAME}"
zfs rollback
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/blockchain@
${
SNAPSHOT_NAME
}
"
zfs rollback
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/tablespace@
${
SNAPSHOT_NAME
}
"
zfs rollback
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata@
${
SNAPSHOT_NAME
}
"
zfs rollback
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata/pg_wal@
${
SNAPSHOT_NAME
}
"
zfs mount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
"
zfs mount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/blockchain"
zfs mount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/tablespace"
zfs mount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata"
zfs mount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata/pg_wal"
This diff is collapsed.
Click to expand it.
snapshot_zfs_datasets.sh
+
2
−
0
View file @
f747db34
...
...
@@ -68,6 +68,7 @@ echo " mounted on: $TOP_LEVEL_DATASET_MOUNTPOINT"
sync
;
sync
;
sync
echo
3
>
/proc/sys/vm/drop_caches
zfs umount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata/pg_wal"
zfs umount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata"
zfs umount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/tablespace"
zfs umount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/blockchain"
...
...
@@ -79,3 +80,4 @@ zfs mount "${ZPOOL}/${TOP_LEVEL_DATASET}"
zfs mount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/blockchain"
zfs mount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/tablespace"
zfs mount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata"
zfs mount
"
${
ZPOOL
}
/
${
TOP_LEVEL_DATASET
}
/haf_db_store/pgdata/pg_wal"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment