For Developers: When to Choose a VPS

As a website owner, you've probably heard that Google is using your page load times as a metric in their ranking algorithm. It is not given a lot of weight, but even for usability reasons, having a fast website means having happier visitors (and more of them). With tools like Google's Page Speed and the YSlow firefox addon, you quickly run out of optimization tips to do on the page level. You need to dig deeper for real speed gains.

If you are a web developer, this post is for you. It goes over some of the experience I had with moving Tutorialzine to and configuring a VPS (virtual private server), the logical step after shared hosting.

You may wonder why it took nearly two years for me to decide to migrate this website. Well, it's because

Shared hosting is not a bad idea

Coming to think of it, the Internet Revolution didn't occur because of Google, Twitter, nor Facebook, as much as it did for offering a cheap way for people to publish content online. And it doesn't get much cheaper than shared web hosting - thousands of websites on a single server, utilizing every bit of performance and bandwidth. And every couple of years, as servers become more and more powerful, it is possible to host ever larger websites on that same cheap platform.

Bad reputation

But then, why does shared hosting have such a bad reputation? It is actually a combination of several factors. Having learned to use Google before asking trivial questions, I didn't need much support from my web host. On the rare occasions that I did (usually to report issues like downtime, unreachable database server or undelivered email), it usually took about 24 hours to receive a response. While this has more to do with the company itself than shared hosting, it is still part of the experience. But before judging too harsh, keep in mind that you can't expect miracles for $5 per month.

There is another bad practice that nearly all shared hosting providers are guilty of - overselling. Going after maximum returns, companies cram more websites than what is possible for a single server to handle, in the hope that not everyone will be using what they are promised. The result - bad performance and frequent downtime. Of course, I have to admin that there has been good progress in this area in recent years, but it is because of the more powerful hardware, and not that companies have become nicer to their customers.

However, you can work around this problem - with WordPress plugins such as W3 Total Cache, I managed to optimize the page load times of this site, and with services like MaxCDN (which kindly sponsor Tutorialzine), I was able to increase the download speed of static files like images, stylesheets and JS files by moving them onto a fast delivery network. So as a result, I had livable performance even on a commodity web hosting provider.

The bad news is that this comes at a price. Although my website was as optimized as possible this still didn't save it from

The downtime

We've all felt the frustration when a favorite website is unavailable; it is even worse if it's yours. Downtime is a clear sign that your oversold web host is struggling with the load. It is understandable, once you take into account the millions of pageviews it has to serve every day. But there is another issue that becomes clear once you try to set up your own LAMP server: commodity web hosts aren't tuned for speed, they are tuned for security. Isolating users from one-another on a shared system is an absolute must, which means that no system-wide caching or other performance optimizations are possible. They also have to stick to the slow Apache, as it is the most feature-rich webserver that a lot of software (including WordPress) depends on.

performance-improvements.png

Here comes salvation

The obvious choice is to ditch shared hosting entirely and move to VPS. This is your individual slice of a real server, over which you have complete control. You can choose the OS (most likely a server-friendly Linux distribution) and the software on the machine, so you can install pretty much what you want. It is more expensive than the $5/m hosting plan, but you get guaranteed performance and the freedom that comes with it.

Sounds exciting? Yes, indeed! So you order one, spend a couple of hours following one of the friendly getting started guides, fire up your browser and discover that your website is as slow as it used to be. But how come?! You followed all the steps, embraced the open source philosophy, and still it isn't much better.

The bad news

It is easy to have a LAMP stack up and running, but it is hard to have it running fast. As a minimum you will need to be comfortable at the terminal, doing basic Linux administration, configuring web servers, setting up virtual hosts, email and dns, while at the same time keeping you system secure. With a VPS you are on your own. If you don't have experience working with linux, or the time and energy to read and experiment as things happen (a quite debilitating task, trust me), you are going to have a bad time.

Moving Tutorialzine required several days of testing different configurations, installing software and tweaking. I also had to read about all the topics above and become familiar with a lot of command-line utilities. But was it worth it? Of course it was. I now have complete control on my set up and can install exciting software that I couldn't have hoped to find on a regular web host. The site is also much snappier than before, which will benefit everybody.

How to decide

Choosing where and how to host your website is not easy. Right now there are a lot of alternatives to shared hosting that do not require you to set up your own virtual server. There are cloud platforms like Heroku and PHP Fog, or grid hosting solutions that aim to narrow the gap between VPS and shared hosting. If you don't want to spend time on a command line, I suggest that you give these a try.

For me going with VPS was a natural choice, as I had already spent some time reading about linux, so it was about time to put the things I have picked up over the last year into practice. But I will not be cancelling my hosting account any time soon. It is still a nice fit for simple or low volume client websites.

What is your experience?

Have you tried any of the cloud platforms? Do you keep a hosting account lying around? Share it in the comment section.

A newsletter full of programming news, cool libraries, and productivity tips.

Join Dev Awesome

Related Articles

Adam Engebretson

I started my web development adventure with local .html files, then moved up to Freewebs.com (now webs.com). Exotic, right? Then moved into a shared hosting provider that used cPanel. This was revolutionary for me at the time. Eventually moved to ulmb.com, then to hostmonster.com. Hostmonster was the best shared provider I've ever used. The decision was made to move to a VPS when Hostmonster started complaining about not my hard drive usage, rather my filecount. Same with databases... Too many tables, they said. VPS with RackSpace Cloud was the best thing I've ever done. I still have some sites on my HostMonster and plan to leave them there until they require a domain renewal. Domain renewals are good times for transfers and server migrations. VPS is the way to go if you know what you're doing!

