Skip to content

Commit

Permalink
set read-ahead
Browse files Browse the repository at this point in the history
  • Loading branch information
cvvz committed Sep 20, 2022
1 parent e5737c6 commit b0fc518
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/blobfuse-proxy/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ INSTALL_BLOBFUSE_PROXY=${INSTALL_BLOBFUSE_PROXY:-true}
INSTALL_BLOBFUSE=${INSTALL_BLOBFUSE:-true}
DISABLE_UPDATEDB=${DISABLE_UPDATEDB:-true}
SET_MAX_OPEN_FILE_NUM=${SET_MAX_OPEN_FILE_NUM:-true}
READ_AHEAD_KB=${READ_AHEAD_KB:-15380}

HOST_CMD="nsenter --mount=/proc/1/ns/mnt"

Expand Down Expand Up @@ -68,4 +69,9 @@ then
sed -i 's/PRUNEFS="NFS/PRUNEFS="fuse blobfuse NFS/g' ${updateDBConfigPath}
echo "after change:"
cat ${updateDBConfigPath}
fi
fi

cat > /host/etc/udev/rules.d/99-nfs.rules <<EOF
SUBSYSTEM=="bdi", ACTION=="add", PROGRAM="/bin/awk -v bdi=\$kernel 'BEGIN{ret=1} {if (\$4 == bdi){ret=0}} END{exit ret}' /proc/fs/nfsfs/volumes", ATTR{read_ahead_kb}="$READ_AHEAD_KB"
EOF
$HOST_CMD udevadm control --reload

0 comments on commit b0fc518

Please sign in to comment.