ShoutMeLoud – Shouters Who Inspire

Superlinks
≡ Menu

My Experience In Withstanding A Hosting Outrage

My Experience In Withstanding A Hosting Outrage

There are so many situations when the web hosting scenario of your blog or website can crash completely. You get a huge traffic spike, mess up your WordPress theme, a whole bunch of people hotlink your images/ static files and your blog is stressed out.

If you have hosted your blog or website on a shared hosting server and have problems regarding heavy bandwidth usages, increased memory consumption amongst other things, you might want to read my experience and how I survived a hosting outrage.

What Went Wrong with my Earlier hosting company?

My site was going fine until one day I received an email from my hosting provider that my site is consuming a large amount of memory on the shared server and I should take immediate action or else my hosting account would be suspended temporarily.

At that time, my site was hosted with Doreo, and the plan was a shared hosting plan(Sh-A). I have been a loyal customer of Doreo for the last two years and never had any problems regarding memory usage, heavy bandwidth and similar problems.

I installed W3 Total cache plugin on my blog, which is by far one of the best caching plugins recommended for high traffic sites. There are two advantages of using a caching plugin, in case you’re using WordPress as the content management system.

First, the plugin creates a cached copy of the older posts and serves the cached copy to visitors requesting the different pages of your site. Since a cached page (static file) is being served to the visitor, you are actually putting less load on the server as far as database queries, calls, function execution are concerned.

The second advantage is that enabling caching on your blog lowers down the overall loading time of your blog to a great extent.

Coming back to my situation, after I installed a caching plugin – my hosting provider emailed me that I should disable the caching plugin immediately because the plugin is putting a huge load on the shared server. Actually, the plugin started generating cached files for all the pages of my site and since my site already had high memory usage issues, enabling the caching plugin increased it even further.

Lesson Learned #1: First fix the problem at hand, then go looking for optimizations.

I disabled the caching plugin, logged in to Cpanel and started checking the logs to find out the current bandwidth status of my hosting account. To my surprise, I found the following details:

4

Jaw dropped – close to 120 Gigs of bandwidth usage is abnormally high. Moreover, if this trend continues, my site would go down after a couple of days (total bandwidth quota would be consumed completely).

I found the above stat on 24th January and since my hosting quota was almost full, I had to do something about it. There were two options:

  • Either upgrade to a different hosting plan at the same hosting provider
  • Migrate my entire website to a different hosting provider who offer more bandwidth with the same pricing.

Fixing the abnormal bandwidth usage can be done later, first I needed to make sure that my site does not goes down because the bandwidth quota is full.

Moved Site To Another Hosting Provider – NameCheap.com

I backed up the database, downloaded all the files and moved the entire site to Namecheap.com shared servers(under the business plan). They offered 2K gigs of bandwidth every month (large quota) which would give me enough time to fix high memory usages and heavy bandwidth consumption on my site.

Everything went normal for the first 15 days, i digged into the logs of the earlier hosting provider and found out the following details:

31

At this time, my site had only 1500 posts and I had hosted all the images and static files (CSS, Theme files, JS, scripts) in a subdomain. This is because hosting static files and images in a subdomain can result in faster loading, since the browser can render parallel downloads from upto 4 different domains simultaneously.

As it turns out, the subdomain was consuming most of the bandwidth. 72 Gigs  – no way, something must be wrong here !

While I was trying to fix the problem, came another disaster – Namecheap.com suspended my account without any prior warning !

account suspended

Lesson Learned #2: When the situation is critical, disable all plugins one by one and troubleshoot the problem. If possible switch to the default WordPress theme for one day and compare the resource consumption and Bandwidth usage from Awstats logs in Cpanel.

I contacted Namecheap support and got my account unsuspended. Till now, I had no idea what the heck is causing such a huge amount of bandwidth and resource usage on the subdomain.

When Disaster Comes, They Come With An Army

After getting my account unsuspended, came another trouble. Namecheap.com put a permanent ban on my account saying the following:

We have reinstated your account two times for high CPU usages. Since, you’re not fixing the problem at your end, you have to upgrade or else we won’t resume your hosting account, currently on the shared hosting plan.

Which means, I had to force upgrade to a VPS plan. If I don’t upgrade, the company won’t reinstate my account and I would lose all the files and the database.

