Sometime ago I wrote about “X-Factor” of Web Hosting Provider / Server when it comes to hosting a website. In particular, a WordPress platform. At that time, I don’t really know what causing some of the server on different provider giving me different characteristic of all kind of strange behavior on WordPress. I think I found what the real problem behind all of those problems, so this is what the web hosting provider don’t want you to know. For sure.
Introducing TPC! Memory Usage plugin
Before I get into the real business, I have to give this tribute to this plugin as practically this plugin is the one solving all the mistery. This plugin is developed by Chris Strosser with the main purpose is to keep track ofWordpress memory usage and system information. For full feature list you can visit TPC! Memory Usage plugin site but for this purpose there are 3 main features that really useful to track your server problem:
- It displays the CPU load average. This is the indicator from UNIX kernel (not available in Windows Server) regarding the level of busy-ness of the processor. Of course the ability to display or not display is really depending whether the function is disabled or not by the hosting provider. So, while they are not really aware about this plugin (it’s quite new), just do your assessment quickly)
- It displays the trail of memory used by WordPress
- It can trigger email if the usage of memory pass certain threshold
- It display the setting of some important security parameter
Additionally as added bonus, it also displays the setting of some important security parameters that you need to worry about. (You might want to change those setting to recommended value)
About CPU Load Average
This simple indicator from UNIX’s kernel giving you 3 number that represent load for the last 1 minute, 5 minutes and 15 minutes. You can use above plugin to display it (as pictured on the right above). Otherwise, if the function is disabled by the hosting company you need to have shell access (SSH access) and just type ‘top’ or ‘sar’ on the shell (check the Linux variant manual and the location of the program).
Load Average: 1.5 0.5 0.25
In a nutshell, the meaning of these number is: for each processor, the 100% capacity is “1”. So, usually a server will have at least 2 processors, so the 100% load will be “2”. If each of the processor is “Core Duo” (have 2 cores, then the 100% load will be at “4”. So, the meaning of the example is (assuming only 1 processor on the server): there is increasing loading. 15 minutes ago it’s average at 25% capacity, increase to 50% 5 minutes ago and the last 1 minutess it has 150% capacity.
What does it means? Anything below 100% load, meaning all the process will be done immediately without have to wait. If it’s more than 100%, then the operating system will make a queue that make the process waits for the execution (slow down your website delivery). The higher the number the busier the server. You want the number to be low all the time. I would say 200% of the full capacity will be still tolerable, but more than that you will see the sluggishness.
Some webhosting, like IX webhosting, make this parameter super sacred. When I raised ticket to complain and ask for resolution about the sluggishness and overloaded server (even website cannot be accessed) – CPU load at around 20, they will just dodge me that “currently is okay” there is “no overloading” and I should “contact live chat or call” at real time so they can track down who abuses the server so that they can suspend them. And it happen: on the next occasion I immediately contact live chat when the loading was high and even PHP cannot be executed (just displaying the default place holder of the Apache webserver).
What the live chat did? They cover up the overloading! They checked the server, identify the abuser and kill the process, so the server back to normal or at least less busy (hence the website will function normally). And they told me that I got “directory index” problem – which is completely B.S. And when I mention that I can see the CPU Load average number, they suspiciously ask how I can get to see the number because “only System Administrator” can access the information.
They will never admit there was an overloading because that’s bad for their business as it’s a proof they cannot really control their user. This will come to load balancing below.
About Load Balancing
Load balancing is about dividing fairly/evenly the resources for every user on the server. For example, if there are 4 GB of RAM installed on the server and there are 50 customer whose account place on the server. Then theoretically every customer should get allocated 4GB/50= 80 MB. Meaning if your complete wordpress (with plugin) requires 20MB, then you can get 4 visitor at once.
With “load balancing” this value is more less maintain. Meaning if other customer use 200MB of memory, his website will stop at 80MB, and your website will still run without problem.
Without load balancing, all the memory can be used at once. So, if one customer dominate the server and use the whole 4GB for example, then while their website running giganticly, 1 new and only visitor that come to your website will get “server busy” error message and denied access. Well on the positive site you can be the one that dominate the server. The risk is account suspension.
This give you more headache. You want the website to be popular, and thanks God one of your article got into first page of Digg, and when the fame just start trickling down, your website is taken down (suspended) due to overuse of server resources. Not fair isn’t it ? How do you know exactly the timing? no body really knows and you should not get punished.
With load balancing, yes, you can only still serve 4 visitors at once, but at least it will be stay alive regardless of the load. There will be no suspension because of similar issue. You will see tremendous stats increase and probably consider upgrade to dedicated server. But no suspension.
So, hosting company that offer you built-in load balancing mechanism on the server will be better.
To be fair with IX WebHosting, for years I was on their load balanced server until they move me to the new one. It was beautiful and very stable. Why they don’t do that anymore ?
Well one of the big reason is: such load balancing system is basically the gist of what so called VPS (Virtual Private Server). Why bother spend software and man-hour to do load balancing to shared server where the user pay only $10 per month while the same setup can be sold as VPS for $30 per month. There is no comercial incentive !
One of other application of TPC! Memory Usage is to monitor the usage of your wordpress including the plugin. Read this article to check how much memory your plugins are really using. You will probably surprise of how much memory can be consumed by those plugins. On this matter, try to disable all your plugin totally, and see what memory being used as reported by TPC! Memory Usage plugin.
Using WordPress 2.9.1 and no plugin at all, with various hosting company, the result are quite different. WebHostingBuzz is the best with bare memory usage around 11MB, while the worst is IX WebHosting with around 19MB! I use “standard” set of plugin that consumes about 6MB. The difference is very obvious: between 17MB vs 25MB. This means, even the PHP Memory Limit set to only 24MB, the first server will operate easy without problem, the other will full of error, blank page and visitor frustration.
Why they are so different? Well, first of all the version of software they are running, the patch they apply, the module they install (or not install), the operation system, the configuration (running as fastcgi, cgi or Apache module) and many other factor.
Things To Consider And/Or Ask Your (next) Hosting Company
- Check what the default of PHP Memory Limit – you need to get at least 32MB to move freely. Ask what is roughly your ‘memory quota’ for constant use, and how much you can use only for short time (burstable) before they suspend your account. Any jittery answer will alert you for some dodginess / uncertainty about policy.
- Check the “money back guarantee” feature – ask specifically what the policy on refund and the administration cost (if any) if you decided the server is too crowded or not up to your standard.
Also check the restriction (if any) to just pay off those “free” domain that come with the package. You should be able to get full refund then pay the cost of the “free” domain (unless you don’t care anymore with that domain)
- During “money back guarantee” period, make sure you check:
- The bare WordPress memory consumption (without any plugin) – what the difference between the PHP memory limit allowed.
- The average or tendency of CPU load average that indicates the overloading of the server
- Responds from external party. Use tools like pingdom.com. See this article for further read.
- Prefer the company that use load balancing. Ask the question: is the server load balanced?
- Prefer the company that allow Shell (SSH) access, even with additional price. The fact that they allow shell access means
- they have at least the confidence about any security issue of giving shell access
- they are more open about some simple indicator easily accessible from shell, such CPU load which can be a proof of overloading
- you can actually check who is overloaded the server, by using this command that display the top 10 heaviest user (only if the setting and program available for you):
# ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
- You will have more flexibility to move around, install software, modify things, etc (required some advance knowledge, though) – if you are not that confident, ask your geek friend to help !
- Don’t worry too much about “unlimited bandwidth” or “unlimited storage space”. You will not use it or even able to use it. There will be some “fine print” that prevent you to use the “unlimited” aspect.
As you just started, there will be hardly any visitor, so it is more important to make sure the server can perform as fast as it could once the visitor start to come over time
The Answer of X-Factor
So, as conclusion, the X-factor were caused by:
- General busy-ness of the server as indicates by CPU load average
- Whether a server is load balanced or not
- Software Configuration/Setup on the server with regard to the value set on PHP Memory Limit
At least I will not die still wondering what was the problem. I hope you can take additional understanding as well, when it comes to your web hosting provider.
Till next time !