Articles in the ‘SliceHost’ Category

Upgrades and maintenance – a necessity

Monday, March 31st, 2008

On top of my server moves, I’ve also gone through the motions of upgrading legacy apps, as well as this blogs wordress and phpbb3 forum.

I don’t know what version of WP I was running before, but this new version is pretty cool, better design and interface, nice and clean, and I’ve upgraded phpbb from 3RC3 to the latest version, 3.0

This re-iterates what I was talking about in my last post, the more apps and sites you have floating around the more sites and systems you have to mange, update and maintain on a monthly basis.

All of my sites are run on some kind of underlying application, be it 3rd party or custom written, and all of them require upgrades and maintenance to keep them running efficiently, and to make sure they aren’t venerable to attacks or hacks.

Spending this time is fine, as long as there’s a benefit, if you have all these sites out there that don’t have any traffic and you’re spending time upgrading them then you’re only taking time away that’s better spent serving other sites – you could be spending an extra hour a day promoting your more profitable sites while your screwing around with un-required maintenance.

Really look at all the sites your running and have a good think about what’s up there of value to you, and what’s just a waste of time and resources, kill them and maximize the time you spend to make your main sites more profitable.

A morning of house cleaning… well, server cleaning

Monday, March 31st, 2008

Having everything organised is important to me, and it should be for almost everyone. There’s nothing worse than having a server die, or system crash and not knowing what’s affected, not having a backup and not knowing what has to be restored.

Aside from a system restore point of view, it’s important in case a server becomes hacked or heavily loaded; it’s good to have your heavily loaded sites on servers that can handle the traffic, or at least have a location for them to move to in a short period of time if one of your sites does become busy.

I’ve spend the first 4hrs of this morning moving sites off 2 of my old dedicated servers and into new virtual server environments. My new virtual servers won’t have hardware failures and won’t need hardware upgrades, additional resources are 1 click scalable and the hardware is spread across multiple servers.

Another part of organisation I like to do with my servers is to remove any sites that are unused, or dead, I like to prune old sites off my servers, rather than letting them linger around for no real reason, I either sell or just delete and let the domain drop.

The fewer sites floating around on my servers the more focus I have on the sites that are actually worth spending time on, rather than having to maintain sites that are a waste of time.

I have a few hundred domains, but actual sites that are operational are around 40. I have designs and systems for close to 100 domains, but I don’t have the time to maintain or market the rest of them, the designs are sitting on our local server for the day when some of the current batch that are operational are shut down or sold off.

I talk about this because my friend just had server die with about 40 sites on it, took him over a week to restore all the sites on a new server, mostly because of bad backups and not knowing what was actually on that server. It was all a bit of a mess, but at least now he’s running on a dedicated virtual server that shouldn’t die anytime soon.

We’re all having the same problem with rails hosting

Sunday, March 16th, 2008

I think the biggest problem with ruby apps is the hosting.

PHP is so easy to host, you can upload it almost everywhere since mod_php is usually deployed by default with apache and php is deployed with every server now days.

Problem with Ruby is that it *can* be memory hungry and there’s ‘installing’ to do on the server side to get it up and running.

On top of that, web hosts either don’t support it, don’t support it well, or charge a lot to support it.

You can pick up an average ruby hosting plan with a plesk or cpanel control panel etc etc, but it’s going to be slow, not only because you’re on a virtual hosts - shared environment but because it’s not setup right, not load balanced and what not.

Just because it says FastCGI doesn’t mean its fast, Lighttpd isn’t all that light, and using a VPS and still using a control panel like plesk to handle your rails isn’t going to solve any issues.

This is where I think Slicehost is *almost* the perfect host for rails projects.

You can easily setup a couple of different slices (virtual servers) in a few minutes, and install SQL on one, and litespeed on the other.

Only downside is that there’s a lot of manual work to get it all 100%, not only on the server side, but on the client side.

Setting up your Capistrano, and other local tasks take time.