Followed A Forced Upgrade To VPS

I had no other option than to upgrade to their VPS plan and get my site up and running. Upgrading to VPS solved one problem – it bought me a good amount of memory and time, so I can perform tests on my side and reduce the memory load.

After two weeks of continuous tests, trial and errors I found the following:

1. One of the plugins called SimpleTags was a major culprit. I installed the Debug Queries WordPress plugin and found that the Simple Tags plugin was causing a huge number of queries in every other page of the site. See screenshot below:

simple tags

2. I ran a check in the Database and found that although SimpleTags plugin was disabled, there were more than a thousand redundant entires lying in the database tables.

Lesson Learned #3: Always clean up your database and remove unnecessary tables, values and options. Perform this periodic cleanup time to time, like once in every 3 months.

To fix this issue, I installed the clean options WordPress plugin and deleted all the option values of Simpletags from the Database.

3. After rigorous checking in Awstats logs, I found that there is an unusual script being viewed a good number of times.

timthumb1

I had no idea when I uploaded that script, but this script created thumbnails of all images across that site under a “cache” folder. I downloaded the cache folder to find more than 3000 images and thumbnails being created randomly. I checked the Archives.php file of my theme and found the culprit script being called from the Loop.

Lesson learned #4: Check your codes throughly, check each and every file of your theme and not just the index page or single.php file.

Final Disaster: VPS Panel Locked Because of CGI Scripts

While I was fixing my Wordpres installation, plugin setups and removing the bad codes from my theme, in comes the final disaster. Namecheap.com suspended my VPS account stating the following:

vps suspended

The reason stated in the email is that my server sent a lot of spam emails and the company had to suspend my account to prevent spam abuse.

This is purely abnormal, I mean…come on ! Why would I send spam emails to unknown people when my own website is having server side problems. I repeatedly emailed their support team but could not fix the problem.

One of their support staff told me that I was hosting CGI scripts on my website which was used to send spam emails. I started investigating and found that the CGI script they are referring is nothing but a simple contact form.

Lesson learned #5: Always research the reputation of a hosting company before hosting your website with them. It doesn’t matter how lucrative their pricing plans are, if the main purpose fails in the first place, you’re going to screw everything up in the loner run.

I called Harsh Agarwal over phone and told him about the problem I was facing. He told me that not all hosting providers are optimized for WordPress, and you should ensure that your current hosting provider can handle a medium traffic website easily. If the hosting provider is fairly new and not optimized for WordPress, it doesn’t matter which plan you’re using.

Lesson learned #6: Always ask support from fellow bloggers first and Google later.

Finally, I backed up everything from the Namecheap servers and moved to Hostgator hosting. I have been serving my website from the Hostgator servers from over a month and there has been no problems as such.

What You Should Do To prevent Hosting Outrages On Your Site ?

  1. First and foremost, check your theme thoroughly. Check those functions, calls , queries and  remove the codes you don’t need at all. Remember that a simple piece of code can put a good load on the server at a later point of time so you should remove all the unnecessary queries and function calls mercilessly.
  2. Remove the plugins you don’t need and don;t forget to delete the tables from the database as well. Your SQL database is the heart and soul of your website and letting expired options and redundant values in the tables is not at all good.
  3. Optimize your site’s database and reduce it’s file size, perform this check at least once a month.
  4. Install a caching plugin like W3 total cache. Do not ignore this because sudden traffic spikes may occur any day.

Also remember to test and troubleshoot the problem yourself and do not completely rely on the support staff of the hosting provider. At the end of the day, it’s your knowledge, experience and understanding which will help you solve and fix the problem at hand.

 

  • Author Bio

  • Latest Post

Article by Amit Banerjee

Amit has written 1 articles.

