Search code examples
phpwordpressnginxfpm

Php doesn't kill process


I'm configuring a new server to run a wordpress in the latest version. After some time runing very fine, all request start to return 504 timeout. I checked all logs from nginx and php, no error. After run service php7.2 status

I found this situation:

service php7.2 status

Something is blocking my php process, and php doesn't kill the process. When all process are busy, my server stops.

I configured my droplet with these programs:

  • Ubuntu 18.04
  • Php 7.2.10
  • Mysql 5.7.24
  • Nginx 1.14.0

And my www.conf is configured with these parameters (if i increase max children, the server delay more to stop)

pm = dynamic
pm.max_children = 20
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 10

I tried to run this aplication with default configurations, ubuntu 16 with php 7.0 but got the same error in all droplets. Only this wordpress instance has error.

I post all configurations here, but i don't know if the error can be in other thing, like on the aplication. I moved it from other server (ubuntu 14.04, php 5.6) copying all files to this new droplet. Maybe some plugin or something like that, because only this instance has errors (i moved 6 other wordpress to others droplets with same configuration and no error was found).

Edit 1 -> Debug nginx with strace

I'm debugging my process with strace (Devon suggestion). The result is:

Almost all results:

1021  epoll_wait(10,  <unfinished ...>
1023  <... epoll_wait resumed> 0x55e8211180a0, 512, -1) = -1 EINTR (Interrupted system call)
1023  --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
1023  rt_sigreturn({mask=[]})           = -1 EINTR (Interrupted system call)

Sometimes it shows:

1023  epoll_wait(14,  <unfinished ...>
1024  <... epoll_wait resumed> 0x55e8211180a0, 512, -1) = -1 EINTR (Interrupted system call)
1024  --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
1024  rt_sigreturn({mask=[]})           = -1 EINTR (Interrupted system call)
1024  gettid()                          = 1024
1024  write(4, "2019/01/16 23:18:18 [error] 1024"..., 360) = 360
1024  close(183)                        = 0
1024  write(182, "\27\3\3\2\365\256\3029\302\327\213\322a\375F\251\335\275\353\377\265\376\202R\314j!\200\317\203k "..., 762) = 762

Solution

  • I would like to thank every one for help me. The problem was with some plugins.

    I fixed it creating the exact same directory for the wordpress instance (before i was using a new directory) and removing two plugins (I turn off and on almost all plugins, but remove only two).

    The tips were useful and I used then to fix some problems with php config.