Skip to content

Tuning EGroupware for higher number of users

Ralf Becker edited this page Feb 5, 2024 · 4 revisions

The containerized EGroupware environment is configured for 100-200 users by default.

Size of shared memory used for the cache (APCu)

By default a size of 128 MB is used. Current usage can be checked under Administration > PHP Information > View APCu stats

To set a higher amount, you need to add / uncomment the following environment Variable in /etc/egroupware-docker/docker-compose.override.yml

service:
  egroupware:

    environment:
    - EGW_APC_SHM_SIZE=256M

and rebuild the egroupware container with:

/etc/egroupware-docker
docker-compose up -d

Number of processes PHP FPM starts/keeps to serve incoming requests

If you regularly see the following message in the log of your egroupware container (docker logs -f egroupware):

WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning N children, there are 0 idle, and M total children 
  1. Copy the www.conf configuration file out of the container (replace 8.2 with the used PHP version!):
docker cp egroupware:/etc/php/8.2/fpm/pool.d/www.conf /etc/egroupware-docker/
  1. Increase - eg. double - the values for pm.start_servers, pm.min_spare_servers and pm.max_spare_servers:
vi /etc/egroupware-docker/www.conf
  1. Modify your /etc/egroupware-docker/docker-compose.override.yml to mount the file into your container (replacing the original file):
vi /etc/egroupware-docker/docker-compose.override.yml

services:
  egroupware:
    volumes:
      - /etc/egroupware-docker/www.conf:/etc/php/8.2/fpm/pool.d/www.conf:ro

Indention in YAML files must be done with space (no tabs!) and the indention matters!

  1. Restart your egroupware container with the new config:
cd /etc/egroupware-docker
docker-compose up -d

Number of connections in Nginx servers

EGroupware Nginx and our Push server has a limit of 1024 concurrent connections (Nginx proxy on Host under Ubuntu 20.04 only 768!).

To allow a higher number eg. 4096 in our example you need to make the following changes:

  1. Modify /etc/nginx/nginx.conf and restart Nginx with: nginx -s reload
events {
    #worker_connections  768;
    worker_connections  4096;
    # multi_accept on;
}
# we proxy, so each client connection (worker_connections) need 2 file-handles (worker_rlimit_nofile)!
worker_rlimit_nofile 8192;
  1. Copy /etc/nginx/nginx.conf from the egroupware-nginx container to /etc/egroupware-docker/egroupware-etc-nginx.conf:
docker cp egroupware-nginx:/etc/nginx/nginx.conf /etc/egroupware-docker/egroupware-etc-nginx.conf
  1. Modify /etc/egroupware-docker/egroupware-etc-nginx.conf
events {
    #worker_connections  1024;
    worker_connections  4096;
    # multi_accept on;
}
# we proxy, so each client connection (worker_connections) need 2 file-handles (worker_rlimit_nofile)!
worker_rlimit_nofile 8192;
  1. Add the modified file as volume to the Nginx container by modifying /etc/egroupware-docker/docker-compose.override.yml
service:

  nginx:
    volumes:
    - /etc/egroupware-docker/egroupware-etc-nginx.conf:/etc/nginx/nginx.conf

Indention in YAML files must be done with space (no tabs!) and the indention matters!

  1. Add the following environment variable for our push-server to /etc/egroupware-docker/docker-compose.overreide.yml:
service:

  push:
    environment:
    - EGW_MAX_PUSH_USERS=4096
  1. Reload/rebuild the containers:
cd /etc/egroupware-docker
docker-compose up -d

Tuning of MariaDB container

You can add your modifications to /etc/egroupware-docker/mariadb.cnf and restart the container.

Clone this wiki locally