Server upgrade (by )

I host a heap of web sites (including this blog), email domains, source control repositories, mailing lists, and various other things (such as one of the official Chicken Scheme egg mirrors, a Jabber server, and an IRC server with bots). I do this with a combination of dedicated server hardware which I hire space, power, and connectivity for in London for the primary stuff, and a virtual private server in California for backup services and rapid DNS lookups from the USA.

This is a costly hobby, but it gives us a platform upon which to do interesting things, and lets me help other people out with free hosting; as I need to put in the time and money to run the infrastructure anyway, the spare capacity on it is essentially free.

The most demanding part is server upgrades. Periodically, I buy a new physical server, install it with all the software it will need, put it alongside the current hardware in the data centre, and transfer the data and settings across and configure everything that needs configuring on the new server until it works just like the old, then switch them over. I do this when the current hardware is getting full or overloaded or unreliable or just plain out of date, as I don't trust in-place updates of the core system software - it's too easy to end up with NOTHING working.

However, this has been overdue for several years. I bought the new hardware (this time, with a contribution from my biggest user of disk space!) nearly two years ago, and installed it in the rack nearly a year ago, but only yesterday did I get the chance to spend a day sitting next to it in London coaxing it into readiness then doing the final switch over...

It didn't go entirely to plan, of course. I'd previously written a script that used rsync to copy all the user data over; the first time I ran it it copied everything, then subsequent runs only had to copy the differences. The idea was that I would have less down time while I copied the data from the old server to the new (which has to happen with both servers offline, so that nothing can change during the copying process) if there was only the final changes to copy. However, I realised that the accounts of my biggest user of disk space weren't covered by my script as they had been slightly hacked to accomodate their growth.

And the whole process of moving the software configuration was made more complex by the fact that I had previously been running two servers in a kind of symbiotic cluster, in order to meet the load with the hardware of the time. Nowadays 64-bit multi-core behemoths with gigabytes of RAM are cheaply available and well supported by NetBSD, so everything can be done on one box. This is a much simpler setup, but it means that I had to undo the complexity of the previous setup when transferring everything across!

I ran into a few other unexpected problems, too; I noticed that the clock on the new server was terribly wrong, despite it running NTP. I did a manual ntpdate, and then just in case, another to check that it was now only a few millisecond out - but it was already half a second out again! It quickly became apparent that the clock was ticking about one second in every two seconds of real time...

Looking in the output of sysctl -a, it became apparent that I had a choice of time counter sources: it was using the TSC, but I also had an HPET, a clock interrupt, an APIC clock, and the good old 8254; my machine was brimming with alternate clocks. I tried switching to the HPET with sysctl -w kern.timecounter.hardware=hpet0 and suddenly time was running as expected. I popped that in /etc/sysctl.conf so it would come back on reboots, resynched the clocks, and everything's been fine since. I can only presume that the kernel was reading the CPU clock speed wrong, or some kind of dynamic clock scaling is happening, so that the (CPU-based) TSC wasn't having its ticks converted to seconds properly.

I had a big setback with the email setup, as NetBSD comes with Postfix as part of the base system but I wanted a more recent version from packages, but I ended up getting tangled with what version was being run in various situations and what configuration file was being used, which took a while to sort out. And then of course there's Mailman, the mailing list server software, which is complicated by needing write access to its filesystem-based state when run from the mail system (for incoming mail) or the Web server (for the web interface), so uses lots of setgid binaries and group-writable files and the like, and so always takes a lot of fiddling to get working properly.

But... I did it. And so, having completed my tax returns earlier this year (which is what freed up the time to prepare for and do this mission), I have now gotten rid of all the major obligations that have been hanging over me for the past few years.

I still need to visit London again - I've left the old servers running alongside the new in case I missed any files that need to be transferred; I'll give people a chance to check I've not missed any of their stuff before remotely powering them down (to save electricity, which I pay for) and coming in to take them (to free up the space). But that's relatively easy!

British Gas (by )

Ok, I'm starting to get annoyed with British Gas, so it's time for a RANT.

