Migrating the Science Media Centre

November 12th, 2013 by

Over the past week or so we’ve given the Science Media Centre a hand in moving their WordPress site into a virtual machine hosted by Mythic Beasts. They’re a charity who work with journalists, scientists and engineers to try and improve the quality of science reporting and removing the misleading rubbish that otherwise gets written. Mythic Beasts is a company founded by science graduates who are very easily angered by terrible science articles in the papers. We’re hoping the saving on destroyed laptops and monitors will easily cover all the management and consultancy services we’ve donated.

If we have fewer idiotic articles proving that Coffee cures cancer* and Coffee causes cancer* and rather more articles that our talented university friends pioneer new cancer treatments we’ll consider the time and effort we’ve put in to helping them well spent.


* Actual links removed in the name of good taste. Here’s something more interesting to read, and if you’re still curious, you can look up coffee in the index.

Rocket Science

November 5th, 2013 by

Today is Guy Fawkes Night, when traditionally in the UK we launch fireworks to commemorate not blowing up King James I, the House of Lords and a large chunk of central London. Most modern firework displays use rather less gunpowder than the original plot in 1605.

At Mythic Beasts we think with the advent of four hundred years additional technology we should be aiming a bit higher. That’s why instead of buying fireworks we’ve donated some hosting to Southampton University Spaceflight. Certainly I (Pete) was incredibly inspired as a child by space flight and I remember watching the first untethered spacewalk as a child which motivated me strongly to learn all about rockets and space ships and from there to reverse engineer 8 bit computer games ultimately leading to running a hosting company.

This is of course the second university space program we’re helping out with – some of the tracking for Cambridge University Spaceflight is also done on servers hosted with us.

@Mythic_Beasts now on Twitter

November 2nd, 2013 by

If you want to hear what we’ve got to say, but can only cope with 140 characters at a time then you can now follow us on Twitter.

We may use Twitter to give updates on service status when we’ve got problems, but the official source for such information remains our status page.

I do not accept your silly software license

September 9th, 2013 by

So our newest Mythic Beast started working for us today. The first task is to start installing your new laptop and reading and signing employment contracts. Today we had our newest employee fail at the first hurdle.

The laptop in question is a shiny Toshiba z930. This one came with Windows 8 and a fully charged battery. On first powering it on it comes up with the Windows 8 licence. This has a tickbox option for ‘I accept the license’ and a big button labelled ‘Accept’ to click on.

If you don’t tick the box, it tells you you have to. There’s no option to reject the license.

If you press the power button the laptop suspends itself. If you press and hold the power button the laptop still suspends itself. Ctrl-Alt-Delete doesn’t work. You can’t remove the battery as it’s built in. In frustration our newest employee suggested pouring his coffee over the damn thing to make it power cycle. This was a really stupid idea, not only does the laptop have a spill proof keyboard he’d also then have no coffee.

The best plan we could come up with was to wait for the batteries to run out which requires pressing a key about every five minutes to stop the thing suspending itself.

Power efficiency

July 31st, 2013 by

We’ve just done a performance comparison of one of our little dedicated servers versus a dual core VM hosted on VMware through another provider.

The VMware machine has two cores of an Intel Xeon E5530 (Westmere) at 2.4Ghz, we have four hyperthreaded cores of an i7-3615QM (Ivy Bridge) at 2.3Ghz.

Both machines are running the same operating system install, same application code so we ran siege for 30s at a time with different concurrency levels as a benchmark to find out if our machine was faster and by how much.

The initial comparison was the dual core VMware service (green), versus our VM (red). At very low concurrency (1-2 simultaneous requests) our machine is slightly slower to render each page. Beyond this the existing machine has exactly the predicted load curve in that it slows linearly with additional simultaneous users – the new machine appears to slow only very slightly with minimal performance degradation.

