How to reduce CPU Time Usage with WordPress site? - wordpress

I have 3 WordPress sites in 1 cPanel account. Since last week, I always exceed the CPU Time Usage limit and it make our site going down and give "Gateway Timeout" for couple times.
Here is what I did so far :
Enable dynamic caching
Enable gZIP compression with .htaccess
Use cloudflare
Leverage browser caching with .htaccess
Disable wp-cron.php and setup manual cronjob via cPanel
Install Heartbeat Control on each site
Install iThemes security on each site
Optimize databases with plugins (wp-optimize and wp-sweep)
All what I did doesn't help.
Does anyone know how to fix this issue?

If you feel this is malicious then you can activate I'm Under Attack Mode in CloudFlare; this will stop a Layer 7 attack where someone is deliberately trying to exceed your CPU usage.
I would cut down on plugins, trust CloudFlare instead of using iThemes Security, Heartbeat Control, etc.
Also consider switching to a static site generator instead of a WordPress site. Your performance issues look as if they are likely rooted in bad code; try using XDebug to see where the most CPU usage in your code base is at.

Related

Resource limits has been reached on GoDaddy (wordpress site)

I have an issue with my "Multisite WordPress":
the load time is too slow due to resource limitation on the hosting.
I am using, GoDaddy, 512 MB (Memory). Its a linux server.
As far as I know, for a linux server, this is not a problem to handle 1 WordPress website. There is a little trafic on the web site (20 visitors per day). I optimised the database. All pictures are compressed, PHP 5.6 installed (its the latest one available), cache is enable.
Can you please help me resolve this issue?
Here is some screenshots to better explain the situation. screenshot from cPanel
I'm having that same issue. GoDaddy wants me to pay to upgrade my resource limits, but I know it shouldn't use that much of my resources (my other similarly low-used sites are hosted with GoDaddy on Level 1 just fine). I have tracked it down so far to the PHP processes. A temporary solution: in cPanel, scroll down to the Software section, click PHP Processes, then click the "Kill Processes" button. However, I am still looking for a plugin or something that keeps causing this recurring issue.

WordPress - How to get PageSpeed 100/100

I want to increase my PageSpeed score, I tried W3TC but it doesn't help much. Does anyone have a better solution?
Thanks
W3TC alone is not enough. I highly recommend you to setup CloudFlare, simply because you will benefit from free cdn service that is going to reduce so much bandwidth hit on your website; Resulting into fast page loading.
Also if you are on a dedicated/VPS server you must install Redis on your server and then install redis plugin which is available on wordpress plugins directory.
Here are tutorials that I have used for so many of my clients:
REDIS SETUP FOR WORDPRESS: https://www.digitalocean.com/community/tutorials/how-to-configure-redis-caching-to-speed-up-wordpress-on-ubuntu-14-04
CLOUDFLARE SETUP: https://www.youtube.com/watch?v=6NPSFZI3TTo
I suggest you the following combination:
wpsupercache
autoptimize
tinypng
cloudflare
changes in htaccess
changes in wpconfig
changes in functions.php
advantage: free and no costs
disadvantages: time effort for optimal settings.

First GET request too slow (wordpress)

I am running a VPS with multiple wordpress installations on it. When I access my website, the first request that the browser performs is a GET request that takes about 10 seconds to complete, then the css, js files and so on start to be downloaded as fast as one could expect. That slows down my website a lot.
I am running apache2 and php5 with default configurations, plus the following plugins in use:
Wordpress ZenCache.
php's APC cache.
mod_deflate.
The websites are just landing pages with minimal templates, nothing huge. When pages are cached, the previous time can be improved up to 2 or 3 seconds as much.
I understand that many wrong things could make this happen, but could anyone expert devise a possible starting point to fix?
By the way, I had to set up some aliases and redirections with mod_alias and mod_rewrite, I would like to know if that may cause this behaviuor as well.
After following Andrew's advice, I disabled the default reverse DNS lookups in my virtual hosts configuration file by adding the option
HostnameLookups off
In addition, I disabled the use of symlinks when possible with
<Directory /> Options -FollowSymLinks </Directory>
And disabled the logs as well. Now the problem has been solved and everything works much faster now. It was not directly related to Wordpress since a simple html landing page was also suffering from this latency.

Can anybody help explain whats causing my site to load so badly?

I have just launched the website - exactabacussoftware.com built with a custom theme in wordpress.
I noticed that the page load time was stupidly slow and when I checked the results with pingdom I could see that a lot of the analysis was duplicated and I'm not sure why this is or even if it is whats causing the site to load so slowly.
I haven't yet integrated a cache plugin which I intend to do but regardless of this I cannot see why this page loads for around 24 secs.
The entire site loads properly except for the blog page -
http://tools.pingdom.com/fpt/#!/cEmMjD/http://www.exactabacussoftware.com/blog
Server Spec:
Windows server 2008R2
IIS version 7.5
PHP version 5.3.19
Anyone got any ideas as to why this page is loading so slow?
here is the test sites result aswell for comparison -
http://tools.pingdom.com/fpt/#!/bw4JTo/wp-eas.exact3ex.co.uk
The only code changes have been the rewrites to the URL's
Over to you guys...
I think the issue is with a custom theme.
Try doing this steps:
Remove all active widgets
Uninstall all plugins
Check loading time - if not improved it's an issue with custom theme.
One more thing to do (to check if it's not the host issues) - activate default wordpress theme and check average loading speed, if speed is not improved try to configure your server correctly or change hosting plan or hosting provider.
Wait 21.07s (The web browser is waiting for data from the server).
The most common reason for this in the case of Apache is the usage of DNS Reversal Lookup. What this means is that the server tries to figure out what the name of your machine is, each time you make a request. This can take several seconds, and that explains why you have a long WAIT time and then a very quick load, because the matter is not about bandwidth.
The obvious solution for this is to disable hostnamelookup in /etc/httpd/conf/httpd.conf
HostnameLookups Off

PHP Code stuck in Cache [Memcached] (WordPress)

Been having a bit of a problem with my site regarding our caching method and my php code not refreshing or flushing.
To start, my site is a WordPress site on a dedicated Nginx webserver. I used W3 Total Cache for the initial caching setup. Everything was set up to cache through Memcached.
(I should note, my website is somewhat of a 'guest' on this server, which is bit of a semi-community donation semi-sponsored server that runs some other things. The admins are skilled but also volunteers. I have their full support for fixing things, but they don't have time to troubleshoot my very odd issue (especially because I asked for caching to get turned on for the site myself). If we had some hints on what to go on it would make things easier for us than taking shots in the dark ;) So any suggestions are welcomed.)
At some point we noticed that changes to php pages and Wordpress & Plugin updates were not working at all, while the code on the server reflected updates, the pages still processed through the older php code.
This presented a couple unique issues. W3 Total Cache stores it settings in php files. Other php files, when deleted, stop working, but when they are restored to the server, memcached still insists on using its ultra-old memcached copy. The W3 Total Cache settings, whether i removed or altered the settings php files, would NOT stop running everything through cached memcached data.
The server admin attempt rebooting memcached and then flushing it. Neither of those seemed to have any effect. All the other basic settings seem to be set-up correctly.
We can, of course, still add new plugins, all the data that comes from the database works just fine.
At least one other site on the server that is not wordpress also uses memcached with no issues.
Any help is appreciated, should be able to provide further information if it is needed.
Do you have apc.stat = 0 in your settings? Does restarting php engine help?
This is going to sound really obvious but you didn't mention it so:
Did you try turning off the Total Cache plugin entirely to confirm you can see the changes when caching is disabled?
Until you've done that and made sure you get the results you expect, there's no way to know that memcached is really the problem.

Resources