admin管理员组文章数量:1294687
So I've been having a problem with one of the websites I manage. Essentially, we keep seeing the cloudflare 'site is offline' message for at least half the day, constantly and consistently. Whenever the web host is contacted, we always get the answer that it's a problem caused by plugins, but I want to know if:
Is it actually too many plugins?
The website is a news aggregation website that's been around since about 2012. We're wondering if all the articles posted (at least 3-4 per week) are clogging up the database and making things slow.
- We get this error occasionally when attempting to update/publish drafts:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 105 bytes) in /home/SERVER_FOLDER/SITE_ADDRESS/wp-content/plugins/w3-total-cache/lib/W3/ObjectCache.php on line 184
What could be causing this error and how can we solve it?
This could be a symptom or a separate problem, but I just wanted to mention it in case it's relevant: When we try to schedule posts and the website is going up and down, the schedule button has a tendency to grey itself out for what ends up being a majority of the day (even upon refreshing the page, etc.).
Finally, we use W3 Total Cache because it was recommended by the host, but we were wondering if this was truly the best option (or if it just didn't matter which cache plugin we choose as long as it's reputable).
EDIT: Yes, current Wordpress version (4.3.1) is being used.
So I've been having a problem with one of the websites I manage. Essentially, we keep seeing the cloudflare 'site is offline' message for at least half the day, constantly and consistently. Whenever the web host is contacted, we always get the answer that it's a problem caused by plugins, but I want to know if:
Is it actually too many plugins? https://paste.ee/p/PJLx5
The website is a news aggregation website that's been around since about 2012. We're wondering if all the articles posted (at least 3-4 per week) are clogging up the database and making things slow.
- We get this error occasionally when attempting to update/publish drafts:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 105 bytes) in /home/SERVER_FOLDER/SITE_ADDRESS/wp-content/plugins/w3-total-cache/lib/W3/ObjectCache.php on line 184
What could be causing this error and how can we solve it?
This could be a symptom or a separate problem, but I just wanted to mention it in case it's relevant: When we try to schedule posts and the website is going up and down, the schedule button has a tendency to grey itself out for what ends up being a majority of the day (even upon refreshing the page, etc.).
Finally, we use W3 Total Cache because it was recommended by the host, but we were wondering if this was truly the best option (or if it just didn't matter which cache plugin we choose as long as it's reputable).
EDIT: Yes, current Wordpress version (4.3.1) is being used.
Share Improve this question asked Oct 9, 2015 at 22:14 Emily ServenEmily Serven 11 silver badge1 bronze badge 5 |2 Answers
Reset to default 1Allowed memory exhausted is generally generated because the server can't handle the memory usage of your site, and the actual memory issue can, as Pieter Goosen mentioned, really be anything on the site.
Answers to your questions:
- It's not too many plugins. Wordpress can handle it :-)
- Probably not. If the storage of your website is very very limited this would be a problem, e.g. if you have a database of 10GB and your website has a storage of 10.2GB, then of course this would be an issue.
- It's obviously the W3 Total Cache plugin that is generating the error, but that doesn't mean it's a problem in that plugin.
I would recommend these steps to debug...
Check with the host if it's possible to change the memory limit on the server.
ini_set('memory_limit', '-1');
would set memory for unlimited usage, but if it's a shared host this would probably not be possible.Copy your production site (with a plugin like Duplicator) to a local server. Is it the same problem with it being slow?
Do the testing on your local site...
Try to deactivate the plugin (as you usually deactivate a plugin). Check in a browser, being sure to refresh the cache! Alternatively, if you have the option, check in a totally new browser that you usually do not use (just to be sure that it's not the cache that is messing things up).
Try to remove plugins one by one... and test.
Remove the W3 Total Cache plugin. This is a good tutorial on how to achieve that.
These above steps I think/hope will give you a clue what's going on.
Yes the W3 cache plugin is what the fatal error references but the actually problem is your website is trying to allocate more memory than your hosting account allows.
Now granted 134217728 bytes is like ~130MB which is pretty good (default is like 40MB, shared hosts normally go to max of like 128MB) ... but that is how much memory one php instance can consume.
Each plugin you have activated on your site takes up a certain amount of memory ... if when you are updating a post or something else you get that error, it could be due to whatever is being run through hooks and processing at that time to use up all that memory.
I would recommend running the P3 Profiler just to see where plugins come out at ... there could be just one faulty plugin or it could just be the combination of them all.
https://wordpress/plugins/p3-profiler/
EDIT: Just noticed you had it in your plugin list, which is pretty small, what were the results though?
You mentioned that you use CloudFlare, when you get the error that your site is down, have you tried accessing it directly from the server? What does your hosting company say, you should ask them ... I say this because my hosting company gets these kind of questions everyday
EDIT: Missed hosting company saying "its plugins" ... but don't accept that type of answer from them, especially if you're paying for managed hosting. If you tell them when the problem was they should be able to tell you exactly what they can find in the error and access logs ... don't let them skate out with a BS response.
If you really want to dig into it, you can use a plugin like Query Monitor (https://wordpress/plugins/query-monitor/) or Debug Bar to track down queries and what is causing high memory usage
Good luck
本文标签:
版权声明:本文标题:Website keeps going down, is it a plugin, database, memory problem, or something else? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741196837a2356426.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
W3 Total Cache
for a while and see if that works. Disable other non-essential plugin too. And check the logs. Are you on shared hosting? – Robert hue Commented Oct 10, 2015 at 4:15anything
,anything
that we do not have access to or neither know about. I think you might be running really expensive queries, the best option here is to download and install Query Monitor and then use the plugin to check exactly what is really causing all the issues in the first place. You should not normally have more than 50 queries per page load – Pieter Goosen Commented Oct 10, 2015 at 6:29