My nginx server crashes, error 404 not found after trying to use the new module of fpm support

6 posts / 0 new
Last post
#1 Thu, 04/06/2017 - 03:12
herculesnetwork

My nginx server crashes, error 404 not found after trying to use the new module of fpm support

When I try to do a fetch with Only a specific wordpress plugin on my VPS ubuntu+php7.0-fpm+nginx, My server crashes in 15 seconds, e page load: nginx not found 404! This drops the server, all sites are off, with error 404 nginx, only back after I restart service: service php7.0-fpm restart

log:

    log: [04-Apr-2017 06:07:57] NOTICE: fpm is running, pid 26575
    [04-Apr-2017 06:07:57] NOTICE: ready to handle connections
    [04-Apr-2017 06:07:57] NOTICE: systemd monitor interval set to 1410065408ms
    [04-Apr-2017 07:26:13] WARNING: [pool www] server reached pm.max_children setting (35), consider raising it
[04-Apr-2017 07:33:45] WARNING: [pool www] child 26579 exited on signal 11 (SIGSEGV - core dumped) after 5148.265885 seconds from start
    [04-Apr-2017 07:33:45] NOTICE: [pool www] child 30051 started
    [04-Apr-2017 07:42:27] NOTICE: Terminating ...
    [04-Apr-2017 07:42:27] NOTICE: exiting, bye-bye!
    [04-Apr-2017 07:42:27] NOTICE: configuration file /etc/php/7.0/fpm/php-fpm.conf test is successful

Where the number of standard children is 5, I have already climbed to the maximum, my vps 4gb ram 20 ssd.

vim /etc/php/7.0/fpm/pool.d/www.conf
my php.ini in each domain
cgi.fix_pathinfo=0
max_input_time = 1000
max_execution_time = 1000
max_file_uploads = 2000
memory_limit = 256m

my try:

vim /home/somedomain/etc/php7.0/php.ini
pm = dynamic    // I TRYED ONDEMAND TOO.
pm.max_children = 40 (original: 5)
pm.start_servers = 15 (original: 1)
pm.min_spare_servers = 10 (original: 1)
pm.max_spare_servers = 25 (original: 3)
pm.max_requests = 500 (originally commented)

I have a lot of limits but it does not work, I think it should be something with permissions, because after I tried to try a new module of vitualmin to manage fpm, it did not work, it did not apply what I wanted, and it still totally modified The settings of one of the domains, overthrew this site, but I have beckup of the configurations, and pasted everything back, the site came back, but I think, that this module should have applied the permissions of the user of that domain on the fpm, so That this feature serach the plugin, which I need to use a lot every day, it locks nginx, it drops the site. And it all started by trying to use the virtual fpm module.

Thanks.

Thu, 04/06/2017 - 05:28
mt

Hi, are you generating that load yourself or is your site busy?

PHP-FPM is crashing with SIGSEV, this should usally not happen. Might be a problem with the stack or so. Is that an OpenVZ VM by chance?

This is also pretty high - do you really need that?

 max_file_uploads = 2000

This might be to much, but that's likely not the problem., worth reducing it for testing through.

vim /home/somedomain/etc/php7.0/php.ini  
pm = dynamic    // I TRYED ONDEMAND TOO.  
pm.max_children = 40 (original: 5)  

I doubt you really need so much. But this shouldn't crash your server. Might be useful to stay with 5 until it runs stable.

pm.start_servers = 15 (original: 1)  
pm.min_spare_servers = 10 (original: 1)  
pm.max_spare_servers = 25 (original: 3)  
pm.max_requests = 500 (originally commented)  

Might be to high, but still not a cause for the crash.

Do you ever see the Wordpress site? Can you show the nginx config for Wordpress? This might be a redirection loop but PHP-FPM shouldn't crash.

You can check with curl -I <url> if it's redirecting in a loop.

Thu, 04/06/2017 - 08:10
herculesnetwork

Thanks for reply @mt

my config nginx

user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
worker_connections 1024;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
server_names_hash_bucket_size 128;
client_max_body_size 100M;
client_body_buffer_size 16k;

fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 180;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
}


#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen     localhost:110;
# protocol   pop3;
# proxy      on;
# }
#
# server {
# listen     localhost:143;
# protocol   imap;
# proxy      on;
# }
#}

Yes I have tried uploading the limit files uploads, I do not need all this, I use 300, I increased those limits all after the error, these error started exactly when I tried to use the FPM module to manage the settings of one of the domains, That he changed the socket of the domain and removed it by mistake, I just reconfigured I restored this whole file modified by the virtualmin fpm module, but it seems that it change some permission in some main file of fpm, If I use the search system of one of the My wordpress plugins, not found 404 nginx, all white screen in the browser only with this message, then I restart service php7.0-fpm and everything back to work, and I just do a search in any domain and all sites caise again Because the fpm for, and nginx not found is the error that returns, I've never had problems confgurate everything manually, but when trying this module, it did something in my nginx, that I can not use my main plugin, I already logged in The one with the plugin support and it says that there is not anything with the plugin, and I believe, it is great and another VPS does not happen that mistake. I use cheap OVH vps from € 5.99 - KVM OpenStack

Thanks @mt

Sat, 04/08/2017 - 17:00
herculesnetwork

Hi mt
Thanks for giving me these suggestions, I followed your tips, and all my 8 domains I return something with the curl -I'm not having problems, and I'm having problems with the domains that curl -I with this output:

root@vps1:~# curl -I mydomain1.com
curl: (6) Could not resolve host: mydomain1.com 

All my other domains, and that I'm not having problems with them regarding a plugin that hangs all my nginx server, with all 8 domains return with curl -I is this:

curl -I my-domain2.com
HTTP/1.1 301 Moved Permanently
Server: nginx/1.10.0 (Ubuntu)
Date: Sat, 08 Apr 2017 21:47:55 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Location: http://www.my-domain2.com/

what does that mean? Can you answer me again? I do not know the meaning of not solving with curl -I .... !!!

Thanks @mt

Sat, 04/08/2017 - 18:55
herculesnetwork

Solved with this:
To undo the above

sudo chattr -i /etc/resolv.conf add on the last line eg:

nameserver 8.8.8.8 nameserver 8.8.4.4

Open up a terminal and type

sudo chattr +i /etc/resolv.conf

the +i takes care that the file wont be reseted on a boot.

Thanks A lot mt :-)

Mon, 04/10/2017 - 06:39
herculesnetwork

In fact, Solved a problem, the server is now counting down on the server for a cron action, that before the plugin timer was always stopped and 00:00:00, other domains ran the time normally, and that domain that Is the main one, the one that is in the hostname, there was no count nor the action of course ... so, what I was worried about, now with regards to the nginx server hangs, I discovered that I can not do searches using capital letters, By somebody, or name of cities, I have to only search, and not write correctly with the first capital letter, doing this, the server always falls after a 2 minutes loading of the script trying to find something! Very Strange!!

Topic locked