Skip to content

Commit

Permalink
Set ulimit -n properly
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiggar committed Nov 29, 2022
1 parent 9c78b7a commit 1b32f17
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ executors:
IN_DEV_CONTAINER: true
docker:
# DOCKERFILE_REPO: see Dockerfile note about how this is built.
- image: darklang/dark-base:4cd3b01
- image: darklang/dark-base:89294ed

commands:
show-large-files-and-directories:
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"8.8.8.8",
"--dns",
"8.8.4.4",
"--ulimit=nofile=65536:65536",
"--hostname",
"dark-dev",
"--env-file",
Expand Down
8 changes: 5 additions & 3 deletions containers/base-fsharp-nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ pid /tmp/nginx.pid;

# CHANGED FOR DARK
# nginx complains if this setting isn't present
# ulimit -n is set to 1048576 in the apiserver http-proxy container (also in the
# devcontainer, and also in the nginx-ingress container, though this config isn't used
# there). However, it's limited to 65536 in CI.
# This number must be >= worker_connections (below) and <= `ulimit -n` ("nofile",
# number of files). We've set `ulimit -n` to match CI, where it is set to 65536, and
# cannot be changed. In production, it's set to 1048576 in the apiserver http-proxy
# container (and also in the nginx-ingress container, though this config isn't used
# there).
worker_rlimit_nofile 65536;

events {
Expand Down
2 changes: 2 additions & 0 deletions scripts/builder
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ echo "Run the build"
# -p 9000:9000 to expose the F# api server
# -p 11001:11001 to expose the F# bwd server
# -cap-add & -security-opt to attach a gdb/strace to .net code
# --ulimit=nofile=65536:65536 to match CI
docker run \
--init \
--rm \
Expand All @@ -149,6 +150,7 @@ docker run \
--user "$(id -u):$gid" \
--cap-add=ALL \
--security-opt seccomp=unconfined \
--ulimit=nofile=65536:65536 \
$MOUNTS \
dark \
scripts/build/_build-server "${@}"

0 comments on commit 1b32f17

Please sign in to comment.