Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Very strange problem with php-fpm - Page 2
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Very strange problem with php-fpm

2

Comments

  • @linuxthefish i have nothing in php-fpm error log.

  • @slave2anubis said:
    linuxthefish i have nothing in php-fpm error log.

    Try pm = ondemand like my config above

  • @linuxthefish i have it configured to be ondemand, with max children to 4.

  • For 2GB RAM, possible total 'max children' as 25 (total mean 'user amount x children/user')

  • slave2anubis said: this is the status screen from php-fpm after a few days: pool: www process manager: dynamic start time: 04/Nov/2014:18:46:42 +0200 start since: 148498 accepted conn: 1547 listen queue: 0 max listen queue: 0 listen queue len: 128 idle processes: 3 active processes: 1 total processes: 4 max active processes: 4 max children reached: 0 slow requests: 0

    During this period, were there any problems with your sites?

  • @slave2anubis said:
    linuxthefish i have it configured to be ondemand, with max children to 4.

    Way too low, any massive traffic surge and your site will die...

  • @sleddog yes
    2014/11/05 15:29:48 [error] 8482#0: *7364 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 66.249.65.40, server: www.isupply.ro, request: "GET /iphone-4/17-sita-casca-iphone-4.html HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.isupply.ro"
    2014/11/05 16:59:27 [error] 8482#0: *8412 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 66.249.65.48, server: www.isupply.ro, request: "GET /order-slip HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.isupply.ro"
    2014/11/04 11:41:15 [error] 558#0: *11236 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 85.120.20.42, server: www.isupply.ro, request: "GET /home/115-carcasa-spate-iphone-5.html HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.isupply.ro", referrer: "https://www.google.ro/"
    2014/11/04 11:41:52 [error] 558#0: *11239 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 195.90.110.125, server: www.isupply.ro, request: "POST / HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.isupply.ro", referrer: "http://www.isupply.ro/15-iphone-4"
    2014/11/04 11:41:59 [error] 558#0: *11245 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 195.90.110.125, server: www.isupply.ro, request: "GET /15-iphone-4?p=2 HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.isupply.ro", referrer: "http://www.isupply.ro/15-iphone-4"

  • slave2anubis said: @sleddog yes 2014/11/05 15:29:48 [error] 8482#0: *7364 upstream timed out

    But the error wasn't caused by the unavailabilty of a php-fpm worker, judging by your fpm status:

    max children reached: 0

    Though you're on the edge with max_children set to 4 and fpm status showing:

    max active processes: 4

    I'd try raising fastcgi_read_timeout to address the timeout problem you're having, and also set max_children = 10 for a better cushion.

    For fastcgi_read_timeout, have a look at https://www.tekovic.com/fixing-timeout-between-nginx-and-php-fpm

    You might also consider configuring separate php pools for the problematic sites, to give them their own php environment. Also setup separate php-fpm status for each, and you'll get a better handling on what individual sites are doing.

    Thanked by 1vRozenSch00n
  • kkrajkkkrajk Member
    edited November 2014

    Could you pastebin - nginx.conf. php.ini, php-fpm.conf, *.conf (Pool.d) and your vhost files .... It might save some time trying to guess

  • kkrajkkkrajk Member
    edited November 2014

    No vhost file here... sites available --> whatever is in there too please...
    ANd not mega... zippyshare please... mega sucks

    Also could you give me the output of ---- grep -ri "listen = " /etc/php5/fpm/

  • Try changing PHP-FPM to use a socket file instead of listening on port 9000. I had a similar issue and that seemed to help.

    In the PHP-FPM configuration file (usually /etc/php5/fpm/pool.d/www.conf), you could also try changing

    ;listen.backlog = 128
    

    to

    listen.backlog = 65536
    
  • kkrajkkkrajk Member
    edited November 2014

    @slave2anubis http://www17.zippyshare.com/v/21075807/file.html

    before that use this nginx conf... restart nginx and could you update me please

  • i am not feeling like putting my website config files online for everyone to see...

  • kkrajkkkrajk Member
    edited November 2014

    @slave2anubis
    use example.com where your webdomain is and ip 999.999.999.999....

    that should hide everything

    Also need output of grep -ri "listen = " /etc/php5/fpm/...

    Please update me after using the above conf and nginx.restart

  • kkrajkkkrajk Member
    edited November 2014

    @slave2anubis

    `# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }`
    

    Since you are not comfortable posting your vhost ... make sure you have this in your vhost...
    also use the following files and kindly report back as soon as possible
    http://www17.zippyshare.com/v/69316510/file.html

  • @ez2uk i dont understand why you did not use a upstream block for the php? since its much better than writing "fastcgi_pass unix:/var/run/php5-fpm.sock;" all the time.

  • kkrajkkkrajk Member
    edited November 2014

    @slave2anubis
    Was in the first conf...
    then thought let us simplify & get it working first ....

  • I have changed the listen mode form IP to unix socket, also i have used the config files sent by @ez2uk

  • I have used nginx upstream block because i have configured all my vhosts to use that!

  • kkrajkkkrajk Member
    edited November 2014

    no probs...

    if the problem still persists...

    Could you please add ,,,,

    keepalive 15;

    to the upstream block ...

    nginx restart
    pp5-fpm restart...

    test and update pls

    If the keepalive doesn't work... remove it...

  • try to check php-fpm user and groups recently i facing same problem,and after some trial and error i found php-fpm user and groups is owned by apache not nginx

    Thanked by 1jcaleb
  • If using unix socket, you need adjusment 'fs.file-max' inside /etc/sysctl.conf. Not work for OpenVZ.

  • i have fewer problems, with 110 errors, now. i have a very old instalation of prestashop, that is have moved alot, can that cause some of the problems?

  • Hi, i have a quick question, i have a openVZ VPS, and over ssh using htop i get ~300MB ram used, but when i use SolusVM Control Panel, i see all of the 1.5GB ram used, witch should i trust?

  • MunMun Member

    I suggest you install htop or run free -m to determine that.

  • With 'free -m', SolusVM read 'Mem Used' but OpenVZ read 'buffers/cache Used'.

  • Try check MySQL to be sure if there are long running queries.

    Check your version of presta or laravel if compatible with your installed version of PHP.

    Maybe your problematic script is reading something from another site. E.g. in Wordpress, if you use RSS Feed in widget sections, this will connect to the RSS feed before rendering your page. iF the RSS site is slow, so as your site.

    maybe you have a missing PHP module

    try to isolate each site. E.g. install presta on one box, then install lara on another. Then see what happens

  • slave2anubis said: Hi, i have a quick question, i have a openVZ VPS, and over ssh using htop i get ~300MB ram used, but when i use SolusVM Control Panel, i see all of the 1.5GB ram used, witch should i trust?

    You should have created a separate thread for this issue. Now people are answering your question from last year.

Sign In or Register to comment.