uk2

Multiple IP addresses on Debian

Quick post. If you have multiple IP addresses (i.e. a range) assigned to you server, and you want to listen on all of them (i.e. multiple SSL sites), then rather than using the ancient eth0:1 syntax, you can hack /etc/network/interfaces to use iproute2 properly.

Assuming the IP 10.2.3.4, with the extra range of 10.5.4.110-10.5.4.118 (yes these extra ranges often ignore class-boundries):

auto eth0
iface eth0 inet static
    address 10.2.3.4
    netmask 255.255.255.0
    network 10.2.3.0
    broadcast 10.2.3.255
    gateway 10.2.3.1
    # Extra IPs:
    post-up for last in `seq 110 118`; do ip addr add 10.5.4.$last/32 dev $IFACE; done || true
    pre-down for ip in `ip addr show dev $IFACE | sed -n ‘s@.* inet \([0-9.]*/32\) .*@\1@ p’`; do ip addr del $ip dev $IFACE; done || true

Yes, it’s ugly as shit, but I can’t think of a neater way to do it.

Update: Better solution

Horrific performance with 3ware RAID

I’ve been enjoying our server at UK2.net. It’s a pretty speedy machine (although a little light on RAM - I suspect that they don’t want people running Xen), and it’s connected to a fat pipe. But I’ve been experiencing a lot of bad lockups.

I traced the problem to postmaping the uceprotect.net RBL file. They recommend that you rsync this file from them, and then postmap it into a fast lookup database for postfix, rather than using their DNSRBL service. But running the postmap was taking my box 40 mins. The same operation, on a loaded, lower-spec, 2 year old server took 2 mins (yes this server also has RAID1 on the volume concerned). On my UK2 box, while the postmap was running, the machine became totally unresponsive, and it could take a minute or two to log in, serve a web page, or even execute a basic command like ps.

Clearly something wasn’t right. And it was something in the IO system. The only answer is the 3ware RAID controller. (It’s a 8006-2, doing RAID-1) I know these controllers have a big buffer, so I looked up the 3ware website, for tuning guidance. I followed it to the letter, and things didn’t really improve. I tried the deadline scheduler, and tweaking the buffers, but it only got marginally better.

Personally, I’ve always used software RAID, even for RAID-5, and I’ve never had bad performance like that. And having the RAID in a portable format has really helped with recovery in the past. I understand that Windows monkeys have to use hardware RAID (because their software RAID sucks so much), but is this kind of performance normal?

I’ve asked UK2 to chuck my controller and give me software RAID :-)

Update

I’ve now got software RAID 1, and postmap runs in 25 seconds. That’s what I call a 60x speed improvement :-)

Oh, and the system is totally responsive while the postmap runs.

Cross compile kernel

I decided I wanted a 64bit kernel for my UK2 server (seeing as it’s an Athlon X2, and I wanted an ubuntu amd64 chroot to work on it).

After a little playing around, this is how you do it:

  • Get your kernel
  • Extract it
  • make menuconfig ARCH=x86_64
  • Create some linux-amd64-gcc, linux-amd64-ld, etc. wrappers. Some need -m64 options. Others autodetect what’s required. (I made a tarball of my wrappers, but they’ve been lost.)
  • CONCURRENCY_LEVEL=4 make-kpkg --append-to-version '-londonpride' --revision '1.00' --rootcmd fakeroot --arch amd64 kernel_image
  • Extract the control.tar.gz from the deb, edit control file, and change the architecture to i386.
  • Install

Unfortunaly, in the week after this, my machine died of disk corruption. This is the 2nd time it’s happened. I hope UK2 don’t use dodgy hardware…

Playing with a uk2.net server

I’m having fun with a uk2.net dedicated server.

A video-hosting site that I admin is currently hosted on a colo box with some very expensive bandwith. While the burstable bandwidth we can get on it is amazing, it’s staggeringly expensive, and we have a small quota. Thus we can’t sustain too much traffic.

For poorer customers, I want to look at some cheaper bandwidth… UK2.net are having a special where you can try a dedicated box for £0.99 for it’s first month. With 2TiB of traffic / month (2 orders of magnitude more than the co-lo box) it is more than up to the job, and upgrading to an un-metered 10M link is cheap.

So, I’m trying out the mid-range option. I get a GiB of RAM, 80GB HDD, and more bandwidth than I know what to do with. A bittorent :-) test shows that it’s reasonably well connected.

Now to set up a demo website and see how it compares to our current uber-expensive box.

Syndicate content