r3dux.org

A number-pimping side project from the valleys in *NEW* upside-down flavour.

  • Home
  • ABOUT
  • OLD SITE
  • SEARCH
  • FEEDBACK

VPS hosting – Linode FTW

r3dux | March 2, 2012

Linode logo transparentWhen I migrated this site from shared hosting to a VPS, I initially went with some really cheap hosting, and I got what I paid for: The site went down often, like every week or so. Sometimes for days at a time. Support tickets went ignored and unanswered, and I was generally a sad puppy.

After a month or two of this I’d had enough, and decided to migrate the site hosting away from Cheap-O-Host to a company called Linode – and I’ve got to say – it’s been absolutely flawless ever since. I can’t even remember the last time the site went down.

This isn’t to say I haven’t had issues with Apache bogging down and basically killing the site by trying to use more RAM than the VPS has available. If I got more concurrent connections than I had RAM for, then some il-advised Apache settings meant that the server would get into swap territory, and the entire thing would grind to a halt from which the only escape was to log into the VPS from the web interface and reboot it. But this wasn’t Linode’s fault – it was mine for trying to do to much with too little.

I finally solved the problem by disabling all the apache modules I didn’t need (which lowered the RAM usage per Apache process, as well as lowering the server’s attack surface), and limiting the concurrent connections to a number that would happily fit within 512MB of RAM – and since then, not a cough or a hiccup. Everything has been running beautifully.

In fact, at the time of writing, my VPS uptime stats are:

# uptime
21:15:38 up 244 days, 12:26,  1 user,  load average: 0.10, 0.07, 0.06

244 days without as much as a reboot! Sweet!

I’m just writing this post to commend Linode because I got yet another monthly email (from siteuptime.com) today saying “site up-time: 100%” and… well, if something goes wrong then people (and definitely me included, here) tend to jump up and down and make a noise – but when something goes right – we generally don’t say anything at all. Which makes the cost of failure getting slagged off, and the reward for success merely not getting slagged off.

As that’s not a particularly good system, I wanted to say something positive about Linode, because it’s not an accident that their systems so rarely go down – I’m sure that it’s entirely due to their hard work, professionalism, and investment & re-investment in the company infrastructure. And I absolutely cannot fault them on that.

So well done, Linode! You guys rock! =D

P.S. For anyone trying to minimise their apache footprint, the minimal set of apache modules I found I needed to run a wordpress site are:

  • alias
  • authz_default
  • deflate
  • dir
  • env
  • expires
  • headers
  • mime
  • php5
  • reqtimeout
  • rewrite, and
  • setenvif

And my final, working Apache prefork MPM settings in apache2.conf for a VPS with 512MB of RAM are:

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          4
    MinSpareServers       1
    MaxSpareServers       1
    MaxClients            13
    MaxRequestsPerChild   5000
</IfModule>

Cheers!

Comments
6 Comments »
Categories
Linux, Tech
Tags
Awesome, Hosting, Linode, Linux, Uptime, VPS
Comments rss Comments rss
Trackback Trackback

How To: Change from Shared Hosting to a VPS, Part 2 – Choosing a Hosting Provider, Signing Up & Connecting

r3dux | June 12, 2010

I finally did it; I’ve made the jump from shared hosting to my own VPS slice – and I’m really rather liking things like this – control is good!

So, if you’re looking to make the jump too, this article should give you the first few stages of the how of things (whilst the previous Part 1 article dealt with the why) – so let’s make it happen, shall we?

Step 1 – Find Yourself a VPS Provider

There are thousands upon thousands of hosting companies who can offer you a VPS, ranging from fully managed (i.e. everything set up for you, but expensive) to unmanaged (where you set up everything yourself, and you pay much less per month). I’ve taken the latter route so I can gain some experience and pocket the difference.

The first thing you’ll want to do is take a look at some hosting sites which bring together offers from various hosting companies so you can compare and contrast them. I spent a while looking at a website called LowEndBox to find some good deals. Quite often, it seems, you can get offers which re-occcur, so if you sign up and enter a code you get 40% off or such, and this applies across the lifetime of your VPS hosting with the chosen company.

After a bit of looking I came across a new start-up company based in the UK called RackVM, who were offering a bunch of attractive packages for decent prices. Web hosting is one of those things where you get what you pay for, so be wary of going with companies based solely on them having the most absolute rock-bottom price you can find, as the service you get might not be too stellar. I’ve only been signed up with RackVM for about two weeks or so at this point, but during that time everything’s been great. Being a new start-up I’m running the risk that they fold in the near future, but I’ve got everything from my old site (files/database etc.) backed-up, and if I go dark I could just get another VPS provider and re-do the config to get it all back up and running in less than a day, so I’m not too concerned about it.

