Skip to content

Commit 36856fe

Browse files
authored
fix(119): ulimit is optional (not enabled by default) (#122)
1 parent 6754e37 commit 36856fe

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ ENV SERVICE_ENABLE_IMPORT_OVER_NETCAT false
210210
ENV SERVICE_ENABLE_ADSBEXCHANGE false
211211
ENV SERVICE_ENABLE_PLANEFINDER false
212212

213+
# System properties
214+
ENV ULIMIT_N -1
215+
213216
LABEL maintainer="maugin.thomas@gmail.com"
214217

215218
# COPY ALL

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,14 @@ See: https://openweathermap.org/price
296296

297297
Ex : `-e "LAYERS_OWM_API_KEY=dsf1ds65f4d2f65g"`
298298

299+
## System:
300+
301+
| Environment Variable | Default value | Description |
302+
| ---------------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
303+
| `ULIMIT_N` | -1 | Enforce ulimit like docker <=22 to prevent OOM issues (-1 mean not enforced), recommended value when crash 1048576 |
304+
305+
Ex : `-e "ULIMIT_N=1048576"`
306+
299307
# Build it yourself
300308

301309
Clone this repo.

root/etc/s6-overlay/s6-rc.d/http/run

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ if [ "$SERVICE_ENABLE_HTTP" != "false" ]; then
55

66
# enforce ulimit like docker <=22 to prevent OOM issues
77
# see https://github.com/Thom-x/docker-fr24feed-piaware-dump1090/issues/107
8-
ulimit -n 1048576
8+
if [ "$ULIMIT_N" != "-1" ]; then
9+
ulimit -n "$ULIMIT_N"
10+
fi
911

1012
/thttpd -D -h 0.0.0.0 -p 8080 -d /usr/lib/fr24/public_html -l - -M 60 2>&1 | mawk -W interactive '{printf "%c[32m[http]%c[0m %s\n", 27, 27, $0}'
1113
# stdbuf ... -- (remove blank lines from output)

0 commit comments

Comments
 (0)