GithubHelp home page GithubHelp logo

Comments (14)

leonidas-o avatar leonidas-o commented on June 20, 2024 1

I somehow had the feeling that it is not leantime but podman-compose. I still don't know why or how, but somehow I always end up having issues with this one component. So I deleted everything, just using podman I manually created the pod, the two containers and leantime is as fast as I would expect it. So somehow podman-compose must have screwed up something with the network. It just utilises podman itself so nothing really magical about it but still, when doing it manually, it works fine. Oh man, I'm sorry for wasting your time, thanks a lot. I hope your useful optimisations can still help someone out there.

from leantime.

0xcryp70 avatar 0xcryp70 commented on June 20, 2024

this error is related to php-fpm so check the setting and change it

in /etc/php-fpm.d/www.conf or something like this

pm.max_requests = 500

from leantime.

leonidas-o avatar leonidas-o commented on June 20, 2024

@0xcryp70 as I said, I'm using docker based leantime, therefore the php-fpm setting you are talking about would then be inside the container. I found it inside the container under /usr/local/etc/php-fpm.d/www.conf, it was commented out.
I don't think that I should modify files inside the container, if there isn't a var in the .env file for that, then this is a shortcoming of the docker-leantime project.

Nevertheless, for testing purposes I quickly changed that and the setting is now active: pm.max_requests = 500, but saw the same warning again in the logs: WARNING: [pool www] server reached pm.max_children setting (5), consider raising it. So I also changed that pm.max_children from "5" to "15". Haven't seen the warning anymore, but the performance is still poor and around 10s for loading a site.

from leantime.

0xcryp70 avatar 0xcryp70 commented on June 20, 2024

as you see it didn't change in the error it says pm.max_children setting (5) means = 5 ( default )
ok so in docker based meantime there is a file named custom.ini, you can add this config to this file
config/custom.ini
(https://github.com/Leantime/docker-leantime/blob/master/config/custom.ini)
or you can change it inside your container, but you need to restart your php-fpm service after that

from leantime.

leonidas-o avatar leonidas-o commented on June 20, 2024

I restarted the container, so basically I added pm.max_requests = 500 and restarted, still got the WARNING: [pool www] server reached pm.max_children setting (5), consider raising it warning. Then I updated that to 15 and restarted again, afterwards this warning disappeared but everything was still slow.

Right now, another warning came up: WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 6 total children

from leantime.

0xcryp70 avatar 0xcryp70 commented on June 20, 2024

anyway, there are a lot of ways to change this config inside the container, you can add a command for search and replace the config or you can change it inside the container and commit a new image or you can add this change to the docker file and generate the new image

from leantime.

0xcryp70 avatar 0xcryp70 commented on June 20, 2024

as I see you only need to optimize your nginx and PHP and there is no big deal
if you search you can see what is best for you to change

from leantime.

leonidas-o avatar leonidas-o commented on June 20, 2024

okay, I guess config/custom.ini is the way to go but first I have to find out which values will increase the performance. As of now, I don't get any warnings anymore but it's simply slow, that's strange:
Screenshot 2024-02-28 at 17 01 17

from leantime.

0xcryp70 avatar 0xcryp70 commented on June 20, 2024

use this configs:

pm = dynamic
pm.max_children = 50
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers = 20
pm.max_requests = 2000

you can use gzip and cache for nginx too

Enable gzip compression

gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

Enable caching

proxy_cache_path /path/to/cache levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=60m;

I hope these help you

from leantime.

johncadengo avatar johncadengo commented on June 20, 2024

@leonidas-o were you able to update this configuration within the docker container? How did you achieve it?

These warnings seem to be very simple to run into on a vanilla docker compose installation. Do you think we should just update the default configuration to address this issue?

from leantime.

leonidas-o avatar leonidas-o commented on June 20, 2024

@johncadengo I've used the config/custom.ini on the host system (not inside the docker container).
Hmm, I fear I can't make a decision if or if not you should update the default configuration, I'm simply lacking knowledge over leantime and its behaviour with these settings and especially if other user would ran into issues with that new default settings.

from leantime.

rqi14 avatar rqi14 commented on June 20, 2024

I have the same issue. Is it possible to fix it within the docker container/compose?

from leantime.

rqi14 avatar rqi14 commented on June 20, 2024

@johncadengo I've used the config/custom.ini on the host system (not inside the docker container). Hmm, I fear I can't make a decision if or if not you should update the default configuration, I'm simply lacking knowledge over leantime and its behaviour with these settings and especially if other user would ran into issues with that new default settings.

Hi. Do you mind sharing how to use this file? I don't find this file in the docker compose. Is it simply to place this file on the host and mount it to config/custom.ini in the docker?

from leantime.

rqi14 avatar rqi14 commented on June 20, 2024

I created a Dockerfile to solve this problem according to the advices in above comments. I posted it here for futural references.

# 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

from leantime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.