Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-03-28, 12:52:50

Author Topic: nginxproxy+php-fpm crashing with 502 errors  (Read 18115 times)

0 Members and 1 Guest are viewing this topic.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #30 on: 2017-01-07, 13:57:09 »
Now testing:
pm.max_children = 2
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 2
pm.max_requests = 20000
Are you serious with 'pm.max_children=2'?.

Sorry there is 6 out there - still freezing with no errors under minimal load ;(

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #31 on: 2017-01-07, 15:05:21 »
Now testing this:

pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #32 on: 2017-01-07, 15:21:17 »
Nothing helps - only php is freezing. Normal html pages works perfectly. How to debug this ?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #33 on: 2017-01-07, 15:31:52 »
Find out log_level and change value to 'debug'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #34 on: 2017-01-07, 15:46:03 »
Find out log_level and change value to 'debug'.

[07-Jan-2017 16:47:02] WARNING: [pool admin] server reached pm.max_children setting (6), consider raising it

Why ???

When I got 50 in /etc/php-fpm.d/admin.conf ?

Should it be changed somewhere in /opt ?

« Last Edit: 2017-01-07, 15:59:47 by Spacedust »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #35 on: 2017-01-07, 16:20:02 »
Every each clients, you can change 'Number Of FastCGI Children' via 'limit' (or 'resouce plan') except for 'admin'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #36 on: 2017-01-07, 17:28:12 »
Every each clients, you can change 'Number Of FastCGI Children' via 'limit' (or 'resouce plan') except for 'admin'.

I have no clients - only admin.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #37 on: 2017-01-07, 17:36:22 »
Every each clients, you can change 'Number Of FastCGI Children' via 'limit' (or 'resouce plan') except for 'admin'.

I have no clients - only admin.
Create new client and then 'change owner' of website and mysql from 'admin' to new client. And then, to minimize memory usage for php-fpm, change 'php-ftpm type' to 'ondemand' for 'admin'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #38 on: 2017-01-07, 18:03:31 »
Create new client and then 'change owner' of website and mysql from 'admin' to new client. And then, to minimize memory usage for php-fpm, change 'php-ftpm type' to 'ondemand' for 'admin'.
[/quote]

It seems changing in /opt/configs/php-fpm/conf/php71m/php-fpm.d/admin.conf fixed the problem.

Such config works the best:

Quote
pm = ondemand
pm.max_children = 100
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 20000

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #39 on: 2017-01-08, 17:52:36 »
Still crashing ;(

I've restored old backup from 28th of December. Maybe this will help...

It looks like these children are simply creating but not closing properly:

Quote
[08-Jan-2017 17:10:43] WARNING: [pool admin] server reached pm.max_children setting (100), consider raising it
« Last Edit: 2017-01-08, 18:01:10 by Spacedust »

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #40 on: 2017-01-08, 18:06:41 »
We should add:

Quote
keepalive_requests 0;

to nginx config !

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #41 on: 2017-01-08, 18:20:35 »
How much traffic your website till 100 php-fpm client is not enough?.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #42 on: 2017-01-08, 18:22:55 »
How much traffic your website till 100 php-fpm client is not enough?.

It's actually very small, but there are many search engine robots on my sites.

I got tons of such logs:

Sun Jan 08 18:21:57 2017 fastcgi:error [pid 28998] [mod_fastcgi.c(2241):] [FastCGI: neither POLLIN nor POLLOUT...] [world.domain.com]

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #43 on: 2017-01-08, 18:29:16 »
Error of 'FastCGI: neither POLLIN nor POLLOUT...' tend to meaning 'unfinish process'. DDOS attack use this 'unfinish preocess' trick.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginxproxy+php-fpm crashing with 502 errors
« Reply #44 on: 2017-01-08, 18:32:47 »
Error of 'FastCGI: neither POLLIN nor POLLOUT...' tend to meaning 'unfinish process'. DDOS attack use this 'unfinish preocess' trick.

No, even single entering phpinfo page is causing this error. Something is wrong in that mod_fastcgi package. Can you check it out with PHP 7.1 ?

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo
Click Here

Page created in 0.05 seconds with 18 queries.

web stats analysis