0

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
Andre Trevas
  • 51
  • 10
  • Have you disabled all plugins to see if the issue remains? If it doesn't, enable them one by one and see it there's a specific one that causes the issue. – M. Eriksson Jan 16 '19 at 13:04
  • Did you check in the database that all path are reflect the right "new" path (of course, if there's any in the db) ? – Benoti Jan 16 '19 at 13:08
  • Hook up an strace to one of the PHP processes and see what it's doing. – Devon Bessemer Jan 16 '19 at 15:11
  • @Benoti yes, i used 2 plugins and check the mysql dump, everything seems to be good – Andre Trevas Jan 16 '19 at 22:22
  • @MagnusEriksson I started to do that, but there are more than 40 plugins. I'm not sure where is the problem, and if i disable all plugins the wordpress will broke (the erros isn't immediately, 1 or 2 day to stop). I will try it today – Andre Trevas Jan 16 '19 at 22:25
  • @Devon do you have a link with any tutorial? I never do that and don't know. I will look for it in web – Andre Trevas Jan 16 '19 at 22:27
  • More than 40 plugins?? I'm surprised the site works at all! – M. Eriksson Jan 16 '19 at 23:55
  • @MagnusEriksson me too, but the client has no idea, and i already alert him. – Andre Trevas Jan 17 '19 at 01:12
  • @Devon, the answers is: epoll_wait(10, <... epoll_wait resumed> 0x55e8211180a0, 512, -1) = -1 EINTR (Interrupted system call) --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} --- rt_sigreturn({mask=[]}) = -1 EINTR (Interrupted system call) For each one of my 20 workers. – Andre Trevas Jan 17 '19 at 01:12
  • Well, the bottom example looks like it's writing an error to your log, so I'd check out that log file. The epoll_wait looks like something is being blocked by I/O. I suggest you look to a sysadmin if you need to dig deeper. – Devon Bessemer Jan 17 '19 at 13:02

1 Answers1

0

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.

Andre Trevas
  • 51
  • 10