Update: DO NOT sign up with RackVM. I was signed up at 8GBP per month, but with a 40% recurring discount which made it 4.80GBP per month, and believe me, I was getting about 4.80GBP worth of hosting… The site’d be down multiple times per month,, support tickets would go unanswered, and their SLA is just a joke. I’m currently hosting this VPS with the much more expensive, yet infinitely better linode – and everything has been going perfectly.

When looking for a package there are a number of key factors to take into account (I can only really discuss this from a standpoint of what I, personally, wanted and signed up for – but you can happily extrapolate for your own needs):

  • Virtualisation Technology – The two main options for the technology that does the division of a single, physical machine into multiple VPS slices are OpenVZ and Xen. You can read a brief head to head comparison of them here or by putting something like “OpenVZ Vs Xen” into google. I chose OpenVZ for its lower memory footprint and increased speed, although either would have been fine, and likely Xen would have been a touch stabler and more secure as it runs a separate kernel per VPS slice rather than sharing a single kernel across all VPS’. Really, either option will be fine.

    Update: I’ve learned from experience and changed my mind – choose Xen. Really. Do not let your kernel get toppled by idiots on the same machine – segregate it with an iron fist!

  • Disk Space – How much file space do you have available? This is used for any packages you install on your VPS (web servers, FTP servers + storage area, MySQL databases – everything!), I really don’t need more than about 1GB or so for everything, but then I don’t really host a lot of files. The package I got came with 30GB – which is lots, and lots, of breathing room.
  • Bandwidth – How much data does the server need to upload to people? A site with a 300KB front page being hit 500 times a day will use 4.5GB per month at a minimum. When I signed up I got 300GB bandwidth per month, which is orders of magnitude more than I need, but things like FTP count into it, so if I upload something that’s 100MB, and it gets downloaded 50 times, that’s 5GB on top of whatever the site HTML will take, and when you add in running an email server it could easily get higher again. I still don’t see myself using more than 10GB a month in my wildest dreams, but if you can get a high number then you can always try to find inventive ways to use it (like maybe running sabnazbdplus or something).
  • RAM – this one’s important – really important. Remember that you’re going to be running a whole heap of things on the server and that it’ll eat through plenty of RAM. You might be able to get away with 256MB and keep 99% performance. 512MB is a lot nicer to work with and will give you a little bit of breathing room after correct configuration. I got 512MB with my package, and after tweaking apache to use a little less memory am running at roughly 370MB with apache, mysqld, php, postfix (Mail Transfer Agent), courier (POP3/IMAP Server), spamassasin, webmin and a couple of other bits and pieces running. It’ll spike up to 600MB under load, but then it drops back down below 512MB, which is my magic number.
  • Burst RAM – Every server running VPS’ will have more RAM than it needs so it can offer it on a temporary basis to any one of the VPS’ on the server. With my package I have up to 1GB Burst RAM, which means that when my site’s under load and the memory usage increases, I’ve got that additional 512MB to use. Be warned – if you go for a VPS with a low memory limit, and your site’s memory usage sits up in the Burst RAM all or most of the time, they’ll be on to you to upgrade your package to one that provides greater RAM, and costs more per month.
  • Operating System – OpenVZ and Xen can be run on any *nix, so you’ll have the option of picking your server platform from a bunch of choices like: Debian, Ubuntu, CentOS, FreeBSD or OpenBSD, Slackware, Gentoo etc. Some people say Debian is the metaphorical win as a server platform as it’s extensively tested and as such very, very stable. However, I chose Ubuntu 10.04 64-Bit as my server platform of choice, because 10.04 is a LTS (Long Term Support) version of Ubuntu, which means it’s gone through a pretty extensive testing period during its gestation, and as it’s pretty new it has all the latest versions of software available for that cutting-edge goodness. Also, I happen to run Ubuntu 10.04 as my OS of choice (normal, not server edition obviously), so anything I know works on my local machine is pretty much guaranteed to work on the server, and I can test things out on my local box before putting on the server.

Step 2 – Sign Up and Provide the Correct Server Details (Server name, NS1, NS2 etc.)

When you sign up, you’ll pick a package that gives you the combination of above options that best fit your needs, then you’ll need to enter some additional details for the VPS slice – you’re likely to see a screen asking you for details like this:

VPS Signup Server Settings

