Skip to content

Commit

Permalink
Change the default value of PHP_MAX_MEMORY from 256M (256 Mb) to …
Browse files Browse the repository at this point in the history
…2G (2 Gb)
  • Loading branch information
NicolasCARPi committed Dec 18, 2023
1 parent 0874320 commit 6c91be3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Container image version
# Note: the version here is from `ELABIMG_VERSION` present in Dockerfile, not the tagged one

# 4.8.0

* Change the default value of ``PHP_MAX_MEMORY`` from 256M (256 Mb) to 2G (2 Gb).

# 4.7.0

* Add a GH Action to push a `stable` image tag (https://github.com/elabftw/elabftw/discussions/4779)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ RUN abuild-keygen -n -a && abuild && find /home/builder/packages -type f -name '
FROM alpine:3.18

# this is versioning for the container image
ENV ELABIMG_VERSION=4.6.2
ENV ELABIMG_VERSION=4.8.0

# the target elabftw version is passed with --build-arg
# it is a mandatory ARG
Expand Down
13 changes: 10 additions & 3 deletions src/docker-compose.yml-EXAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,16 @@ services:
#- PHP_MAX_EXECUTION_TIME=120

# optional: adjust the amount of memory available to PHP, increase it if you run into issues
# example value: 512M
# default value: 256M
#- MAX_PHP_MEMORY=256M
# information: 2G of memory available to PHP might seem a lot. But realize this: it's not 2003 anymore. PHP is not just a few "if" and "foreach" in some html page.
# We use it to generate huge PDF files and archives, to manipulate potentially big images, and do complicated operations on thousands of objects fast.
# So yeah, the conservative 128 Mb default is obsolete when a simple photo taken with a phone can be 10 Mb.
# Most of the servers that run eLabFTW will run ONLY eLab and will easily have at least 4 Gb of RAM dedicated to this task.
# What is the point of having 4 Gb of RAM and let the main application use only a few percents of it...
# This doesn't mean that eLabFTW will consume that much memory all the time. 99% of the time it will have very low memory footprint.
# But from time to time, users will export many entries at once in PDF with big images in them and that's when you want to have some headroom!
# example value: 4G
# default value: 2G
#- MAX_PHP_MEMORY=2G

# optional: set a password to get access to /php-status, which will display various metrics about the php-fpm processes
# also works for /nginx-status, for metrics about nginx process
Expand Down
2 changes: 1 addition & 1 deletion src/init/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ getEnv() {
enable_letsencrypt=${ENABLE_LETSENCRYPT:-false}
secret_key=${SECRET_KEY:-}
unset SECRET_KEY
max_php_memory=${MAX_PHP_MEMORY:-256M}
max_php_memory=${MAX_PHP_MEMORY:-2G}
max_upload_size=${MAX_UPLOAD_SIZE:-100M}
# CIS benchmark nginx 2.0.0 2.4.3
keepalive_timeout=${KEEPALIVE_TIMEOUT:-10s}
Expand Down

0 comments on commit 6c91be3

Please sign in to comment.