By default we’re running the ondemand cpu scheduler which means when idle the cores are clocked at 1.2Ghz. The page render time remains almost constant to four cores as the host spreads the load around the four 1.2ghz cores keeping the render time constant. Beyond this the scheduler starts to turn up the core speed as the load rises, so at 8 cores we’re still rendering pages in the same average time because each core is now clocked at 2.3Ghz almost twice as fast – we’ve doubled the amount of CPU available. Only then does the performance begin to drop off and then sub-linearly.

On the existing host the performance is much more predictable – it takes a constant amount of CPU to render each page request and as you double the concurrency the render time doubles.

If you turn off the power-saving on the i7 and set it to performance mode it gives the expected linear performance decrease with increasing load. Interestingly it’s slightly slower at maximum CPU utilisation, I think (but haven’t confirmed) this is because it can’t use the turbo boost feature to increase the clock-speed as much as the power-saving option because it’s always running at a warmer temperature as it doesn’t cool down as much between each benchmark run.

We’re going to leave the machine in ondemand mode, whilst it’s slightly slower in normal use, it uses less electricity so it cheaper to run and less harmful to the polar bears, it also has significantly better performance for short peaks – it has a stockpile of cold that it can borrow against for short periods of time.

I wonder if they should start teaching thermodynamics in computer science courses.

Some more benchmarks

January 5th, 2013 by

CPU benchmarks

Here are some geekbench readings (32bit tryout version) for some of our servers and for comparison some Amazon EC2 images.

server Geekbench
Dual Hex Core 2Ghz Sandybridge (debian) (E5-2630L) 18265
Hex Core 2Ghz Sandybridge (debian) (E5-2630L) 11435
Quad Core 2.3Ghz Ivy Bridge (ubuntu) (i7-3615QM) 12105
Quad Core 2.0Ghz Sandy Bridge (debian) (i7-2635QM) 9135
Dual Core 2.3Ghz Sandy Bridge (debian) (i5-2415M) 6856
Dual Core 2.66Ghz Core 2 Duo (debian) (P8800) 3719
Dual Core 1.83Ghz Core 2 Duo (debian) (T5600) 2547
Toshiba z930 laptop (Ivy Bridge i7-3667U) 6873
Amazon EC2 t1.micro instance (ubuntu) (E5430 1 virtual core) 2550
Amazon EC2 c1.xlarge instance (ubuntu) (E5506 8 virtual cores) 7830
Amazon EC2 hi1.4xlarge instance (ubuntu) (E5620 16 virtual cores) 10849
Azure Small (1 core AMD Opteron(tm) Processor 4171 HE @ 2.09 GHz / 1.75GB) 2510
Azure Extra Large (8 core AMD Opteron(tm) Processor 4171 HE 2.09Ghz / 14GB) 7471
Elastic Hosts ‘2000Mhz’ single core VM (Opteron 6128) 2163
ElasticHosts ‘20000Mhz’ eight core VM (Opteron 6128) 6942
Linode 512MB VDS (L5520 4 virtual cores) 4469
Mythic Beasts 1GB VDS (L5630 1 virtual core) 2966
Mythic Beasts 64GB VDS (L5630 4 virtual cores) 4166

The method here is pretty simple. Take the default OS install, copy geekbench 32 bit tryout edition onto the machine. Run it and record the results.

It’s important to remember that geekbench performs a mixture of tests, some of which don’t parallelise. This means a server with a fast core will receive a higher score than one with lots of slower cores. As a result the sandybridge and ivybridge machines score very highly because the servers will increase the performance of a single core if the other cores are idle.

Disk benchmarks

We have several disk subsystems available. Single disk, dual disk mirrored software RAID, dual disk mirrored hardware RAID, 8 disk array hardware RAID and PCI-E SSD accelerator card.

Read only benchmarks

The benchmark here is carried out with iops, a small python script that does random reads.

4kb reads