When we moved into the new home, it had prepayment meters for gas and electricity. For those not familiar, these are meters where, rather than having your meters read and being billed on what you have used, you have to take a smartcard to a shop and pay to get it "charged" with credit, which you then take home and insert into the meter. The meter keeps a credit balance, which it subtracts from as you use energy, and when it hits zero, you get switched off until you put more in.

This is annoying, as you have to keep remembering to top it up, and it's also more expensive; you get charged more per unit of energy used for the privilege of all that extra infrastructure. It's usually an arrangement one enters into if one is having trouble paying the energy bills, as it makes you unable to use more than you can afford. In which case, you can get put onto prepayment meters, at an even more inflated rate, in order to pay off the debt as well as buying your energy every time you top up.

So, we of course wanted OFF. To do this we first need to take over the gas and electricity supply from the previous folks, then when the account's in our name, we can get it transferred. The gas and electricity accounts are both run by British Gas, who helpfully send a letter to "The Homeowner" at the address telling us to get in touch with them as soon as possible so we can take over the account, as the previous folks had told them they'd moved out; in particular, it warned us that the previous owner's smartcards may be configured to repay debts, so we'd need our own ones to be charged a more reasonable rate.

So we sign up with them, as advised, and are told it'll take about twenty-eight days for "the paperwork" to happen, and then we'll get our new gas and electricity smartcards shortly after that.

So we plod on, using the previous owner's smartcards which, I note, are particularly expensive for gas at least; we're putting in £20 top-ups of gas at least once a week, and often twice.

Then we get a letter asking us to ring them to confirm some details, which I do, and am thanked for the details, and told the account take-over can now REALLY start, and will probably be finished around the end of February, and we should be able to get our meters swapped over to normal ones after that.

Well, it's now March, and I've rung up to ask about that, only to find out that only the electricity is in our name; the gas is still in the previous people's name. Apparently "an error" was made originally. Anyway, apparently that's being cleared up, and they're trying to get me set up for a credit meter, and I was on hold for ages, and got cut off, so rang up again, and was on hold for ages, then was told it was taking a while so they'd ring me back...

That was a few hours ago. I'm still waiting. And we're still running on the previous owner's smartcards, paying inflated rates. It'll have been two months soon.

WHY does this have to be so SLOW? Why can't they just put the account into our name immediately, when we ring up? Why does it need to take 28 days at all, let alone take the month and a half it's been so far?

While we've been waiting for the gas and electricity to be fully transferred, British Telecom have managed to lay an entire NEW PHONE LINE to our house, complete with digging trenches and everything, and Andrews and Arnold (AAISP) set up broadband on it. Both actions requiring ACTUAL WORK to happen rather than just changing some entries in a database and posting us some smartcards. AAISP's contribution to this alone is probably similar to what British Gas had to do; adding us to their accounts database and contracting BT to put an ADSL linecard in at the exchange, then posting us a configured router, and it took them one week, most of which was waiting for BT to do their bit...

A week off (by )

