Goodbye vps.net – hello Linode

After seeing yet another failure from the vps.net camp, this being FAR worse than anything I’ve seen before, I decided to jump ship.

What was this failure?  well…

It has to do with the licensing, the licenses stopped pinging, which made replication stop, which caused some services to stop, they then logged in and rebooted it, and thought it was back up, but upon mounting VMs, it came to the point where it was clear that there was corruption. We then were able to restore all the logical volumes, but even then, the VMs wouldn’t boot..that brings us to where we’re at now

From my point of view, my server died, wouldn’t come up and after 24 hours it still wasn’t available.  There seems to be a high chance there is a missing data….that’s to be checked later.

All very far from re-assuring.

So, over to Linode. Similar pricing for the basic stuff.

  • The initial setup was very much the same on both providers, under 5 minutes and a new machine was ready to go.
  • Installing the software I need, pretty quick – then again I’ve done it several times now.
  • Restore backups from my Amazon AWS. It costs less than £3 per month to run what I require.
  • Less than 4 hours after setting up the nodes I am back live with only emails delayed.

I must admit, I’m pretty impressed with the flexibility of the control panel for Linode. In addition to what vps.net offers, Linode has;

  • A job queue
  • Root password reset
  • Rescue mode
  • Kernel switch
  • Custom disk sizing
  • Custom drive mounting
  • Alerts  on CPU usage, Disk IO, Traffic and Transfer Quota
  • Auto-reboots – this has not yet been a problem anyway
  • Additional RAM/Storage/Data Transfer all separately configurable

There may well be more as well. This is under 24 hours of signup which included sleep, work & setting up servers so much tinkering is still to be done.

My sites also seem more responsive as well, faster disks maybe?

Standalone DNS server – Almost there

A while ago I mentioned a Standalone DNS server.  Stuff got in the way and it got set back.

Well, its almost done.  Just needs some final testing, a quick import of the current records and we’re set to go.

C# Snippets

I am not a fan of C# really, however after being forced to use it for 1/2 of my life for the past 6 months or so, I feel have a pretty good grasp of some of the language.

There are a few snippets I have written which are possibly useful for some people;

  • Zooming, Panning, Rotating images
  • Custom alert boxes
  • Threading / Background tasks
  • Image resizing
  • Zip file open/closing
  • Dynamic form population
  • Simple XML parsing – I use this to convert between county names & country codes
  • Custom ini handler – I havn’t done this yet, but its VERY likely.
  • Dynamic DLL includes – This is currently being used to allow custom forms within my application

I might not get a chance to do all of those, but I hope to.  I’ll also link to them when they are done so feel free to bookmark this page.

There may also be some “things you may not have known” section appearing.  It is surprising what you come across when you’ve spent time in other languages for a while.

Update 16/08/10 – I was hoping to have put some of this online by now, however I am off on holiday in 2 days and have been putting together FAQ’s for my colleagues & finishing off as much as I can so that I don’t get a call while I’m away.  I’ll be posting this stuff at the beginning of September instead.

PostgreSQL, how about you don’t make migrating from MySQL more complicated?

I am currently working on building a new site which is migrating from an existing one.  Front-end work mostly complete, now to creating the admin.

The Problem

Today, a really quite annoying “feature” of PostgreSQL raises its head and takes up far too much time to resolve.  For some background, the data is from an old site built in PHP & MySQL, being migrated to Django & PostgreSQL. This has been working fine, the frontend works and that’s great.

To maintain the old database id’s we inserted everything en-mass into the new database. This in itself was not the problem.  The problem arose when starting to adding new row and are expected auto-increment to the end.

Just a simple query, nothing overly complicated here.

INSERT INTO table (title) VALUES ('my_title');

However, instead of actually inserting into a new row at the end, it started working from id 1. This throws up errors whenever the id already existed (this differs from MySQL). Worse still, on some occasions started to delete items from the end of the database.

The Solution

So, what’s going on? I was initially expecting it to be a problem with my code although but, after plenty of testing, that wasn’t the case.

The primary key wasn’t updating the auto-increment value as expected. Here was the simple fix (change field names where necessary). This will reset the internal counter to the next available number.

SELECT setval('"table_id_seq"', coalesce(max("id"), 1), max("id") IS NOT null) FROM "table";

If you are using Django  you can generate the SQL by running, it does not run the automatically but you can pipe the response directly into the psql tool.

python manage.py sqlsequencereset appname

Very simple, but this does not follow the MySQL (less control over increments and automatically finding the next available number). Then again SQLite also does things differently and no doubt others as well.

It really pays to be aware of some of the fundamental, often unexpected, differences between databases and frameworks. Embrace change, don’t fear it. Do your research, is it better?, does it make for a logical change? But, don’t embrace unnecessarily.

Argh….The Cloud

Cloud/VPS hosting is great, except when its not.  The idea is, you have dedicated hardware to take over if something fails and on smaller installations, is quite a bit cheaper.

I have been using it for a over 12 months and for the most part its been fine. There have been a few occasions where there has been a bit of downtime, but it was early days…..except today there has been some quite serious downtime.

A power outage takes down a large chunk of machines, both primary and backup machines.  Not much of a problem I hear you say…WRONG.

A conventional server

If a power outage takes out a datacenter, once its back remote start, manually pressing up to 42 buttons per rack boots servers, or servers that just reboot when power is back (this will be most I’d guess), a couple of minutes later everyone’s server us running with minimal issue.

The Cloud

When a VPS cloud is affected the process is very different.  The main servers are booted, the disk servers are booted at which point not a single “client” server has started.  Now we go through the large queue of servers starting them, good luck if your at the end, up to 4 hours it seems to recover from this one.

Is the Cloud worth it?

This is a difficult question to answer.  The cloud can handle multiple failures at the same time (or at least its meant to) however due to the many number of components, the chance of something failing is far greater.  Having your own machine, if your down due to a hardware fault…that’s it..your down.

I still like the Cloud scenario, almost instant deployment of new servers & more CPU than you are often going to get in a standalone box.  It really does depend on what your system requirements are.  I’m hosting a game server in the cloud.  It would cost me the same, if not more, to just get a game server from a game server provider – without the flexibility I have now, but a lot more to host 1 game server on the cheapest dedicated server you could fine.

Dansette