Skip to content
Snippets Groups Projects
Verified Commit 1c2df4e2 authored by David Beniamine's avatar David Beniamine
Browse files

Prod perfomance optimizations

parent 9a65746f
Branches
No related tags found
No related merge requests found
COMPOSE_FILE=docker-compose.yml:traefik.yml:expose_mariadb.yml COMPOSE_FILE=docker-compose.yml:traefik.yml:expose_mariadb.yml:memcached.yml
# TRAEFIK CONFIG # TRAEFIK CONFIG
HOST=dolibarr.FQDN HOST=dolibarr.FQDN
......
...@@ -10,10 +10,26 @@ git fetch ...@@ -10,10 +10,26 @@ git fetch
git checkout $DOLI_VERSION git checkout $DOLI_VERSION
if [ "$ENV" == "prod" ]; then if [ "$ENV" == "prod" ]; then
sed -i '/\(xdebug.*\)/d' /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini sed -i '/\(xdebug.*\)/d' /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini
sed -i '/\(xdebug.*\)/d' /etc/php/$PHP_VER/cli/conf.d/00-dolibarr.ini
sed -i '/error/d' /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini sed -i '/error/d' /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini
sed -i '/error/d' /etc/php/$PHP_VER/cli/conf.d/00-dolibarr.ini apt-get purge -y php-xdebug php$PHP_VER-xdebug
apt-get purge -y php-xdebug apt-get install -y php-opcache php-memcached
cat <<EOF>>/etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini
; Enable Opcache
opcache.enable=1
; Set the memory size for the Opcache (e.g., 128MB)
opcache.memory_consumption=512
; Set the maximum number of scripts to cache
opcache.max_accelerated_files=10000
; Set the cache validity time in seconds
opcache.revalidate_freq=2
; Enable file validation for updated scripts
opcache.validate_timestamps=1
; Set the timeout for a request before it is terminated
opcache.max_file_size=2M
; Enable opcache for the CLI
opcache.enable_cli=1
EOF
cp /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini /etc/php/$PHP_VER/cli/conf.d/00-dolibarr.ini
fi fi
echo "*/5 * * * * www-data /usr/bin/php /var/www/dolibarr/scripts/cron/cron_run_jobs.php $CRON_KEY $CRON_USER > /var/www/dolibarr/documents/cron_run_jobs.php.log" >> /etc/crontab echo "*/5 * * * * www-data /usr/bin/php /var/www/dolibarr/scripts/cron/cron_run_jobs.php $CRON_KEY $CRON_USER > /var/www/dolibarr/documents/cron_run_jobs.php.log" >> /etc/crontab
php-fpm$PHP_VER -D php-fpm$PHP_VER -D
......
services:
dolibarr:
depends_on:
memcached:
condition: service_started
memcached:
image: memcached
command:
- --conn-limit=1024
- --memory-limit=64
- --threads=4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment