Skip to content

unix: call ulimit -n to avoid overheads #468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cpython-unix/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@ RUN ( echo 'amd64'; \
echo 'i386'; \
) > /var/lib/dpkg/arch

RUN apt-get update
# apt iterates all available file descriptors up to rlim_max and calls
# fcntl(fd, F_SETFD, FD_CLOEXEC). This can result in millions of system calls
# (we've seen 1B in the wild) and cause operations to take seconds to minutes.
# Setting a fd limit mitigates.
#
# Attempts at enforcing the limit globally via /etc/security/limits.conf and
# /root/.bashrc were not successful. Possibly because container image builds
# don't perform a login or use a shell the way we expect.
RUN ulimit -n 10000 && apt-get update
2 changes: 1 addition & 1 deletion cpython-unix/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Compression packages are needed to extract archives.
#
# Various other build tools are needed for various building.
RUN apt-get install \
RUN ulimit -n 10000 && apt-get install \
bzip2 \
file \
libc6-dev \
Expand Down
2 changes: 1 addition & 1 deletion cpython-unix/gcc.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% include 'base.Dockerfile' %}
RUN apt-get install \
RUN ulimit -n 10000 && apt-get install \
autoconf \
automake \
bison \
Expand Down
2 changes: 1 addition & 1 deletion cpython-unix/xcb.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% include 'build.Dockerfile' %}
RUN apt-get install \
RUN ulimit -n 10000 && apt-get install \
python
Loading