Skip to content

Commit 56ee63c

Browse files
committed
feat(database): disable copy on write to improve performance
1 parent acbcb3b commit 56ee63c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

database/bin/boot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ if [[ ! -f /var/lib/postgresql/9.3/main/initialized ]]; then
7272
if [[ `envdir /etc/wal-e.d/env wal-e --terse backup-list | wc -l` -gt "1" ]]; then
7373
echo "database: restoring from backup..."
7474
rm -rf /var/lib/postgresql/9.3/main
75+
mkdir -p /var/lib/postgresql/9.3/main
76+
# disable copy-on-write
77+
chattr -R +C /var/lib/postgresql/9.3/main
7578
sudo -u postgres envdir /etc/wal-e.d/env wal-e backup-fetch /var/lib/postgresql/9.3/main LATEST
7679
chown -R postgres:postgres /var/lib/postgresql/9.3/main
7780
chmod 0700 /var/lib/postgresql/9.3/main

0 commit comments

Comments
 (0)