Posts Tagged ‘opcode’

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 recommend 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 file , but I was actually able to install file and I succeeded to show APC in the phpinfo() result page. And ran some benchmarking software to compare the speed with and without 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