Lightsail - adjusting php-fpm settings

0

Is it possible to adjust the php-fpm settings on a lightsail instance? I've adjusted pm.max_children under php-fpm.d/www.conf but it appears to have no affect after restaring the server.

Tim
질문됨 한 달 전166회 조회
1개 답변
1
수락된 답변

In the Bitnami LightSail instance - php-fpm configuration resides in /opt/bitnami/php/etc/php-fpm.d. At the bottom of the www.conf file, there is a statement that includes a file that is generated based on the memory and other specifications of the lighsail instance type that you are using.

; Memory settings adapted to the machine
; The file below will be overwritten after restarts
include=/opt/bitnami/php/etc/memory.conf

This will override any changes that you make to settings like pm.max_children in www.conf.

If you look in /opt/bitnami/nami/bin/provisioner you will see that memory.conf is a symlink to a file in /opt/bitnami/php/etc/memory which is created at boot by a script the checks the size of your LightSail instance.

You can either modify the corresponding file in /opt/bitnami/php/etc/memory, or simply make sure that you put your statement after the include statement in www.conf .

That said - if you are to change this - make sure you are mindful of the implications regarding memory and other resources on your instance.

AWS
전문가
답변함 한 달 전
profile picture
전문가
검토됨 19일 전
  • Thank you for the quick response. I actually commented out the memory.conf include, and added my settings below it. Note that I also restarted server.

    Here is my conf:

    include=/opt/bitnami/php/etc/environment.conf include=/opt/bitnami/php/etc/common.conf pm=dynamic listen=/opt/bitnami/php/var/run/www.sock listen.allowed_clients=127.0.0.1 ; Memory settings adapted to the machine; The file below will be overwritten after restarts ; include=/opt/bitnami/php/etcmemory.conf pm.max_children=50 pm.start_servers=5 pm.min_spare_servers=5 pm.max_spare_servers=10 pm.max_requests=5000

    However, I'm still not able to get more than 10 connections. The 11th connection simply infinity loads, which is what I would expect when max_children is reached. My previous 10 connections continue to work fine and use very little RAM and CPU. If I close some connections I can go ahead and open more without an issue, but the 11th always infinity loads. Its behaving like max_children is set to 10.

    Here is the details on status page:

    pool: www process manager: dynamic start time: 27/Mar/2024:18:28:19 +0000 start since: 9413 accepted conn: 85 listen queue: 0 max listen queue: 0 listen queue len: 0 idle processes: 4 active processes: 10 total processes: 14 max active processes: 10 max children reached: 0 slow requests: 0

  • It seems the problem was not related to max_children but rather how many open SSE connections you can have in the same browser. It seems 10 for firefox, and 6 for chrome!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