Posts Tagged ‘hostgator’

What to do when Hostgator disables your shared hosting account

Posted in Wordpress on February 17th, 2012 by HanaDaddy – Be the first to comment

I got a phone call early in the morning around 4 AM. I could hear the answering machine running and machine voice from Hostgator leaving a message that my shared hosting account is blocked for access due to high CPU usage.

I woke up and checked my email account and found that I also received an email from Hostgator.

Hello,
I apologize, but I was forced to suspend the directory /home/…/public_html as multiple scripts inside were causing high loading issues on the server. Due to it affecting all of the other accounts on the system, we had to take immediate action for the health of the server.
Please be aware, we do not normally disable directories except in rare cases where multiple scripts are causing issues. We believe this is the only way to prevent a server crash and potential loss of data.

In general, introducing new indexes, cleaning databases, optimizing existing code, upgrading to the latest versions and adding some sort of caching mechanism, where the script does not need to generate a new page with every request, helps to lower the over load that a script will cause. Likely the original author or support group of the software that you are using will be able to help you to understand how to add something of this nature.

If you reply back to this with your IP address (http://www.hostgator.com/ip.shtml) we will be more than happy to go ahead enable HTTP access for you, so that you can safely work on the script without it causing further issues.
Please let us know how you would like to proceed.

 

I checked my domain names and all of my websites didn’t work. They were all blocked indeed. I was very upset and furious that Hostgator admin blocked without any warning before shutting down my websites. It’s like shutting down the business and you won’t have any sales at all until those websites are back on LIVE. I mean most of my sites are not doing well (in terms of Internet Marketing) these days but I was really upset and didn’t know what to do.

I tried to follow the procedures and got all the websites back on after 2 days. I had to work at night  and could not sleep enough since I go to work during the day time. Here is the general steps that I took. I hope this will help someone to resolve similar problems too.

1. First  calm down and read the email carefully in detail. Usually the main reason of high CPU usage is because of WordPress with lots of plug-ins but without any Cache plug-in. If you are receiving many visits, that will consume lots of CPU powers. 

2. They should send you the running process statistics output (ps command output) as the proof of the high CPU usage. Here is the one that I received

userid 25467 19.3 0.2 53528 31500 ? RN 03:42 0:00 | \_ /usr/bin/php /home/userid/public_html/site_androidtablet/index.php
userid 25651 38.0 0.2 54476 32332 ? SN 03:42 0:00 | \_ /usr/bin/php /home/userid/public_html/site_androidtablet/index.php
userid 25467 20.6 0.2 53528 31652 ? RN 03:42 0:00 | \_ /usr/bin/php /home/userid/public_html/site_androidtablet/index.php
userid 25651 42.0 0.2 54988 32844 ? RN 03:42 0:00 | \_ /usr/bin/php /home/userid/public_html/site_wpmarketing/index.php
userid 25651 50.0 0.2 54988 33104 ? RN 03:42 0:00 | \_ /usr/bin/php /home/userid/public_html/site_wpmarketing/index.php

 

First column is the userid, the second column is the process id, and the third column is the CPU usage %. I see they are really high ranging from 20 to 50. And the last column is the running script name. Of course , they were all WordPress scripts. Make a note of the websites since you would have to do some work on those sites. But just note that you will need to work all of your WordPress sites anyways . The system admin wants you to do so.

3. Now you will need to find out your desktop computer’s public IP address by visiting http://www.hostgator.com/ip.shtml and let the system admin know . So he will allow you to access to your websites and you can start working on it to speed up things.

image

You can just reply to the email with the IP address to update the ticket . If you want to expedite the process (of course you do) , you shouldn’t just wait. You can call them up or use live chat feature which is better.

image 

When you are connected to one of their tech support , just mention about the ticket number and ask to escalate it to the system admin.  Once escalated,  the system admin will review your ticket right away. By the way, the tech support might want to verify your identity with the last four digit of your credit card number or the Paypal transaction number that was used to pay the hosting .

4. I was able to access right away (that was really fast like within 5 minutes), then I started to review my WordPress websites . Actually I already installed W3 total cache plugins for all of my sites, but indeed, strangely , I see that some of the websites are using high CPU powers . It took me almost a day to figure out what cause the problem. It was because (1) I didn’t setup W3 total cache properly and (2) javascript and css files were dynamically created. I will explain about this in detail in my next post.

For now, let me quickly show you how to monitor the CPU usage. I mean how would you know if a website is optimized or not ? You should be able to monitor CPU usage in real time right?

To do this, you need the SSH access to your account. Check here on how to get the SSH shell access. You need a SSH client too. PuTTY is the popular FREE SSH client. Once you logged into your account. Run below command at the prompt.

[userid@gator1234~]$ top

 

‘top’ command will show complete system information at a glance.  It shows various information about processes , CPU usage, and memory usage. Also it refreshes the screen every defined period which 3 seconds by default. There is a column named %CPU which is the data that the sys admin monitors. So your target is to reduce this information to minimal level.

image

But 3 seconds refresh time is just too long. If you visit your website and try to see the process, it may not show. So what you need to do is change the refresh rate by typing ‘d’ on the keyboard. Then it will ask for the new refresh rate. You should try 1 second or 0.5 is a good choice too.

Also you want to see the full command information since ‘top’ shows does not show the complete command line that you don’t know which website’s PHP script is running. You can enable full command line show by typing ‘c’ on the keyboard.

Now you are ready to do some monitoring. Visit your website while you are checking the top output. If the %CPU shows something like 50 and above, you should do some serious WordPress optimization. I will get back on what i did for the optimization on the next post.

5. Finally, I was able to implement W3 total cache plug-in and caught the CPU leaking bug in the WordPress theme. I was able to confirm that the CPU usage is down in great percentage and the page loading was really fast that the process was not even showing in the ‘top’ command output even with 0.5 refresh time. 

So I wrote another email back to the original ticket. I described what I did in detail and asked the system admin to enable my account. After I sent my email , I contacted the tech support using the live chat again and asked to escalate my ticket again, so the system admin can check it right away. After that I just went to sleep . I have done everything that I could do.

Next morning, I checked my email the first thing in the morning and Bravo! The admin accepted my adjustment and enabled all of my websites.

The whole process took me about 3 days with only few hours of sleep. I am happy because I learned many valuable lessons on how to optimize the WordPress and it is very important to do the optimization all the time especially you are expecting large volume of visitors. You wouldn’t want to miss them do you?

The limitations of Hostgator unlimited shared web hosting account

Posted in Wordpress on June 23rd, 2011 by HanaDaddy – Be the first to comment

Recently I was looking to enhance the speed of my baby croc account at the
Hostgator. I have no doubt that the Hostgator is the best hosting service provider with the best customer service. That is true. However, my baby croc account became so slow with the growing additional addon domains. You can host more unlimited domains on a single baby croc account.

Let me talk about what you can do first with the Baby croc shared hosting account.

  • Unlimited disk space : my current disk space usage is about 8 GB
  • Unlimite email account : I do not have many email accounts, because it’s headache to maintain multiples email accounts. I would rather recommand to use Google App service
  • Unlimited bandwith : Current monthly transfer records shows that I used over 16GB
  • You can add unlimited addon domains meaning that you can add additional domain with wordpress to the same account without extra charges.
  • You can maintain DNS services for your domain.
  • CPanel, SSH access

It’s so attractive with unlimited disk space, bandwidth, addon domains, and it’s so cheap! It’s only about 7 dollars per month. What more anybody would want form a hosting service?

The baby croc or shared hostings is basically that you are sharing the server with other people. It is not clear how many people are sharing the server together, but it is clear that there are some limitations on what you can do.

Here are some of the limitations

1. The maximum PHP memory size is 64 M per execution.
64MB memory is still amazing, but you can not allow more than that. When you enable ‘php.ini quick config’ in the CPanel, the PHP will read in the php.ini file in your home directory. You can actually edit the file and set ‘memory_limit’ to more than 64M, but in fact memory limit error will occur if more than 64M is used.

2. The maximum number of simultaneous processes are 25.
This is the biggest problem that I am experiencing. If the simultaneous process goes over 25, the web request will result 500 Internal Server Error. If you’re WordPress site is slow and have many simultaneous visitors, many of them will see the 500 Internal server error. I am having problems with one of my WordPress site which has some plugins utilizing curl functions. When the remote site is unreachable, the curl function is basically waiting for the reply and does not timeout automatically. So this process will idle and eats up available processes slots. And eventually my visitors will soon see 500 error pages when maximum available processes are all used up. You have to login to your CPanel and manually kill the idling processes.

One way to solve is to define the Conneciton timeout setting for curl function.

curl_setopt($session, CURLOPT_CONNECTTIMEOUT, 10); //10 seconds time out

3. Does APC work with Shared Hosting?
For security reason, the suPHP is used. And that is fine, but the real problem is that any kind of PHP opcode cache solution will not work including APC. I have searched everywhere to find the solution to implement APC or any similar solution to speed up the PHP processing, but I found that it is not possible under suPHP. APC or opcode cache solution stores binary opcode data in the memory space to speed up the next processing of the PHP resource. However, under suPHP this is meaningless , because each PHP processes are separate processes and won’t be recognized.

By default the php.ini does not come with apc.so file , but I was actually able to install apc.so file and I succeeded to show APC in the phpinfo() result page. And ran some benchmarking software to compare the speed with and without apc.so library enabled. But basically there was no difference in the processing speed. (If you are interested in trying this yourself, let me know)

4. FastCGI can be activated easily.
FastCGI is well known for enhancing PHP processing speeds by running number of persistent processes to handle the requests all the time. You can activate FastCGI by adding below line into your .htaccess file in the document root directory.

AddHandler fcgid-script .php

However, I do not recommend you to activate this unless you are on the VPS or dedicated server. On the shared hosting account, you can have only upto maximum 25 processes. With FastCGI enabled, those FastCGI php processes will take available slots and you have much less simultaneous process slots. Also your website eventually becomes unstable and you would soon see 500 Internal Server Error message.

So I have spent some time to find a way to speed up my WordPress sites , but all the well known methods were all failed.

However, the best method for me was to use ‘W3 Total Cache’ plugin . It is little bit confusing when you first try to set the settings with all the options. But I only recommend to use Page Cache. Database cache will create so may files in the disk which will increase the number of inodes. (There is limit on the number of inodes you can create under Hostgator Shared account) But the result is amazing!

If you know a good tip on speeding up PHP process under Shared hosting account, let me know!

Thank you for visiting wpmarking.org.

Amazing HostGator Cyber Monday Deal 50% OFF

Posted in Internet Marketing, Marketing Tools on November 27th, 2010 by HanaDaddy – Be the first to comment

Hostgator is the most reliable web hosting service provider. They had Black Friday deals with 50% off all day and 80% off from 5AM to 9AM CST. I was thinking of taking the 80% deal, but I woke up too late. But 50% discount deal was also great! I bought a shared hosting BABY Plan at $3.95 a month even though I already have one. The regular price is $7.95/Month for 3 years. And the regular total price is about $286. But with 50% discount deal, I paid only $143! Therefore I was able to save more than $140!

But don’t be disappointed yet! Here is the good news! They have decided to extend the 50% discount deal for the Cyber Monday (Nov 29th) and 50% discount will be automatically applied on all of their products. The coupon reference code is CYBERMONDAY2010.

  • Shared Hosting: ONLY $2.48/month
  • Reseller Hosting: ONLY $12.48/month
  • VPS Hosting: ONLY $9.98 First Month
  • Dedicated Servers: ONLY $87 First Month

Even if you already have hosting service plan, it is a very good deal. This kind of opportunity never comes again. I strongly advise you to take this opportunity.

This promotion will run Monday November 29th from 12:00AM to 11:59PM CST.

Hostgator Link


HostGator Link