If Slicehost dedicated a side of their business to rails deployments, providing Capistrano recipes, deploying servers with litespeed and rails etc pre-installed, you know, like 5-6 different deployment configurations to choose from to get up and running, that should cover the most of what people are after.

Right now most non linux technical people are stuck either learning how to do all these things in linux which is time consuming, and frustrating at times, or people are stuck paying large sums for overrated hosting.

Mediatemple charge like $20 for 64mb of memory, mosso charge $25 for 128mb of memory and engine yard are off the scale with $990 per month + $690 setup… Not to mention engine yard’s $125 per month for 1gb of backup space!

‘Grid’ hosting, load balancing and what not isn’t all that hard to do, and it’s not terribly expensive, I think engine yard are overcharging a bit, but that’s my opinion.

If I ever got into hosting, I’d do the same as slice host but dedicated to ‘LAMP’ deployments on virtual servers, setup a grid over at cari.net and use 3tera to manage the virtual servers.

4 servers for a rails application?

Saturday, March 15th, 2008

Well 3 + a local dedicated development server.

For some people it may be overkill, but I see it as good planning and future proofing.

I run more than 1 rails application too, actually deploying upwards of 20 total over the next 2 months, so I need a dedicated area to store repositories (SVN), and it’s defiantly good practice to separate out the sql server from the rails server.

And as far as cost goes, it’s not much. Slicehost offer slices from as low as $20. So if you’re only getting started you’re looking at $40 for 2 virtual servers, each dedicated and saleable up when you need it.

I know a lot of people like to run rails apps in a shared environment, but if you do you’re stuck compromising on the speed of your app, stuck using low performance webservers like apache or lightty.

It’s well worth the money to run a couple of slicehost servers, and they are all yours, run as many apps on them as you want.

A few ruby on rails deployments starting this week

Friday, March 14th, 2008

I’m deploying a few new rails projects this week. The biggest issue I have with rails projects is the work that goes into setting up local SVN, Capistrano, an SVN server, application server, web server and a database server.

On top of all that you need to setup Capistrano to deploy to them all, and run some testing etc.

Overall it’s a 2-3 day process. But with the help of litespeed, it’s come down; litespeed has cut a good 6hrs out of it all in my opinion. Realistically it takes a lot of time to do it right, and to test it.

Not to mention the long term advantage of running litespeed, - load balancing, scaling and memory management.

Sure if you really wanted to you can get up and running in under an hour.

But to produce a solid development, staging and production environment with the right setup and infrastructure to last more than a month, it takes time.

I think I’ve put together a nice process to handle it all, I’m going to spend the next few days going through the whole process again from scratch, and I’ll be documenting it, so I’ll probably post it.

The setup I use server wise is:

  • 1x Local development server (Ubuntu 7)
  • 1x hosting account for SVN (I use a media temple grid service account)
  • 1x 512mb slice from slice host (dedicated virtual server, saleable up or down at anytime) for the rails application(s)
  • 1x 256mb slice from slice host (again, dedicated virtual server saleable at any time) for mysql and phpmyadmin.

The slice server virtual servers are also Ubuntu 7.

And as far as software goes, I’m using the normal subversion, ruby 1.8, and what not.

My main difference, and the main difference with everyone when it comes to ruby apps is webservers, I’m using litespeed.

I’m amazed why more people don’t use it.

Go and read about it. I’ll post more about it later. It really kicks the crap out of apache, and nginx.

It runs php 50% faster than apache. And it runs ruby on rails super fast too, and with less memory used. Far less.

Todays Next Mission: Installing LiteSpeed for Ruby on Rails on SliceHost

Sunday, March 2nd, 2008

Ok so I’ve decided to use LiteSpeed as my web server over apache, lighttpd and nginx.

Why? Even tho most rails developers are moving towards using nginx and a mongrel cluster or something similar, I like what litespeed are doing, and the foundation behind it.

Unlike the other systems, there’s a company behind them that you can call on for support – it’s a commercial product, so bugfixes will be regular and of urgency and things will keep evolving.

Nginx is mostly in Russian still and lighttpd doesn’t have much power.

