Skip to content

Commit

Permalink
feat(server): remove ulimit (Jigsaw-Code#1447)
Browse files Browse the repository at this point in the history
This is unnecessarily restricting the server, which limits the number of connections we can support. It also can't raise the ulimit, since the host impose a cap on the container.

Service providers can still set the ulimit on their host if they want to.
  • Loading branch information
fortuna committed Nov 15, 2023
1 parent e157315 commit 3d2c3db
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/shadowbox/docker/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,6 @@ export SB_METRICS_URL="${SB_METRICS_URL:-https://prod.metrics.getoutline.org}"
# Make sure we don't leak readable files to other users.
umask 0007

# The maximum number of files that can be opened by ss-server greatly
# influence on performance, as described here:
# https://shadowsocks.org/en/config/advanced.html
#
# The steps described in that page do *not* work for processes running
# under Docker, at least on modern Debian/Ubuntu-like systems whose init
# daemons allow per-service limits and ignore completely
# /etc/security/limits.conf. On those systems, the Shadowbox container
# will, by default, inherit the limits configured for the Docker service:
# https://docs.docker.com/engine/reference/commandline/run/#set-ulimits-in-container-ulimit
#
# Interestingly, we observed poor performance with large values such as 524288
# and 1048576, the default values in recent releases of Ubuntu. Our
# non-exhaustive testing indicates a performance cliff for Outline after values
# around 270k; to stay well below of this cliff we've semi-handwaved-ly settled
# upon a limit of 32k files.
# shellcheck disable=SC2039 # ulimit -n is in bash and busybox but not POSIX
ulimit -n 32768

# Start cron, which is used to check for updates to the IP-to-country database
crond

Expand Down

0 comments on commit 3d2c3db

Please sign in to comment.