Skip to content

Commit a264b00

Browse files
committed
kube-up.sh: set inotify limits
also debug inotify limits before/after setting
1 parent 4288af4 commit a264b00

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

cluster/gce/gci/configure-helper.sh

+18
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@ function setup-os-params {
6666
# /sbin/crash_reporter which is more restrictive in saving crash dumps. So for
6767
# now, set a generic core_pattern that users can work with.
6868
echo "/core.%e.%p.%t" > /proc/sys/kernel/core_pattern
69+
echo "Default max_user_watches / max_user_instances:"
70+
# ensure we have enough inotify watches for many pods, versus the OS defaults
71+
# debug before & after / defaults for comparison
72+
sysctl fs.inotify.max_user_watches
73+
sysctl fs.inotify.max_user_instances
74+
cat <<EOF > /etc/sysctl.d/inotify.conf
75+
fs.inotify.max_user_watches=65536
76+
fs.inotify.max_user_instances=8192
77+
EOF
78+
# Ubuntu vs COS, load sysctl settings now
79+
if [[ -e "/usr/lib/systemd/systemd-sysctl" ]]; then
80+
/usr/lib/systemd/systemd-sysctl
81+
else
82+
/lib/systemd/systemd-sysctl
83+
fi
84+
echo "Updated max_user_watches / max_user_instances:"
85+
sysctl fs.inotify.max_user_watches
86+
sysctl fs.inotify.max_user_instances
6987
}
7088

7189
# secure_random generates a secure random string of bytes. This function accepts

0 commit comments

Comments
 (0)