For this example, let’s say we have the site www.foobar.net on shared hosting, and we’re transitioning it to a VPS.

The first field, hostname, is asking you what you want to call your server. If it was just an email server, you might enter mail.foobar.net here, if you were going to have multiple servers serving files for the same domain (foobar.net) you might enter server1.foobar.net or server2.foobar.net. As I’m only ever going to have a single VPS serving everything, I thought I’d just call it server, and as such for our example I’d enter server.foobar.net and for my own particular instance, I entered server.r3dux.org.

The next two fields are asking you for the name of the primary and secondary nameservers that might run on the domain (i.e. what you would call them if you decide to run a DNS service such as bind) – they are NOT asking you for the name and address of the DNS servers which currently host the record for your shared hosting! It’s kind of like a “If you were a name server, what would you call yourself?”-type question =D For our example, we could happily put ns1.foobar.net for the primary nameserver and ns2.foobar.net for the secondary nameserver, and in my specific instance, I put ns1.r3dux.org and ns2.r3dux.org. I’m not even going to run a DNS service, as I simply don’t have to, I’m just specifying what I’d call the nameservers if I did!

The fourth and final field is asking for the password you want to set for your root account on your VPS. By this we mean, you have full access to your VPS using the top-level administrative account root, through which you will log in and administrate the the system. When your root account is created, on your VPS – what password do you want to use? I’d recommend setting this as something pretty strong (at least a dozen characters) which uses a combination of upper and lower case letters plus some numbers and punctuation, because if it gets compromised – your box will no longer be your box…

For our foobar.net example, this means that we’d end up with something like this:

VPS Signup Server Example Settings

With these details provided, proceed through the registration process, and you should be sent an order confirmation either:
- Detailing and confirming your order and asking for payment before it gets set up, or
- If you already paid at the registration stage, detailing the IP address of your spanky new VPS! (and optionally, a separate IP address and details of your username and password to connect to the server through SSH).

Step 3 – Connect to your Spanky New VPS!

Once you’ve paid and received an email giving you the IP address of your VPS, it’s time to connect to that bad boy!

VPS’ are servers, and as such don’t run graphical desktops – it’s all administered through the command line. So the best way to hook up to your VPS is through a SSH connection. With RackVM, remember that this is my first VPS so I have no other knowledge of what other VPS hosting providers do, they send you an email with a separate IP and username to use to connect to the VPS.

To connect to the VPS through linux, I can run the following command and enter my root password (the one we specified earlier in Step 2!):

ssh 1.2.3.4 -l <YOUR-SSH-USERNAME> -p 22

Where 1.2.3.4 is the IP address given for SSH access in the confirmation email. Once connected, you can install stuff using apt-get, or dpkg or whatever you like…

To connect to the VPS through a Windows system, your’re probably best off using PuTTY.

At this point, you can go to the HTTP address of your server (for example, http://5.6.7.8, where 5.6.7.8 is the IP address of your VPS server itself [and not the IP address of the SSH access - assuming that, like mine, they're different]) – but there’s likely to be nothing at all there because Apache isn’t installed! If you wanted to install and run Apache quickly you could always SSH into your VPS and run:

apt-get install apache2
/etc/init.d/apache2 start

And then try http://5.6.7.8 (again, replacing 5.6.7.8 with your VPS IP address) – and TA-DAAAA! She lives!

Next Steps: After this we’ll want to configure Apache, add MySQL as a database server, add PHP, an Email server, add an FTP server and some Web Administration tools plus a couple of other bits and pieces – all the while keeping the memory usage low!

It’s easily do-able, it’s just a slightly lengthy process – which I’ll save for a Part 3 article, me thinks :)

Oh, and if you’ve seen anything in this article you think is wrong, technically inaccurate or plain bat-shit crazy – please feel free to correct me in the comments!

Cheers!

Comments
No Comments »
Categories
How-To, Tech
Tags
Guide, Hosting, OpenVZ, Shared, VPS, Xen
Comments rss Comments rss
Trackback Trackback

If You Can See This Post…

r3dux | June 4, 2010

…then the DNS propagation has completed successfully and this site’s now living on a spanky new VPS! =D

Fuck Yeah!

Success! Next step: Email server install & config. That should be fun ;)

P.S. If you’re thinking that the site must already be up and running for me to be here and enter this post, you’re right – it is, but you can’t (or couldn’t) get to this VPS-hosted version of it as the DNS record for r3dux.org didn’t point to it; I had to hard-code the VPS IP address into my hosts file to be able to get here (while keeping links working) and test out the server before it could go live! Schneaky!

