ucfopen / Materia

Engage students with easily embedded apps for online courses. Supercharge your course with compelling experiences and game mechanics.
https://ucfopen.github.io/Materia-Docs/
GNU Affero General Public License v3.0
36 stars 33 forks source link

Adds php-fpm config override to adjust pm.max_children value #1593

Closed clpetersonucf closed 2 months ago

clpetersonucf commented 2 months ago

Resolves #1592. This adds a php-fpm configuration file to docker/config/php that is loaded into the materia-app image as part of the Dockerfile. The config overrides the pm.max_children default value (5) with a new value of your choosing. This file can alternatively be loaded into a container as a volume in a compose file, but by writing it into the image, it does not need to be expressly included in a custom compose file written for production purposes. Additionally, this method is compatible with UCF's deployment methods, whereas the compose file option would not be.

Testing this PR locally would mean destroying your local Materia containers and images and rerunning the run_first.sh script to ensure a new image is built from scratch. You will then have to docker exec into the app container and ensure the zzz-materia.conf file is written to the /usr/local/etc/php-fpm.d/ directory.

To test non-destructively, you can add this to the base compose file'sapp definition:

volumes:
      - ./config/php/materia.www.conf:/usr/local/etc/php-fpm.d/zzz-materia.conf

To check the current number of php-fpm child processes running and their memory usage, the following command should work:

ps -eo pid,user,comm,rss | grep '[p]hp-fpm'