Wordpress issues on Plesk host

edz_pgt
edz_pgt used Ask the Experts™
on
We're having issues with a client's Wordpress web site that we've 'adopted'. This site worked fine but we've installed a new theme and we're having issues with it. It works fine on our testing server which happens to be a Cpanel-based host. However, when placed on our live server (Plesk) it throws errors on and off (a bit randomly, it seems).

We're getting sporadic Internal Server 500 errors which, when we look at the logs, shows us this:
(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

We've tried switching from Fast CGI, to just CGI and FPM but then we get this error:
Unable to allocate shared memory segment of 67108864 bytes: mmap: Cannot allocate memory (12)

Lots of Googling has been done but we've not found a solution yet.

OS:      ‪CentOS 6.10 (Final)‬
Product:      Plesk Onyx
Version: 17.8.11 Update #38,

CPU      Intel(R) Xeon(R) CPU E5649 @ 2.53GHz (2 core(s))
3GB RAM (looking at it now, it's using 35% of that)

Any ideas we can look at would be appreciated please!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
OK - so I might have answered my own question, but it's early days yet. I've disabled the "opcache.enable" setting on the Plesk subscription for this domain. All has burst into life.

As I said, this is a bit intermittent so I'm not holding my breath. If anyone has any further ideas, I'm all ears!
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Unlikely opcache settings have any effect on this problem.

Likely there's some problem lurking below the surface.

[ Pause for Jaws sound track in background... ]

Better to know than guess about the real problem.

To do this, refer to your log files... Apache + PHP + NGINX (if this is in the mix).

I manage 1000s of WordPress sites + I've never seen this particular problem... ever...

Guessing... I'd say enabling Opcache might have bumped memory slightly past your 3G limit... which is seriously small...

Memory is super cheap these days.

I tend to run many sites on one machine + target 128G as a minimum amount of memory for machines I provision.

[ Jaws music returns... ]

Running with 3G will likely cause all manner of impossible to debug problems.

Memory usage will fluctuate wildly, depending on memory usage of Apache + PHP + MariaDB/MySQL + WordPress.

More than likely you'll hit some other problem down the road related to memory exhaustion.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Note: The most ugly problems will be when the OOM (out of memory) Killer triggers.

This is a process which attempts to keep your OS alive when you've exceeded all memory.

When OOM Killer runs, random (non-system) processes like Apache, FPM PHP, database processes will be shot in the head + die instantly.

You'll see this in /var/log/syslog or your OS equivalent.

And, unless you live in your logs daily, you're system will just be glitchy (highly unstable) for seemingly no reason.

Hint: Target 16G-32G as minimum memory.

Author

Commented:
Thanks David. This is the first time we've seen these issues, too. However, I'll speak with the host provider and see what we can do to up the memory.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Good idea.

I can't imagine trying to run a WordPress site using 3G.

My preference is to have sites... just work... 100% of the time...

Hence, why I run large amounts of memory.

Tip: Most hosting providers... sigh... are just clueless about Linux in general + know even less about WordPress.

You may find the only way you'll get a sensible answer, is to look at your logs yourself.

Author

Commented:
OK - so now I'm confused as our (very respected, reliable and long-term) host says there's no way we need anywhere near that amount of memory. They're saying that if we really want to upgrade it then we can, but there's no scope to upgrade anywhere near 16GB - let alone 32GB.

Their packages are outlined on their web page:
https://www.34sp.com/website-hosting-prices

They have instead suggested that there may be optimisation issues with the web site. Obviously, this would bring us back full circle to where we started - ie looking to see if there's something we can do to this web site to make it run better.

My personal feeling is that there's very little going off on our server. Most of it is simply DNS hosting. There's only a handful of actual web sites living on it and this web site has only been an issue since the recent updates.

Any further thoughts?
Fractional CTO
Distinguished Expert 2018
Commented:
The final answer always lies with the logs.

1) You can also enable WP_DEBUG + this will tell you if memory is truly a problem.

2) If 500 error reason doesn't show up in WP debug log, then you must refer to your Apache + FPM PHP (looks like FPM is involved) + database logs.

3) The way memory works, like 16G+ for a site, any extra memory allocates to file i/o buffers, so you'll almost always be using near 100% of memory... in many cases...

Memory is dirt cheap. Better to have extra memory than insufficient memory + refer to #1 to determine if memory is showing up as the problem.

4) You mentioned "optimization issues with the web site". Fix the 500 error first, then consider any additional optimizations.

5) You said, "web site has only been an issue since the recent updates".

Just refer to your logs + likely the exact problem will show up.

Likely enough data will show up in your WP debug log to surface the problem source.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial