Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0265e5c

Browse files
committed
ci: Use a RAM disk and more CPUs on FreeBSD.
Run the tests in a RAM disk. It's still a UFS file system and is backed by 20GB of disk, but this avoids a lot of I/O. Even though we disable fsync, our tests do a lot of directory manipulations, some of which force file system meta-data to disk and flush slow device write caches on UFS. This was a bottleneck preventing effective scaling beyond 2 CPUs. Now we can use 4 CPUs like on other OSes, for a huge speedup. Reviewed-by: Maxim Orlov <orlovmg@gmail.com> Discussion: https://postgr.es/m/CA%2BhUKG%2BFXLcEg1dyTqJjDiNQ8pGom4KrJj4wF38C90thti9dVA%40mail.gmail.com
1 parent 77cf6a7 commit 0265e5c

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

.cirrus.tasks.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,9 @@ task:
126126
name: FreeBSD - 13 - Meson
127127

128128
env:
129-
# FreeBSD on GCP is slow when running with larger number of CPUS /
130-
# jobs. Using one more job than cpus seems to work best.
131-
CPUS: 2
132-
BUILD_JOBS: 3
133-
TEST_JOBS: 3
129+
CPUS: 4
130+
BUILD_JOBS: 4
131+
TEST_JOBS: 8
134132
IMAGE_FAMILY: pg-ci-freebsd-13
135133
DISK_SIZE: 50
136134

src/tools/ci/gcp_freebsd_repartition.sh

+11-13
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,24 @@
33
set -e
44
set -x
55

6-
# The default filesystem on freebsd gcp images is very slow to run tests on,
7-
# due to its 32KB block size
8-
#
9-
# XXX: It'd probably better to fix this in the image, using something like
10-
# https://people.freebsd.org/~lidl/blog/re-root.html
11-
126
# fix backup partition table after resize
137
gpart recover da0
148
gpart show da0
15-
# kill swap, so we can delete a partition
16-
swapoff -a || true
17-
# (apparently we can only have 4!?)
9+
10+
# delete and re-add swap partition with expanded size
11+
swapoff -a
1812
gpart delete -i 3 da0
19-
gpart add -t freebsd-ufs -l data8k -a 4096 da0
13+
gpart add -t freebsd-swap -l swapfs -a 4096 da0
2014
gpart show da0
21-
newfs -U -b 8192 /dev/da0p3
15+
swapon -a
16+
17+
# create a file system on a memory disk backed by swap, to minimize I/O
18+
mdconfig -a -t swap -s20g -u md1
19+
newfs -b 8192 -U /dev/md1
2220

23-
# Migrate working directory
21+
# migrate working directory
2422
du -hs $CIRRUS_WORKING_DIR
2523
mv $CIRRUS_WORKING_DIR $CIRRUS_WORKING_DIR.orig
2624
mkdir $CIRRUS_WORKING_DIR
27-
mount -o noatime /dev/da0p3 $CIRRUS_WORKING_DIR
25+
mount -o noatime /dev/md1 $CIRRUS_WORKING_DIR
2826
cp -r $CIRRUS_WORKING_DIR.orig/* $CIRRUS_WORKING_DIR/

0 commit comments

Comments
 (0)