PHP-FPM and Nginx: 502 Bad Gateway

后端 未结 15 1780
闹比i
闹比i 2021-01-29 18:35

Configuration

  • Ubuntu Server 11.10 64 bit
  • Amazon AWS, Ec2, hosted on the cloud
  • t1.micro instance

Before I write an

15条回答
  •  闹比i
    闹比i (楼主)
    2021-01-29 18:53

    All right after trying every solution on the web I ended up figuare out the issue using very simple method , first I cheked php-fpm err log

    cat /var/log/php5-fpm.log 
    

    and the most repeated error was

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

    I edit PHP-fpm pools setting

    nano /etc/php5/fpm/pool.d/www.conf
    

    I chenged This Line

    pm.max_children = 5
    

    To new Value

    pm.max_children = 10
    

    BTW I'm using low end VPS with 128MB ram As everyone else I was thinkin redusing pm.max_children will make my server run faster consume less memory , but the setting we using were too low tho even start PHP-fpm process . I hope this help others since I found this after 24 hour testing and failing , ever my webhost support were not able to solve the issue .

提交回复
热议问题