I took last week off of work, to recuperate from the house moving and to spend some time setting up my workshop. That sounds like more house moving, but it's without deadlines, and it's taking time to sort out my own space the way I like it. So it's relaxing and settling! I did a few other things, too. I chose the Half Term week for my holiday, as no work AND no school runs would mean I didn't need to get up in the mornings, and so I could spend more time with our children. Sarah's teenaged (well, 12 and 14) cousins visited for half term, too, and were eager to help out with interesting DIY projects!

  • We laid concrete in the fireplace, to bring the base level with the rest of the floor so we can tile it to make a nice hearth. We mixed the concrete by hand, and leveled and tamped it into the space, then checked back on it over the next few days until it was hard.

  • We laid mortar along a messy and dirt-accumulating crevice in the workshop floor, to level it. This was fairly similar to the laying of concrete, except using sand rather than all-in ballast as the aggregrate.

  • Painted most of the workshop floor with the special concrete floor paint I bought from the excellent and helpful Bailey Paints. We can't paint over the bit we laid mortar on until it's cured sufficiently, which will take a few months, so that bit can wait.

  • Constructed and arranged the furniture in the workshop. Shelving had to be assembled, and my famous double-deck electronics desk put back together!

  • Mounted my tool board on the workshop wall. It's happy in its new home.

  • Mounted and wired in the Caffreys sign. Years and years ago Sarah and I, with my friend Matthew, witnessed a pub being redecorated, and the illuminated Caffreys sign was being chucked into a skip. We asked if we could take it, and it's followed us ever since then, being used as a rather unweildy novelty lamp; now we have a place we can mount it properly to the wall, so it's mounted on the outside of my workshop, with the cable run properly through the wall so it can be plugged in inside.

  • Mounted and wired in the router, power strip, switch and UPS. We have a nice new cupboard under the stairs, built for us by Sarah's brother David. I've mounted the "core network" devices directly to the inside wall of the cupboard, and will mount one of my patch panels there when I run CAT5 to sockets around the house (and a trunk to the workshop, where my second patch panel will be installed in the comms cabinet - when it's bolted to the wall; we bought the bolts for that, but didn't get around to it).

  • Gone climbing (with Jean and Sarah's cousins) at The Warehouse in Gloucester, which has excellent facilities for children and young folks. Everyone had a good time.

  • Worked more on my scripts to migrate the massive amount of data from my current hosting setup, love.warhead.org.uk, to the new hardware. Love currently runs on a pair of servers, fear and infatuation, whose responsibilities will be taken over by one, just called love. This will be a simpler and more reliable setup, which will be easier to migrate in future, and will (touch wood) crash less. Oh, and it gives us much more disk space.

The love migration scripts were about the only stuff I did with computers all week. I'd have liked to have done more (I have some Ugarit, R7RS, and Chicken Scheme TODOs), but the presence of teenagers who would get bored if they didn't have exciting DIY tasks to do meant I focussed on things I could do with them. This isn't a problem, as in only one week I couldn't do ALL my projects; even focussing on DIY, we didn't get it all done 🙂

However, I think I need to take time off to relax like this more often. Mainly because, despite not needing to be up in the morning, I kept waking up at around 6am and not being able to get back to sleep. And once I woke up from a nightmare that I was neglecting all my responsibilities and everyone who depended upon me was being let down. These are not healthy signs...

Computer Science (by )

Is a Computer Science degree useful for people who want to have a career in software development? Many who work in the field come from physics, maths, or electrical engineering degrees, and do perfectly well. There's a widespread feeling that the concepts taught on computer science degrees, such as formal logic, proving the correctness of algorithms, functional programming, compiler theory, and so on are, at best, only vaguely useful in "real-world" software engineering, There's a sort of warm fuzzy feeling that knowing these things makes you a Better Programmer, even if you never use the knowledge directly, because you're more aware of the underpinnings of the tools you use. But I don't think anyone has ever shown a real benefit. With the obvious exception of people who go into niches such as compiler development, or writing tools for mathematicians...

Software development, in practice, is mainly engineering; often just following simple plans in obvious ways, like bricklaying. It takes skill to do it neatly and well, but not imagination or theoretical background. Familiarity with tools such as off-the-shelf libraries and standard system interfaces like POSIX are probably more useful than Prolog programming to most programmers. Debugging is, in practice, more valuable as a skill than using natural deduction to prove the correctness of algorithms.

But that's not to say that computer science is useless. Many modules in my computer science degree were engineering based, looking at practical topics such as building reliable distributed systems, dealing with concurrent access to resources, databases, networks, and operating systems. Those courses covered how things like TCP stacks are built, but that's necessary information to properly use them; information required by anyone who has to do a good job of writing network software. And the theoretical modules, on semantics, functional programming, logic, Prolog, and formal methods were useful to me as a special case of somebody interested in building new programming languages; a small minority of us nerds-among-nerds bury our heads in topics like continuation-based models of concurrency, and then emerge at the end with practical tools such as programming languages, threading libraries and distributed agreement protocols that the rest of the nerds can use to build applications with.

However, an electrical engineer will be taught programming, aimed at writing embedded software. It will be approached as an engineering activity, goal-oriented and pragmatic, emphasising requirements capture and verification of the result, and debugging. Issues such as working with the constraints of the hardware will be covered. It's no surprise that electrical engineers are widespread and successful in the software industry. But the electrical engineers who make it in software have had to do a lot of learning in their own time, and as such, it's harder to select them; they need to be individually interviewed in depth, rather than being rolled off the University assembly line pre-tested to a known standard.

So perhaps computer science degrees need to diversify further. Mathematics is often split into Applied and Theoretical sects; the distinction is sometimes arbitrary, with most topics straddling the divide in some way, but they are taught with different emphases. Theoretical mathematicians are better trained to go into mathematical research in academia or the more abstract R&D teams, while applied mathematicians are primed to dive into practical problems in statistics, simulation and optimisation. Perhaps we need something similar in computer science; I know that most degrees are modular, and mine let one end up with a degree title reflecting the specialisations one took, but I'm not talking about modules - I'm talking about a fundamental shift in emphasis in the degree, from day one. Everyone should start off with a year of practical software engineering, because even the most abstract theoretician needs to know how their work will be applied (and have the skills to build implementations of their theories, so they can be tested and then applied by others). Teach enough about compilers and computer architecture to give the student a head-start in optimising their code, without going into the detail required to build compilers or design CPUs. Give a nod to formal methods in showing how to design correct algorithms by informally argument.

Then in the second year and beyond, let it be down to modules; the software engineers can go into things like networking, databases, graphics, operating systems, high performance computing, distributed systems, and so on, depending on their desired specialisation. The theoreticians can go into abstract topics. And by all means, at the end, give them a Software Engineering degree if they did mainly software engineering modules, Computer Science if they did mainly theoretical modules, and something like "Applied Computer Science" if they did a mixture. Don't restrict student's choices, unless modules have an actual dependency on the knowledge from previous modules; but at the same time, give them guidance by explaining which modules will help them for different career paths. And don't force software engineers to spend their time learning abstract stuff they'll resent, in the vague hope that it will make them better programmers; it's no more useful than the electrical engineers working in software who had to sit through courses on filter design!

Tax returns (by )

Many years ago, around 2000, I formed a limited company. A bunch of us wanted to rent a rack in a data centre and host our servers there, and it seemed wise to have a separate legal entity to sign the contract with the ISP for the rack.

This cost me some money here and there in fees, and I had to take the time to keep books and file annual reports and accounts, but it was bearable.

Then a few years later, I became a freelance software engineer, and as the company already existed, it made sense to operate through that. Making a profit rather than being propped up by cash loans from me meant the company's tax returns became more complex, so I paid an accountant to do those, and that was fine as the saved money in using the company paid for his fees.

So all was fine until 2007, when a flood destroyed our home (and my placed of work).

I had to keep working to support my family, so I went to London to borrow space to work and sleep in, and did what I could to keep cash flowing. But this meant I wasn't spending much time at home where my paperwork was, and had little time to deal with book keeping, and my post was arriving into a building site back home.

A year later we were able to move back in, to try and pick up the pieces. But life was harder than it had been, and Sarah was sicker, and it's taken me until 2012 to catch up.

But last week I submitted my last personal tax returns. Towards the end of last year, my last corporation tax returns. Earlier that year, my last VAT returns. And the good news is, I seem to be eligible for some tax back. I'm happy about that as a friend leant me a thousand pounds in 2007, and I've still yet to pay him back; my tax repayment will cover that, plus some interest and a little left over... I'll pop it into the savings account and wait a few months in case HMRC change their mind, however.

But having all this done is a huge weight off my mind, one that had hung over me for about for years. Right now I seem to be in a phase of shedding burdens and finishing things; the only big thing I have left hanging over me now is migrating my servers, then I can start relaxing a bit and get on with my projects for the year!

WordPress Themes

Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales