What are my (other) options to reduce resource usage on shared hosting? - wordpress

I got a message from our shared hosting company (InMotion) informing me our resource usage is too high. We have a WordPress-powered website. To give you an idea of our website, based on Google Analytics, we get 8,343 unique sessions per month. According to our webhost, we used 8660.71 MB of bandwith in January.
One day, InMotion told me there was a spike in CPU usage, and included an excerpt of my access logs which they say indicated "some heavy WordPress Admin activity". They said "We are not exactly sure what this admin user was attempting to accomplish, however this activity does seem to have inflated your account's CPU usage." They included the ID of the item that was uploaded and caused the spike. It was the only file I uploaded that day. It was a 7 kB PNG file; I uploaded it once, deleted it and uploaded it a second time.
I do not understand the complexities of resource usage, so to me, it seems stange that uploading a 7kB twice can bring about spikes and be considered heavy activities.
When I asked more about the Ressource Usage graph, they replied this : "The numbers are percentages. 100% means you're right at the top of what we consider normal CPU usage on a shared platform. Anything above that is VPS territory. If you zoom in on the graph, you'll see that for the most part you're right at 100%, but you occasionally have spikes over. Going through the logs, your CPU usage is mostly from the Wordpress Dashboard, so disabling the heartbeat feature should reduce your usage the most."
They also told me there was unusual activity to the wp-admin/admin-ajax.php.
At our hosting company's request, I did the following:
Disabled WordPress' heartbeat / autosave features
Installed a caching plugin (WP Fastest Cache)
Installed P3 Plugin Performance Plugin to see which plugins were using most resources
I deactivated 2 plugins that were highest in ressource usage : Scroll Back To Top and Simple Page Tester.
But even with these changes, there are still "spikes" in our resource usage and we are receiving warnings. Our host is recommending we either upgrade to VPS hosting or use a CDN service like CloudFlare or MAXCDN.
So my questions are as follow :
How can I tell what is really causing excessive ressource usage?
Are there other ways to reduce resource usage caused by WordPress?
Are CloudFlare or MAXCDN good for this type of situation?
Thank you for taking the time to read. Any help or tips will be appreciated!

Your usage is not at all surprising. If you get 8,343 unique sessions per month and you used 8660.71 MB, then each visitor is taking an average of about 1MB.
Just loading your home page is about 0.525MB, so if people browse your site (plus with admin traffic) it's easy to see how you might use that much.
Yes, a CDN like CloudFlare or MAXCDN would be really good for your situation. Your page is loading a lot of CSS, Javascript and images that could all be moved to a CDN. This would significantly reduce your host bandwidth usage and probably lower your page load time as an additional benefit.

Related

Extreamly Slow Wordpress Site

I having a Wordpress site which take more than 5 sec to load out, and is extremely slow performance.
I tried everything i can to speed it up but still no luck.
Any recommended solution for me ?
Here is my Website URL
Stormbodykits.com
A quick look at the Network tab in Dev tools show that this is not limited to PHP/WordPress but is equally effecting all static content such as images, JavaScript and CSS. This is a hosting issue, either too small of a virtual host or overly saturated shared hosting. If your hosting the site yourself you may need to upgrade your upload speeds through your ISP. Long story short, WordPress is not generating this content. The time is being spent fetching from disk (or memory in some cases) and then sending the resources to user. The most likely bottleneck in this scenario is the network when looking at full seconds rather than milliseconds, especially on a site serving only a few connected users at a given time.

Site is abnormally slow

My site is running on Wordpress and uses Woocommerce to display most of the content. See my site here, I have a lot of images that could be part of the problem...
Google PageSpeed says I'm 0/100 for mobile speed and 11/100 for desktop speed, with a 44.5 server response time..
GTmetrix gives me an F for my speed, recommending I serve scaled images, leverage browser caching, add expired headers, make fewer http requests, and more.
I'm trying to interpret all of these poor scores, and would like some help on how to dramatically speed up my site.
Does anyone have any tips, or know what I can do to help increase the speed and improve my scores on these sites?
That site is certainly slow, however the load times appear to be primarily from the server (I'm seeing about a 3-5s load time before the server responds with content for the home page). This has nothing to do with how many images you are loading, it probably means you have a really slow plugin or piece of code.
I'm not sure how technical you are, but I'd recommend profiling your code. An easier solution may be to disable your plugins one-by-one until your site suddenly loads faster. Then re-enable every plugin except the last one to be disabled, and verify your site still loads fast. If it does, then the disabled plugin is likely the issue.

How to Scale Wordpress on Shared Hosting to Survive a Traffic Surge

So just like any other indie developer, I ran a small personal Wordpress blog on a HostGator shared plan to show case projects and notes.
Now, let's say you have an article that is randomly picked up on HackerNews or Digg, how do you config your Wordpress or the Shared Hosting to survive the sudden surge in visitors and page hits?
I have looked into a few things like: making that article a static page, turn on caching so the page can serve without querying MySQL. Would love to hear from your experience.
I would start with a caching plugin like W3 Total Cache. It has the same effect as the first technique you mentioned, but it does it automatically.
If you want better performance for a few pennies more a month, try Amazon Cloudfront. It is a little more setup, but the benefits are well worth it. I set up my DNS to point to Cloudfront, so all traffic hits their edge servers first. Then I set up my server as origin.domain.com and make sure that cache control headers are set (e.g. max-age=3600). When visitors come to my site, they hit the Cloudfront edge server nearest them (there are 22 locations worldwide), and if the page is cached, my server never gets hit. If not, 1 request is made, and for the next hour, all requests are served from the cache on the edge server.
As has been already mentioned, a caching plugin is a must. A CDN helps also for media and static files like js and css, and then your theme is also a crucial factor in your site's performance. Keep it clean, minimize queries, and try to avoid frameworks and the overhead they introduce.
I don't use a cdn, but I have a virtual server where I use Nginx to listen on port 80. It also serves the easy stuff like images, text files, stylesheets, etc. Anything more difficult (wordpress content), it passes on to Apache which listens on a different port. Apache is an awesome webserver but it is a beast as far as resources go. If you have 20 items on a page that need loading, and you can have something svelte like Nginx handle 19 of them, it helps tremendously.
Here is an old optimization article I wrote about a year ago - that might help a bit more also: http://trioniclabs.com/2011/12/my-take-on-wordpress-optimization/
Good luck.
I also host with HostGator, and have addressed performance issues with many of my sites.
My advice:
Find a different shared host. Since EIG bought HostGator last year, the performance of their shared accounts has fallen off a cliff. MySQL performance is poor, and support wait times are growing.
Previous to 2013 I had high traffic WP blogs that ran with no issues. The new hardware and policies however have taken even my small/simple WP sites down to very low performance levels.
If you stay with HG...
Disable wp-cron: Here's a good help doc: https://support.hostgator.com/articles/specialized-help/technical/wordpress/how-to-replace-wordpress-cron-with-a-real-cron-job
Install and use a caching plugin, using mod_rewrite caching (not PHP caching)
A CDN will help the site load faster, and if you host the assets on a different provider, it can help reduce the load on the server.
Honestly, if there's even a remote chance of getting massive traffic, upgrade to a scalable VPS, or a web host that handles traffic surges like WPEngine.

Lightening web page load for crawlers

On a shared host, I'm experiencing high CPU / page load times. Wincachegrind and Firebug showed that the bottlenecks are:
- db queries (time)
- images loading (time)
- Wordpress plugins / filters (CPU)
I have installed WP Supecache, however I have noticed that the problem has been shifted elsewhere: as the site has a great number of posts (> 50,000) the time & CPU consuming task has been shifted to WP Supercache generating static files, on crawlers access.
Ironically, the site has very little user access daily (about 1,000), while suffering large crawler access daily (Google webmasters shows a MAX:23,669/Average:11,712/MIN:4,069 pages stats).
I was thinking about helping the crawling page phase, avoiding loading some elements/parts of the page when being crawled. For example, images and "related posts", not "strategic" for the indexing process....could "lazy loading" of those parts help?
Or? What steps would you take further on, assuming:
- the users traffic to the site is very small,
not justifying stepping to costly dedicated/CDN solutions
- Efforts have been taken to minimize plugin impact
- Page design has been improved using CSS sprites, source minifying,
using consistent host names, etc, etc pushing page score
to higher limits (Yslow, pagespeed)
I believe the next step would be to use Wordpress as the backend, creating a lower level coded frontend (PHP + MYSQL)....
Comments appreciated
I have switched to a dynamic page whose content is loaded with jQuery.
This turned down page load time to a 1/3 !!!
Great!

When use a cache system with WordPress

(sorry if this is duplicated but I couldn't find anything related)
I have an WordPress 3.0.3 instalation with some custom coding and tried the W3 Total Cache plugin but had some problems...so I've decided to deactivated it.
And now I'm wondering that there are any average number of daily visits that becames necessary the use of a cache system.
I'm not saying with this that I don't want to use a cache system, but only managing priorities.
Thanks in advance!
And now I'm wondering that there are any average number of daily visits that becames necessary the use of a cache system.
You'll know when you need one. Believe me. :)
Seriously: If request times become unbearably long, or the server gets resource problems in peak times, you need caching. That said, it is my opinion that it is never too early to cache a Wordpress blog. Also, loading times can influence your blog's Google rankings which may be a reason to activate caching even though visitor numbers are still low, and not causing problems for the server.
Anything more detailed is really hard to tell because servers differ massively. Some can deal with a larger number of simultaneous Wordpress requests than others, depending on equipment and setup.

Resources