To date, there hasn't been a shared host I've been content with. For that matter, there's a lot of (budget) VPS Providers that aren't worth the time/hassle. PHPFog, on the other hand, is nothing short of amazing if you just want to build and launch (especially if you're already familiar with GIT).

When it comes to VPS providers, I usually push clients/colleagues to look into Amazon AWS. EC2 instances are often a better deal than moving to a VPS provider.

Paul Anthony Webb

I will certainly be bookmarking this post.

VPS is definitively the place to go after shared hosting. Yes, there is a lot of budget hosting companies that oversell, but there is also a lot of good providers out there. All you got to do is do some research, just like you would do if you were to buy a new phone, car, tv etc.

webhostingtalk.com is a great place to start.. Do a search for the providers that looks interesting, and see what other people say. This is where I found my hosting provider, and you can also get some good hosting deals at this place.

When buying a VPS you need to check if it's a managed or unmanaged VPS. Unmanaged is good if you know Linux (I say Linux, since most of the companies are offering some sort of Linux distro as OS), and are comfortable configuring/fixing everything yourself. If not, a managed solution is the way to go - where the hosting company helps you with whatever problem you might have. Managed VPS hosting tend to be a little more expensive than the ones that offer unmanaged hosting.

I have started moving my company's sites from a private server on Pair.com to a managed VPS on LiquidWeb. Pair was a nightmare, LiquidWeb is a dream. One of the most amazing things is that they don't wait for me to follow up on support conversations, they follow up repeatedly through emails or whatever until the support ticket is logged as 'problem resolved.' They have a cloud option I have looked in to. Anyway, you should check them out.

I used to work for HostMonster/BlueHost, and they weren't bad with their servers but you are right about priorities. Security would trump anything, and I can understand why. The problem was that it became such a deciding factor that often times speed or reliability was neglected. They do a good job, and if you have a small site with little or inconsistant traffic, they can be a good option. I outgrew them and moved to SliceHost before they got bought up by Rackspace. After they told me I was going to be migrated, I cancelled and moved to Linode, and I have been really happy since then. I, for one, like being left alone to my own devices. If I want something done, I have to do it myself, sure that can be a hassle some times, but I never have to worry about someone else mashing over what I do. I like knowing that I get the server exactly how I want it.

I used fatcow's shared hosting for my projects. It had a good uptime but, sometimes it had problems too. Regarding some performance issues. I moved to VPS as I completely agree with you Martin, that you do need some of Linux Experience. I had to test my skills and knowledge for over 2 months to make my projects to transfer to VPS. Now using Linode VPS :)

Vernessa Taylor

Hi Martin,

Nice writeup on when and why webmasters might want to go the VPS route.

Congrats on selecting a VPS host and getting it all setup like you want! It's no small feat to configure a VPS to your own specs and get it running snappily.

I've used numerous shared hosting providers. After using a few that eventually had my sites running at a crawl, I've finally settled on Site5. They cost a twice the $5 plans (I use their Turbo Pro plan), but no worries on speed and no constant issues about the size of your databases etc.

The best VPS provider I've used was JaguarPC but at the time I thought the cost was a bit much. That was a few years ago and they've adjusted prices downward somewhat, so I might go back to them when I'm again ready for a VPS. I'm leaning that way as I want to set up some process-intensive softwares like BooneX's Dolphin. But I'll keep my Site5 plan, too, for other sites.

Jordan Walker

I have personally really liked the flexibility a dedicated server provides. It is great to have a collocation server, as a HIPAA compliant box, but on the flip side using a resource like Rackspace has also been great.

I suppose it boils down to the level of comfort you have running a server.

Pedro Manacas

Being a hobbyist, I swear by googgle app engine. Yes there is a learning curve (you have to learn their specific api's) and you're pretty locked in if you use their datastore (although there is an sql option now that makes everything more portable). But for ease of use and deployment there is no equal that i've tried. I've tried deploying simple things on Amazon EC2 and all the command line and ssh stuff just tripped me big time, i managed to deploy a preconfigured image to run Joomla with a MySQL db but that was all. If you're an amateur like me, i can't recomend Google App Engine enough, Python is an easy language to learn, there is zero time spent on the command line or configuring servers and databases, and on top of everything, the documentation is excelent, with plenty of examples and boilerplate code to use. Also, if you come up with a genius idea that suddenly gets tens of thousands of users you are already setup to take them on.

I feel dumb. I spend 70€ per month for a shared hosting and it runs like shit. My website is getting bigger and bigger every day I get +6,000 unique visits per day. But I really have fear to move to a VPS.

Last Year I moved the website to a VPS and it was up there for like a month or two, and was the same shit even worst than before. Well few months ago the hosting mothafucka decided to move everybody to a new grid (cloud) system, because of the load of the server and because it's cheap for them... well the grid is the same ish, I get mysql errors, downtimes, 503 errors and a lot other problems. The users started writing email for these continous problems, but I don't really know what to do.

In two years of life, the website changed 6 servers... in 4 different webfarms with different companies... and it always was wack.

Which linux distro do you recommend to run a web server like this one in Linode? I know any of them will work with PHP and MySQL but which one you recommend to be the most comfortable distro for a web development server?

Martin Angelov

Everyone has their preferences, but I use Ubuntu server, as it is basically a stripped down version of the desktop version. Using the same distro allows me to apply what I learn on the desktop to the server and the other way around. There is another benefit - because of its popularity, there is plenty of documentation for it.