IO Subsystem IOPS Data rate
Single SATA disk 60.5 242kB/sec
Mirrored SATA disk 149 597kB/sec
Hardware RAID 1 SATA disk 160.2 640kB/sec
Hardware RAID 10 SATA 6-disk 349 1.4MB/sec
Hardware RAID 10 4 disk Intel 520 SSD 21426 83.7MB/sec
Hardware RAID 0 6 disk SAS 15krpm 104 416kB/sec
Intel 910 SSD 28811 112MB/sec
Apple 256GB SATA SSD 21943 85.7MB/sec
Intel 710 300GB SSD RAID1 Hardware BBU 24714 96.5MB/sec
Amazon micro instance (EBS) 557 2.2MB/sec
Amazon c1.xlarge instance (local) 1746 6.8MB/sec
Amazon c1.xlarge instance xvda (local) 325 1.2MB/sec
Amazon m1.xlarge EBS optimised, 2000IOPS EBS 69 277kB/sec
Amazon hi.4xlarge software RAID on 2x1TB SSD 22674 88.6MB/sec
Azure small (sda) 73.3 293kB/sec
Azure small (sdb) 16010 62.5MB/sec
Azure Extra Large (sda) 86.4 345kB/sec
Azure Extra Large (sdb) 10136 39.6MB/sec
Elastic Hosts Disk storage 54.1 216.6kB/sec
Elastic Hosts SSD storage 437 1.7MB/sec
Mythic Beasts 1G VDS 65.3 261KB/sec
Linode 512MB VDS 475 1.9MB/sec

1MB reads

IO Subsystem IOPS Data rate
Single SATA disk n/a n/a
Mirrored SATA disk 48.7 48.7MB/sec
Hardware RAID 1 SATA disk 24.9 24.9MB/sec
Hardware RAID 10 SATA disk 23.2 23.2MB/sec
Intel 910 SSD 525 524MB/sec
Apple 256GB SATA SSD 477 477MB/sec
Intel 710 300GB SSD RAID1 Hardware BBU 215 215MB/sec
Hardware RAID 10 4 disk Intel 520 SSD 734 734MB/sec
Hardware RAID 0 6 disk SAS 15krpm 24 24MB/sec
Amazon micro instance (EBS) 71 71MB/sec
Amazon c1.xlarge instance xvdb (local) 335 335MB/sec
Amazon c1.xlarge instance xvda (local) 81.4 114MB/sec
Amazon m1.xlarge EBS optimised, 2000IOPS EBS 24 24MB/sec
Amazon hi.4xlarge software RAID on 2x1TB SSD 888 888MB/sec
Azure small (sda) n/a n/a
Azure small (sdb)
Azure Extra Large(sda) n/a n/a
Azure Extra Large(sdb) 1817 1.8GB/sec
Elastic Hosts Disk storage n/a n/a
Elastic Hosts SSD storage 49.6 49.6MB/sec
Mythic Beasts 1G VDS 44.7 44.7MB/sec
Linode 512MB VDS 28 28MB/sec

It’s worth noting that with 64MB reads the Intel 910 delivers 1.2GB/sec, the hi.4xlarge instance 1.1GB/sec (curiously the Amazon machine was quicker with 16MB blocks). At the smaller block sizes the machine appears to be bottlenecked on CPU rather than the PCI-E accelerator card. The RAID10 array had a stripe size of 256kB so the 1MB read requires a seek on every disk – hence performance similar to that of a single disk as the limitation is seek rather than transfer time. There’s a reasonable argument that a more sensible setup is RAID1 pairs and then LVM striping to have much larger stripe sizes than the controller natively supports.

We’re not sure why the SAS array benchmarks so slowly, it is an old machine (five years old) but is set up for performance not reliability.

Write only benchmarks

I went back to rate.c, a synchronous disk benchmarking tool we wrote when investigating and improving UML disk performance back in 2006. What I did was generate a 2G file, run random sized synchronous writes into it and then read out the performance for 4k and 1M block sizes. The reasoning for a 2GB file is that our Linode instance is a 32bit OS and rate.c does all the benchmarking into a single file limited to 2GB.

Write performance

