Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizing the pm.max_children setting #75

Open
johncadengo opened this issue Apr 5, 2024 · 2 comments
Open

Optimizing the pm.max_children setting #75

johncadengo opened this issue Apr 5, 2024 · 2 comments

Comments

@johncadengo
Copy link

johncadengo commented Apr 5, 2024

I'm getting this warning on a vanilla Leantime docker installation:

WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

How do I update this setting within docker compose?

Related issue: Leantime/leantime#2355

@rqi14
Copy link

rqi14 commented Jun 12, 2024

I didn't find any way to configure it with docker-compose.yaml

You can configure it using Dockerfile

# Use leantime/leantime:latest as the base image
FROM leantime/leantime:latest

# Specify the working directory
WORKDIR /usr/local/etc/php/conf.d

# Update memory_limit in custom.ini
RUN sed -i 's/memory_limit = 1G/memory_limit = 5G/' custom.ini

# Add additional settings to custom.ini
RUN echo 'pm = dynamic' >> custom.ini \
    && echo 'pm.max_children = 50' >> custom.ini \
    && echo 'pm.start_servers = 10' >> custom.ini \
    && echo 'pm.min_spare_servers = 10' >> custom.ini \
    && echo 'pm.max_spare_servers = 20' >> custom.ini \
    && echo 'post_max_size = 50M' >> custom.ini \
    && echo 'upload_max_filesize = 50M' >> custom.ini

# The above settings in custom.ini does not seem to work. change php-fpm settings directly
RUN sed -i 's/^pm = .*/pm = dynamic/' /usr/local/etc/php-fpm.d/www.conf \
    && sed -i 's/^pm.max_children = .*/pm.max_children = 50/' /usr/local/etc/php-fpm.d/www.conf \
    && sed -i 's/^pm.start_servers = .*/pm.start_servers = 10/' /usr/local/etc/php-fpm.d/www.conf \
    && sed -i 's/^pm.min_spare_servers = .*/pm.min_spare_servers = 10/' /usr/local/etc/php-fpm.d/www.conf \
    && sed -i 's/^pm.max_spare_servers = .*/pm.max_spare_servers = 20/' /usr/local/etc/php-fpm.d/www.conf \
    && sed -i 's/^pm.max_requests = .*/pm.max_requests = 2000/' /usr/local/etc/php-fpm.d/www.conf

# Expose any necessary ports and define the entrypoint if needed

@phulstaert
Copy link
Contributor

I'm getting this warning on a vanilla Leantime docker installation:

WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

How do I update this setting within docker compose?

Related issue: Leantime/leantime#2355

First you must determine if you really need to update this value. When you see this warning, this means that the current pool cannot serve every request in realtime and requests are put in a queue. It is perfectly ok if you see this once in a while. It is not realistic to think that any server always has slots waiting to serve new requests. A lot of the time you are in a queue for a few ms.

The real question is: do you experience slowdowns? Do you get complaints about the performance?

Also remember that settings values too high can have the opposite effect. It depends on your machine and use-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants