• Resolved sparkyjf

    (@sparkyjf)


    Hi there

    I have set up a web site for a client which has over the past couple of months been giving us massive problems. It all started off well, but recently the site has become unmanageable. The biggest problem that I’m seeing is that, on logging into the wp-admin portal in Chrome, I’m seeing the PHP processes on my host run away.

    I moved the web site from HostPapa to a VPS because they were reporting performance issues with the site but couldn’t give me sufficient detail to debug it. Now that I have it on a VPS, I can see that when I log into the wp-admin portal and navigate, the server spins up hundreds of php7.2-cgi processes, utilising all RAM and swap (and generating load averages of 78 and above!) before the kernel OOMkill’s the processes and everything starts to calm down.

    During this period of chaos, I find that Pages that were published get duplicated and revert to draft.

    This morning I tried disabling all plugins, but it made no difference. I tried switching the theme from Divi back to Twenty Twelve, but again no difference.

    Really struggling with where to look next to debug this. The Network tab of the Chrome developer tools console doesn’t show hundreds of connections being fired off, so it’s almost like something is running away on the server all by itself. However other than the processes being PHP related, I have no idea what’s going on.

    Any and all help gratefully received!

    James

Viewing 6 replies - 1 through 6 (of 6 total)
  • corrinarusso

    (@corrinarusso)

    Thread Starter sparkyjf

    (@sparkyjf)

    Thanks so much for your reply @corrinarusso – I have tested both of those as follows:

    1. Cron enabled (this was how the site was running initially): PHP process spawning issue as detailed above.

    2. Cron disabled – same as above

    3. Self-pings disabled (using the Disabler plugin) – same issue

    I was wondering if it was something like a self-ping – the runaway nature of the issue almost looks like something it calling itself over and over again – however the Chrome Developers console doesn’t show network activity so it’s almost like Chrome kicks it off, and then it runs away on the server even though the browser appears idle.

    Where would you recommend I look next to address this?

    corrinarusso

    (@corrinarusso)

    If you have ssh access to your server, go tail -f the logs.
    or even better, run a top command if you have access on your VPS.
    Did you move to VPS simply for this reason??

    Otherwise ….. download the php error logs, and the apache error logs from your server and take a look. Post some of lines from each file back to this thread.

    Thread Starter sparkyjf

    (@sparkyjf)

    @corrinarusso thank you – I have progress to report. My old hosting provider was seeing the issues, but was getting insistent that we move to a much more expensive plan under the theory that it would solve the problem. I knew that what we had put together shouldn’t be generating too much load, but they threatened to shut the site down if we didn’t upgrade, so it was a logical move – the VPS costs about the same as the hosting plan.

    I have finally tracked down the issue, but the question is what to do about it. I tried a different browser and the problem went away, so I started to focus on Chrome instead and disabled the extensions one by one. In the end I found one extension that was causing the ridiculous server load. So the issue was never with the site.

    My concern is – this extension is quite popular and just because I disable it doesn’t mean others won’t have it. The site is already proxied behind Cloudflare – is there a way to protect against this? I’m going to re-enable the extension and have a look at the logs and see if I can identify what it’s doing – I feel like this is something I need to protect against. I’m not clear at this stage if this is an attack or just a really bad piece of code.

    corrinarusso

    (@corrinarusso)

    I don’t know how cloudflare could help with this.
    Which extension?

    Thread Starter sparkyjf

    (@sparkyjf)

    I may have misunderstood Cloudflare’s offering – I thought it was supposed to protect sites under certain circumstances, though I must confess I’m not clear what it does/doesn’t protect against on the free plan.

    Ok – I pinpointed the wrong plugin there after some further testing – I’ve found the right one. According to my access_log, the plugin in question is performing a GET on all the links on the page, which sounds a bit brutal – so if you hit the pages index, it hits all the pages, including all the links (edit, duplicate, etc.). This results in massive load on the server. The Chrome extension is definitely at fault, and even if I rate limit incoming connections, it will still duplicate pages, edit their status, and so on.

    I’ll mark this as closed as I don’t think there’s any way I can mitigate against something hitting all the links on a given admin page in quick succession – I’ll just make a note to never use said plugin again.

    • This reply was modified 6 years ago by sparkyjf.
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Runaway PHP processes on WP5.4.1’ is closed to new replies.