IO Subsystem IOPS at 4k IOPS at 1M
Software RAID 1 84 31
Linode 512MB VM 39 25
Mythic Beasts 1G VM 116 119
Mythic Beasts 1G VM 331 91
Mythic Beasts 1G VM 425 134
2x2TB RAID1 pair with BBU 746 54
6x2TB RAID10 pair with BBU 995 99
400GB Intel 910 SSD 2148 379
256GB Apple SATA SSD 453 96
2x300GB Intel 710 SSD RAID1 pair with BBU 3933 194
Hardware RAID 10 with 4xIntel 520 SSD 3113 623
Hardware RAID 0 with 6x15krpm SAS 2924 264
Amazon EC2 micro, EBS 78 23
Amazon EC2 m1.xlarge, EBS 275 24
Amazon EC2 m1.xlarge, EBS provisioned with 600IOPS 577 35
Amazon EC2 m1.xlarge, instance storage 953 45
Amazon EC2 m1.xlarge, EBS optimised, EBS 246 27
Amazon EC2 m1.xlarge, EBS optimised, EBS with 2000IOPS 670 42
Amazon EC2 hi.4xlarge, software RAID on 2x1TB SSD 2935 494
Azure small (sda) 24.5 5.8
Azure small (sdb) 14 11
Azure Extra Large (sda) 34 6
Azure Extra Large (sdb) 6.1 5.1
Elastic Hosts disk storage 12.8 7.7
Elastic Hosts ssd storage 585 50

I think there’s a reasonable argument that this is reading high for small writes on the BBU controllers (including the VMs & Linode VM). It’s entirely possible that the controllers manage to cache the vast majority of writes in RAM and the performance wouldn’t be sustained in the longer term.

Real world test

We presented these results to one of our customers who has a moderately large database (150GB). Nightly they take a database backup, post process it then reimport it to another database server in order to do some statistical processing on it. The bottleneck in their process is the database import. We borrowed their database and this is the timing data for a postgresql restore. The restore file is pulled from the same media the database is written to.

Server Time for import
Hex core 2.0Ghz Sandy Bridge, 128GB RAM, 2TB SATA hardware RAID 1 with BBU 2h 35m 24s
Hex core 2.0Ghz Sandy Bridge, 128GB RAM, 400GB Intel 910 SSD 1h 45m 8s
Hex core 2.0Ghz Sandy Bridge, 128GB RAM, 2x300GB Intel 710 SSD hardware RAID 1 with BBU 2h 0m 33s
Quad core 2.3Ghz Ivy Bridge, 4GB RAM, 1TB SATA software RAID 1 4h 16m 14s
Quad core 2.3Ghz Ivy Bridge, 16GB RAM, 1TB SATA software RAID 1 3h 38m 3s
Quad core 2.3Ghz Ivy Bridge, 16GB RAM, 256GB SATA SSD 1h 54m 38s
Quad core E3-1260L 2.4Ghz Ivy Bridge, 32GB RAM, 4xIntel 520 SSD hardware RAID 10 with BBU 1h 29m 33s
Hex core E5450 3Ghz 24GB RAM, 6x15krpm SAS hardware RAID 0 with BBU 1h 58m
Amazon EC2 m1.xlarge with 200GB of 600IOPS EBS 5h 55m 36s
Amazon EC2 m1.xlarge with 200GB of 2000IOPS EBS 4h 53m 45s
Amazon EC2 hi.4xlarge with 2x1TB RAID1 SSD 2h 9m 27s
Azure Extra Large sdb (ephemeral storage) 6h 18m 29s
ElasticHosts 4000Mhz / 4GB / 200GB hard disk 5h 57m 39s
ElasticHosts 20000Mhz / 32GB / 200GB SSD 3h 16m 55s
KVM Virtual Machine (8GB / 8 cores) running on 16GB 2.3Ghz Ivy Bridge Server, software RAID1 with unsafe caching 4h 10m 30s