If you like This post, you can follow ShoutMeLoud on Twitter. Subscribe to ShoutMeLoud feed via RSS or EMAIL to receive instant updates.


    TA

    { 26 comments… add one }

    • Reza

      Amit,
      I can not thank you enough for this explanatory article. I had been searching internet for an unbiased opinion about namecheap hosting and I found it here. It explains it all. I am currently using namecheap professional shared hosting for wordpress sites and I have multiple sites all using wordpress. I was hesitating whether to shift to hostgator of any other web hosts. Your post convinced me enough to shift from namecheap hosting to hostgator. Though I would keep namecheap as my domain name registrar as it has a good reputation as a domain registrar.
      Also, I would like to know if you have have any affiliate link of hostgator to show my appreciation.

      Reply
    • Hemant

      Nice article. I first hosted my site at hostgator.in (not hostgator.com). They suspended my account 3 times for exceeding their server load. I then changed my host to GoDaddy. Now there is no such problem. I will soon change it to hastgator.com

      Reply
    • Nadiar

      Ah, thanks god. I found this story,

      beafore, I want give a try for namecheap. I’m ex-hostgator costumer and happy with that service, and now I still give a try for hawkhost.

      Reply
    • Andrew Bailey

      this was interesting to see your journey.

      there is no date I can see when this happened but you should know that the version of timthumb.php that you were probably using had a vulnerability that could be exploited by a hacker to install any file to your hosting which would allow them to take over your server.

      many thousands of wordpress sites were hacked like this and most of the hackers did nothing to the site, they just installed spam sending cgi scripts and other nasties for illegal tasks.

      even if the plugin or theme is not activate, a hacker can exploit timthumb unless it is the latest version. You should check every folder for timthumb.php or thumb.php and edit it to not allow external images! and download the latest version

      Reply
    • Rob

      You have to be careful on your configurations of your sights especially if your useing a thrid party plugin or whatnot. they can clash and cause you numorious headaches as such for shoutmeoutloud here. your best best best option would be to always check daily if not bi daily on your site anytime you decide to add a plugin. this will help to keep that stuff wrangled into the neat package you all want it to be.

      Reply
    • Matt Russell

      Thanks for the useless speculation Mike. If you would actually investigate us and state facts, you will note that if we’re wrong or we make a mistake, we take unprecedented lengths to fix whatever we have to do deliver customer satisfaction. Our customer service is the reason we’re the second fastest growing registrar.

      Reply
    • mike

      People don’t realize that NameCheap is a poor choice for Hosting or Registration and are nothing more than resellers. They don’t offer Telephone support so real business won’t use them. They have all their customers by hiring trolls to poach GoDaddy customers in online Forums. There was a lot of talk about GoDaddy supporting SOPA. And in the end they actually INCREASED their customer base after NameCheap took a shot at them via their Forum Trolls. GoDaddy is a legitimate Registrar that offers real tech support via the telephone. NameCheap doesn’t even have a telephone number you can call. They also do not have a street address. When you have a problem you have to send an email and hope the person on the other end will respond to you and is not a complete idiot. I’m putting this link in quotes because I’m not trying to hijack your PR (comments don’t really mean much because they are so far down the page most of the time the Google Bot won’t even crawl them all or consider them relevant but here goes) “http://domainnamewire.com/2012/02/23/survey-says-godaddy-is-top-domain-registrar/” Take a look at who Domainers are using for Hosting. #2 is NameSILO. A very good choice, no games, no gimicks, no upsells and no trick. Flat pricing that is much Cheaper than NameCheap by far. And privacy is included and is also free even at renewal! As far as just hosting goes nearly all shared hosts will shut you down with no warning for practically any over usage of bandwidth and that is bad for business. I would not use HostGator or NameCheap or GoDaddy for hosting. Not worth the lost income when they go down. I pay a bit more for hosting but it’s a reseller account so over all it’s still just cents per domain hosted and in 8 years never an outage at all… and tech response is generally less than an hour, but I can call them if I want to. Why didn’t Matt Russell just call you? Right ha ha ha. Find a new host that deals with real business and you’ll be fine. NameCheap is for pretenders. Note I did not post a website link because I’m not trying to get ranking – I don’t need to drop comments in Forums to rank. I’m hear to spread the truth and to encourage people to check out NameSILO, but I do not work for them. Very well written blog post by the way, I saw it while I was doing some reading on DIGG.

      Reply
    • Matt Russell

      Hello all,

      As this is doing the rounds on Twitter despite it relating to an incident over a year ago, I feel compelled to comment on the improvements and changes we’ve made since this occurred.

      We have revamped and improved our notification/alerting system for resource heavy / resource abusive accounts to give clients as much warning as possible to fix any issues before any suspension occurs. We have also improved the way in which spam notifications are issued to clients and how they are dealt with. And we’ve had our team undergo a rigorous WordPress training program to insure they can assist our clients with any WordPress issues that occur.

      It is important to note that poorly coded and irregularly updated WordPress plugins can cause many problems for blog owners and hosting companies alike. As a hosting company/domain registrar, we do our utmost to keep servers online, fast and reliable at all times. A couple of buggy WordPress plugins can affect the entire server for all customers. So please choose well reviewed/rated and popular plugins to prevent the most common WordPress problems.

      Amit, I’ve also emailed you regarding the initial issues you’ve faced.

      Matt Russell
      Namecheap.com

      Reply
    • Tushar

      I also facing same problem .. As my website is in very early stage but still very high resource usage due to wordpress plugins.

      Reply
    • ajay s bisht

      gosh…thnx shout me loud…i have started my bloging journey with hostgator itself..hope i dont find such problems…

      Reply
    • Jasmine

      What a roller coaster experience you have had! It is great that you are sharing it with us so that we won’t repeat the same mistake!

      Oh yes, HostGator is definitely a great web hosting company. You should research thoroughly before parting with your hard earned cash with a cheap but no-good hosting provider. :)

      Reply
    • Rishi

      Too many plugins always cause a server bandwidth clutter. And nicely shared your experience, Amit, hope you go ahead smooth with moving to a VPS!

      Reply
    • Himanshu

      its like a nightmare to a blogger. But with this i have learned a lot. thanks for sharing.

      Reply
    • aswin # A New Tab #

      Good you shared
      learnt alot

      Reply
    • Mahesh

      Good eye opener article. Thanks for sharing your experience !!

      Reply
    • Shubham

      Really! You had a very bad time…
      Hope people will learn from your experience… and no one else would ever face a similar situation like yours.
      And hostgator is the best! No hosting company can beat it!
      Regards

      Reply
      • Amit

        Yeah hostgator has been pretty good so far, not issues for the last month or so.

        Reply
    • Sujith

      Thanks for sharing your experience. It’s a good lesson for every webmasters. I have faced almost similar experience with my first host and finally landed at Hostgator. If you are going for fancy, then have to pay for CPU and memory resources.

      Reply
    • Paritosh

      Even i am facing the same problem. And after toiling for 6 days, removing majority of plugins, changing theme, etc….. I came to know timthumb was the culprit. Is there a way to disable it? The theme am using uses it to generate thumbnails.

      Reply
      • Amit

        In Which file of your Wordpress theme are you using the timthumb script ?

        Reply
        • Raaja

          Im having the same problem with timthumb… my file is located at themes/include/timthumb.php

          my theme using timthumb to resize the pics… is there any way to solve this problem?

          Reply
    • Suhas

      Well, TimThumb is supposed to do that.. It resizes your images (thumbnails) and caches it in the cache folder. That’s no culprit.

      Really sad man. That was one heck of a rollercoaster.

      Reply
      • Amit

        Tinthumb is no culprit but in some senses it is.

        Consider a case when you’re using Timthunb to generate thumbnails on your tag and category pages. You have to call the timthunb script within the loop, if you want to extract the first image from the post and resize it using CSS (centering, fixed width etc). Now whenever your tag page updates with a new post, the whole script goes to work from scratch. So if you have 25 posts already under X tag and you publish a new post with X tag, the script will start generating the thumbnails for all 26 posts.

        Now considering the fact that I have more than 200 tags in the site, you can imagine how much load a simple script can produce, if it’s called from the Loop.

        Reply
    • Dinesh

      It was really a great example and eye opener post for bloggers. shocked to hear namecheap suspended the VPS hosting also.
      As you advised, its always better to check the host companies reputation with others and forums before purchase.
      I heard Namecheap for buying domain name only not for VPS hosting.

      Thanks for sharing your experience with screen shots.

      Reply
      • Amit

        Yeah, I am not very happy with Namecheap hosting, their support system isn’t very prompt. Moreover, they are not very good in handling Wordpress blogs, I used to get weird notification emails because I was using a contact form on my site.

        Reply

    Leave a Comment