Early on in my research I cut lighttpd out as an option totally, it’s really slow and just not what I want.

Other considerations were memory usage, not only of the webserver, but of the mongrel processes.

Mongrel can use a fair bit, so for us, hosting 20+ rails dependant sites and having all those extra mongrel processes staying alive without them being used is a big memory load, this is where I start to like litespeed a lot over the rest.

You see with Litespeed, it controls the mongrels direct with an api that’s a ruby gem, it will load the mongrels automatically when they are needed and shut them down when they aren’t, which is also good if your app has issues or memory leaks because it’ll start fresh again soon enough.

Also, having mongrel tied in to litespeed, there’s one less layer to stumble through, with lighttpd, apache or nginx there’s 3 ‘layers’… the web server, the mongrel and then your app. With litespeed, it’s just it and your app.

Next major win is that litespeed has a really good web interface for controlling it all, the virtual host for your site, the integration, the mongrel processes, the whole web server and all. So no more digging through config files on linux and hours of shell usage to get things going, you just use the slick web interface, which also displays real-time stats and logging.

Even though litespeed is commercial, they have a free version available that will handle most people’s needs, if you have a very high bandwidth site then you’re probably making cash so if you need a license to handle more than the free 150 simultaneous connections it’s only about $30 a month to handle 300 or more I think.

Anyway, there’s been a good debate on ruby forum about it all not too long ago…

http://www.ruby-forum.com/topic/137579

Aside from all that, installing litespeed is super easy, slice host have a 3 step manual on their wiki.

http://wiki.slicehost.com/doku.php?id=install_litespeed_on_ubuntu

After those easy steps are done you need to setup your rails app in the webserver – so you’ll need to create a virtual host, similar to apache but also with linking in the mongrel functionality.

Also, don’t forget that you need to setup your dns in the SliceHost control panel too.

To setup your virtual hosts, best bet is to follow this manual

http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:ruby_rails

Anyway, I did all this already on our local box, I’m doing it now on slicehost, will post about any differences to the manual if I have problems.

Todays Mission: Installing RoR, MySQL and LiteSpeed on SliceHost

Saturday, March 1st, 2008

Ok so I’ve moved hosts for some of our projects and sites.

This is a pretty big thing, at the moment we have a dedicated server with LayeredTech, a VPS with MediaTemple and 2 GridService accounts with MediaTemple.

It’s getting a little messy, so I’m consolidating everything to a MediaTemple VPS and a Slicehost (my new account) 1024 slice.

Forgetting the rest of the move for a bit, and the reasons behind it, let’s talk about slicehost.

I’m 1 day into my hosting experience with them at the moment, and so far I’m learning a lot, and wondering if this was the right choice.

I’m familiar with Linux to a good extent, I’d rate myself a 6/10, I’m no guru but I can do everything we need without any dramas.

The thing with slicehost is that there’s no web control panel as such, there’s no cpanel, or plesk, no way to add domains to an account, no simple web hosting. You have to know what you’re doing and you really have to have a good grasp of Linux before you even think of hosting with them because most of your time will be spent in shell.

Somewhat like MediaTemple where you have a control panel, you can manage your slices and general bits from a web interface, you also have DNS control, but that’s it. No email or anything. It’s very ‘heavy’ on the manual labour side of things, as far as reading and typing to get things setup, not your typical institutive user interface with 3 clicks to get a site up and working.

So all that scary part aside, there’s lots of documentation around for slicehost, so it’s not too bad.

Also, after purchasing my slice it was operational in less than 2 minutes.

At the moment I’ve just installed Ruby, Rails and MySQL, so far so good.

To get this far I’ve used the slicehost wiki on how to gets started with your new Ubuntu slice…

http://wiki.slicehost.com/doku.php?id=get_started_with_your_new_ubuntu_slice

I picked Ubuntu mostly because we run Ubuntu servers for development internally, but it’s also very well supported by Slicehost.

The Ubuntu wiki is pretty big for slicehost, check it out here http://wiki.slicehost.com/doku.php#ubuntu

Next on my list is to get LiteSpeed installed.