The postgres import is mostly single threaded – usually the servers sit at 100% CPU on one core with the others idle with only occasionaly bursts of parallelism. Consequently usually the CPU is bursting to 2.5Ghz (Sandy Bridge) or 3.3Ghz (Ivy Bridge). The Ivy Bridge RAID1 machine is actually a Mac Mini. In many ways this is an application perfectly suited to ‘the cloud’ because you’d want to spin up a fast VM, import the database then start querying it. It’s important to note that the estimated lifetime of the Intel 520 RAID 10 array in this test is six months, the performance gain there over the 910SSD is entirely due to faster single threaded performance on the CPU.

Bias

Whilst I’ve tried to be impartial obviously these results are biased. When Mythic Beasts choose hardware for our dedicated and virtual server platforms we deliberately search out the servers that we think offer the best value, so to some extent our servers have been chosen because historically they’ve performed well at the type of benchmarks we test with. There’s also publication bias, if the results said emphatically that our servers were slow and overpriced we’d have fixed our offering, then rewritten the article based on the newer faster servers we now had.

Notes

The real world test covers two scenarios, the delay in getting a test copy of the database for querying for which temporary storage may be fine, plus in the event of something going hideously wrong a measure of the downtime of your site until it comes back up again in which case persistent storage is terrifically important.

I plan to add an m2.xlarge + EBS instance, and a hi1.4xlarge instance. I originally didn’t include the hi1.4xlarge because they don’t have EBS optimised volumes for persistent storage. I might also add some test Mythic Beasts VMs with both safe and unsafe storage (i.e. you cache all writes in the host RAM ignoring sync calls) which is a cheap and easy way to achieve instance storage with a huge performance benefit. I excluded the Linode VM from the final test as it’s too small.

New interview question

December 5th, 2012 by

One of our customers decided to send us a more unusual christmas card in the form of a puzzle. It was this,

if you do

cd /dev
mv *. *..

how do you restore the system to a working state?

To add hypothetical pressure to this hypothetical question imagine that the users of the hypothetical server had just done a major press launch.

Our answer was, if your hypothetical panicking system administrator had bought our managed service we could restore it from backup. As a favour we’d even restore the backup to a new virtual server allowing us to keep the filesystem on the old machine so we’d have a chance of pulling out any missing updates that had happened since the backup that morning. We could then merge it all back on to the original platform at a slightly less stressful time.

Happily our backup and restore procedures do get tested, so we were able to fairly straightfowardly restore from the backup server, build the new VDS and bring it up running the site.

One thing our newest employee didn’t know was about the usefulness of netcat so I was able to make him one of todays lucky 10,000.[*] If you’re running a debian install CD you’ll notice it doesnt have ssh or rsync but does have netcat. Consequently you can transfer your data nice and quickly as follows,

backup# iptables -I INPUT 1 -p tcp -s -J ACCEPT
backup# cat backed-up-filesystem.tar.gz | nc -p xxx -l
target# nc -p xxxx | gunzip | tar xv
backup# iptables -D INPUT 1

As always, if you read this and think “that’s clever, I wonder if I’d have thought of that” you should take a look at our managed services. If you’d definitely done it better[**] then we invite you to show off at our puzzle.

[*] Scaling for the UK birth rate rather than the US one he’s one of todays lucky 1,600. You’d have to be pedantic even by the standards of system administrators to complain about that though.

[**] Before some points out that tar has a z flag we are aware of that. However computers have lots of processors and this way tar / gunzip / nc can all sit on different cores and make it go faster which is important if you’ve people waiting for the site to come back up.

mosh available on shell accounts

November 22nd, 2012 by

Our shell account servers sphinx and onza now support mosh (the mobile shell), which is an alternative to using ssh for command line logins. The key feature of mosh is that it uses its own UDP-based protocol, which means that a mosh login can persist during network outages, and even if the client changes its IP address! You can start mosh on your wifi at home in the morning, jump on a train and switch to 3G, then plug into the Ethernet at the office and the mosh login will still be working.

To get started, simply install mosh on your client (it’s already in the major Linux distributions) and type the appropriate command to log in to your shell account:

