Saturday, 10 January 2009

ocsigen (OCaml web framework) benchmarked

This benchmark compares the OCaml web framework ocsigen against Ruby on Rails and lighttpd+C with some excellent results for the OCaml framework:
Reqs/sec Mem usage
Rails with mongrel, 1 process 260 49MB
Rails with mongrel via nginx (rev proxy), 1 proc 220 ~51MB
Rails with mongrel, 4 processes via nginx 430 ~200MB
OCaml ocsigen (1 process) 5800 4.5MB
lighttpd with FastCGI app in C, 20 procs 9300 4.5MB

OCaml is not just an order of magnitude faster and an order of magnitude more memory efficient, but it also provides complete compile-time safety, catching multiple errors at compile time which would otherwise only show up after extensive testing.

More discussion on this reddit thread.

There's a Fedora ocsigen package waiting for review here.

Friday, 2 January 2009

Home server, part 4, installing the OS

For want of a cable, my home file server wasn't coming along very well, but today I hooked up the 2.5" IDE to PATA converter cable from Maplin with the hard drive from the disassembled Viglen MPC-L:


The Viglen was really easy to disassemble by the way. Two screws on the back hold on the backplate, and then the entire motherboard/hard disk assembly slides straight out. Another three screws let you remove the hard drive.

I settled on relatively simple route to install CentOS. I used Red Hat's KVM virtualization to run a VM, attaching the physical hard drive and the (virtual) CentOS DVD ISO. It sounds complicated, but all you need is this virt-install command line to do it (the host is Fedora 10):

virt-install --connect=qemu:///system \
-n centos5 -r 512 \
-v --accelerate \
-c /root/CentOS-5.2-i386-bin-DVD.iso \
-f /dev/sde \
--vnc --vncport=5900

(Adjust the path to the CentOS DVD ISO, and the physical hard drive device as appropriate).

CentOS 5.2 installed in about 15 minutes: