Is Shared Hosting killing your website?
July 27, 2009 by Jason-Mulreany · Leave a Comment
Cheap shared hosting has made it very affordable to host a website. However, if your website uses a database (and these days most websites do) you may find your site is very slow to load.
This can result in users leaving your website and never converting into paying customers – obviously you don’t want that! Here are some reasons why your database-driven website may be crawling and suggestions on how to resolve it and retain your customers.
Shared Hosting Explained
Websites are hosted on the Internet on large web servers and the costs for hosting these websites can be just a few euro per year. For these web hosting companies to make any money they must share these web servers among thousands of websites. This allows them to sell hosting at extremely cheap prices (this is a good thing) but there can also be trade-offs such as slow database response times (this is a bad thing).
As I discussed in a previous post [Why Everyone Is Judged Against Google] most websites now rely heavily on databases to power them. Here are some of the reasons why database-driven websites may run slowly in a shared hosting environment.
1. Limited Connections
The hosting companies set limits on the numbers of concurrent connections each database can accept. The idea is to ensure every website gets a fair share of the database server resources. The cheaper the hosting package, the fewer connections the databases will accept. One large hosting company we spoke to cited 50 connections for their basic shared hosting package.
2. Multiple Connections Per User
Ok, that doesn’t sound too bad. 50 users can simultaneously connect to your website and that’s fine if you only have a small or low-traffic website. Sorry guys, that’s not quite how it works. One users does NOT necessarily equal one connection. A single user loading a dynamically generated webpage (and most are now dynamic) can initiate several connections to the database. So suddenly those 50 simultaneous users can shrink down to about 10 – 15 users. The website will appear really slow to anyone else hitting the website until some of the database connections are ‘freed up’. Not good!
So you may decide it’s worth paying a little more and going for the more advanced shared hosting plan that allows a much greater number of concurrent connections. Even if your users can successfully connect to your database the response times can still be quite poor because of contention.
3. Contention
On shared hosting your files sit on one web server and your databases sit on another dedicated database server. This is perfectly normal. The problem is that there are typically hundreds, or more likely thousands, of other databases sitting on the same database server. To be fair to the hosting companies, they do invest heavily in their server infrastructure and their database servers tend to be high quality with high availability. However, any database server trying to service thousands of databases simultaneously is going to run into difficulty – you will have bottlenecks at the network level, machine I/O, CPU cycles, even disk accesses. The end result is an over-subscribed database server is going to have issues with latency i.e. slow response times.
4. Bad Applications
Other websites bad application design is yet another problem for your website to deal with. You may have a lean and nifty database that’s properly indexed and very efficient. Other websites using the same database server may have badly-written, inefficient and bloated databases. One example is a certain motoring website that pulls the ENTIRE database of cars every time anyone hits their site and this is then filtered down on the clients side. (Imagine your Tesco home delivery arriving with the entire store in a container lorry when all you wanted was a loaf of bread – that’s about the best comparison I can make.) This can cause BIG problems for you and everyone else on that database server. A poorly written application can ‘hog’ server resources tying up the processor, the disk read/writes and the network which are all finite resources. In a nutshell other websites’ badly written applications can cause slow load times for your website.
5. No Control Over Database Upgrades
Hosting companies will argue that they monitor database servers and will bring on extra capacity – maybe more SQL servers or ‘beef up’ the hardware – to accommodate this. But who decides what is ‘acceptable’ service from a database server? When users start experiencing time-out errors then any hosting company worth its salt will address the issue. So problem solved – once the database servers get busy they upgrade them and all is well? Sorry to be the bearer of bad news again but no.
The Need for (Database) Speed
Websites experiencing database time-outs are clearly going to cause users to leave that website in their droves. But what about when the website is slow but …eventually…the pages load. Well, in this age of super-fast broadband and impatient web users that is just not going to cut it. According to Web Usability guru Jakob Nielsen, one second is now the acceptable time to wait for any webpage to load and beyond that you lose the user’s attention and run the risk they will simply leave the site. He also notes that “If you go the best websites, like Google … they give you the page like that [clicks fingers].”
The Bad News
So the bad news is that your website in a shared hosting environment will probably experience slow database responses at times and as a result you will lose website visitors. Lost visitors are lost customers and that means money out of your pocket.
The Good News
We have devised a very cost-effective and very simple solution to this problem. Order your own Virtual Private Server from your hosting company and run it as a dedicated database server. If you want to know more about how to do this check out our post [ Turbo Charge your Website with a VPS Database ]
In Defence Of Hosting Companies
I just want to wrap up this article by pointing out this is not an attack on hosting companies. Most hosting companies provide an excellent level of service and support and get paid, let’s face it, very little for it. It’s just a numbers game – you can’t provide hosting that cheaply and still provide the kinds of database speeds you can expect on a private server. So if you are happy with your website’s performance then you don’t need to worry. If you are not happy and are losing customers simply because of database lag you now have a simple and effective fix and the hosting company gets paid a little more by you each year. It’s what you call a win-win scenario…
Want Some Assistance Setting Up Your VPS Database Server?
You can contact Jason Mulreany directly on 087-6692719 or email jason@mulreany.ie for more information about our virtualised private database solution.