mosh myname@sphinx.mythic-beasts.com
mosh myname@onza.mythic-beasts.com

It’s relatively young software, so there may be a few teething problems (it doesn’t play well with gnome-terminal unfortunately, although there are alternative terminal emulators such as mrxvt that work much better). Still, our staff are already completely hooked.

Bluelinux Migration Complete

November 9th, 2012 by

Over the past couple of weeks we have been migrating the final customers from Bluelinux (a hosting company we acquired) to our own hosting platform. This process is now complete. Any customers having issues should contact us at support@mythic-beasts.com.

Customers with shell accounts have been moved to onza, for which the control panel is here whereas customers with non-shell accounts have been moved to yali, for which the control panel can be found here. These control panels offer a flexible interface for web and email configuration.

Customers have more space, more software available to them and upgraded versions of software previously available at no additional cost.

Adventures with mysql

November 1st, 2012 by

One of our managed server customers came to us with a straightforward sounding problem. They needed to do a massive data import to their database which was going to take several days to complete. They hadn’t managed to test their full import because they didn’t have a test machine with enough memory, but the procedure looked it looked very solid on smaller datasets. After some discussion we came up with a plan where we’d put together a faster replacement server for them, they could repeatedly try their import until the database was complete and tested, then we’d move the full site over to the new faster machine, reclaiming the old one back into our pool.

As this seemed an ideal opportunity to test our backup and restore procedures and to give training to our newest staff member, instead of copying their server over to the new one, we restored the new one from backup. Happily we restored the state of the server fairly easily, did a little bit of troubleshooting the boot process, a summary of the expected issues in getting the new machine up are as follows,

  • udev remembers your network card mac address, so on the first boot your ethernet card comes up as eth2/eth3 instead of eth0/eth1 which means the network doesn’t start, handily we have serial console / recovery mode on our servers so this is easy to fix.
  • /dev can’t be backed up so you need to manually generate a minimal set of device nodes.
  • it’s important to make sure you’ve generated /proc /sys /tmp /run mount points with the right permissions.
  • when installing grub in a chroot you need to make sure you’ve done a bind mount of /proc /sys /dev or you’re going to get very confused
  • you can’t back up a mysql database purely by copying it’s files, we take a mysql dump which we restore from, this means you need to start from a blank mysql database and do the restore into it. In order to let the debian mysql scripts work you need to move /etc/mysql/debian.cnf out of the way, create your blank mysql database, do the restore, stop the database, move debian.cnf back in in order to make your system-maintainer passwords match the database at each stage.
  • On our replacement server we’ve installed LVM (the original was just a partition) so we needed to install the LVM tools into the chroot to build the initramfs to boot the system.
  • We needed to edit /etc/fstab because the UUIDs have changed to point the machine at the correct partitions to boot from.

This is all fine and expected. We handed the machine to our customer, they were happy and it all seemed done. Two days later they came back, mysql on the new server was much slower than the previous server. They gave us a sample query and wondered why it answered in a fraction of a second on their development and current production server. We started investigating, the new server was running 100% CPU, no disk IO, the entire database source files cached so we hadn’t done something obviously stupid. We then started looking at the mysql query planner, it had a different query plan for the same query on the same database on two different machines.

How odd we thought.

Looking further at the indexes we discovered that cardinality of the indexes for the tables in question was different. Further investigation shows that the indexes are built differently if you do INSERT, INSERT, INSERT as the original database was created compared to a single multi-row insert that the restore from backup did.

The solution is to run

optimize table table_name

which finishes building the indexes properly, the query plan changes and the queries then run quickly. We have now added mysqloptimize –all-databases to our recovery procedure and handily put it into this blog post in the hope of saving someone else the investigation we’ve just done.

If your database backup procedure doesn’t have this step in and attempting to figure it out sounds hard you should consider our Managed hosting services. If investigating this sort of thing sounds like a fun way to spend your working days you should consider applying for a job.