Comments
No Comments »
Categories
Humour, Imagery, Tech
Tags
DNS, Fuck Yeah, Hosting, VPS
Comments rss Comments rss
Trackback Trackback

How To: Change from Shared Hosting to a VPS, Part 1 – The Calm Before the Storm

r3dux | June 2, 2010

I’ve had this site hosted with the same hosting company for as long as I’ve had it, which has got to be coming up to around five years now – and ya know, they’re okay. It costs me maybe £60 per year for the domain r3dux.org plus a shared hosting package of maybe 8GB file storage, a couple of MySQL databases, e-mail, FTP, support etc. – which to be fair is a pretty good deal! That £60 goes a long way – which means it’s stretched very, very thin…

The kicker is that my hosting package is exactly what it said on the tin when I bought it: Shared hosting – this means that this site, plus a large number of other sites are all hosted on the same server with no separation of any kind between them – so when a bit of JavaScript or PHP or ASP or whatever goes and thrashes the box, or hangs using 100% CPU, it takes everything else down with it. 503 Site unavailable. Game Over.

And this has happened a lot.

The file server goes down, so the MySQL server isn’t asked for files, or the MySQL server goes down, so the requests for data go unanswered – if it’s not all working together, you’ve got a blank page. Over the years I’ve bit my lip, fired off support tickets, waited patiently, put up with very sluggish performance just being thankful that it works – but no more! We’re moving on to greener, and faster pastures… Enter stage right: VPS

A VPS, or Virtual Private Server, is a slice of a full hardware server. The full server might have 32GB of RAM, my slice might have 512MB of that. The full server might have a TB of storage, my slice might have 30GB of that. The full server might have 2 x 4Ghz processors, my slice might have full use of them for 5ms out of ever 1000ms in a second. And the slices are strongly separated, commonly with virtualisation software such as OpenVZ or Xen.

This means that if, for example, Joe Blogg’s server has some nasty script that’s thrashing the CPU, it’s thrashing his slice of the CPU (i.e. his 5 milliseconds) – but not mine! From a users perspective, this means that his site might be down, but all the other VPS’ on the physical server will still be up. In effect, one errant site or script can’t scupper all the sites on the server – Win!

But it’s a little more complicated than that…

VPS’ come in different flavours – fully managed, and unmanaged. With a fully managed VPS you have people to help you set it up; they can set up or help to set up web-servers (apache etc.), email servers, ftp servers, MySQL servers etc., but you pay $30AU more for the VPS. Per month.

With unmanaged VPS’s you just get the VPS plus an install of an operating system of your choice (Debian, Centos, Ubuntu etc.) – but that’s it. It’s up to you to install and set up apache. It’s up to you to run your own ftp server. It’s up to you to run your own mailserver… For example, if I wanted mail at r3dux dot org to be a valid email address – *I* need to install, configure and administrate the email server for that to happen. You get complete control of your VPS, but you get complete control of your VPS, if you see what I mean… For $30AU a month saving, I think I’ll run everything myself, thanks :)

After all this, there’s still the matter of the DNS records – currently my hosting provider runs a DNS server (well, two really – a primary and a secondary; ns1.somehostingco.com and ns2.somehostingco.com) – once I have my site hosted on the VPS, I need to be able to update the DNS records so when you go to http://r3dux.org it translates to the IP address of where I’m now hosted, instead of the IP address of where I was hosted, and with my current hosting people I don’t believe I can change that, so I need to transfer my domain to a registrar where I’m able to edit the records to say I now live here!

As you can see, it’s no small task – but I reckon I’m up for a weekend project :)

If you never see anything on this site ever again – I’ve failed! But with with any luck, at least at some point in the very near future, I’ll see you on the other side :)

Comments
3 Comments »
Categories
How-To, Tech
Tags
Hosting, OpenVZ, r3dux.org, Shared, VPS, Xen
Comments rss Comments rss
Trackback Trackback

Translate

Categories

Archives

Tags

3D ActionScript ActionScript 3.0 Adobe AI Ballarat Bash C++ Class Convert CS4 Effect Error Film Flash GLSL Gnome Hack How-To install Jaunty Java Kinect Linkage Linux Mash-Up Microsoft Motion OpenGL Particle Problem PS3 Remix Retro script Slides Sound Systems Texture Ubuntu Video VirtualBox Wii Windows XBox

Gamercard

OpenR3dux

Misc.

Flattr this

RSS Feed

r3dux twitter feed



“Since my last report, your child has hit rock bottom and has started to dig.”

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox