Base Sixhttp://base6.com James Furness's blogWed, 08 Jun 2011 09:12:13 +0000en-UShourly1http://wordpress.org/?v=Subscribe with My Yahoo!Subscribe with NewsGatorSubscribe with My AOLSubscribe with BloglinesSubscribe with NetvibesSubscribe with GoogleSubscribe with PageflakesSubscribe with PlusmoSubscribe with The Free DictionarySubscribe with Bitty BrowserSubscribe with NewsAlloySubscribe with Live.comSubscribe with Excite MIXSubscribe with Attensa for OutlookSubscribe with WebwagSubscribe with Podcast ReadySubscribe with FlurrySubscribe with WikioSubscribe with Daily RotationTransferring FreeNAS 8 to a different USB drivehttp://feedproxy.google.com/~r/BaseSix/~3/ZckCS7ybR2s/ http://base6.com/2011/05/31/transferring-freenas-8-to-a-different-usb-drive/#commentsTue, 31 May 2011 19:10:39 +0000James Furnesshttp://base6.com/?p=151As part of my FreeNAS 8 build, I purchased a Transcend 2GB USB drive which fits onto a standard motherboard 10-pin USB header to avoid having a USB thumb drive sticking out of the back of the case.

Unfortunately this took a while to arrive as scan.co.uk had to order it in specially, so my initial FreeNAS install was onto a temporary USB thumb drive.

Once the internal USB drive had arrived, I needed to transfer my install onto the new drive. Although it probably would have been possible to use FreeNAS’s backup/restore to move my settings onto a fresh install, I wanted to try a low-level copy from the temporary thumb drive to the internal drive if possible.

The transfer can be made quite easily using dd, however first it is necessary to identify which physical disk maps to which USB device, which is made slightly more difficult by the fact that the drive partitions are labelled with glabel rather than using the underlying drive partition names.

]]>http://base6.com/2011/05/31/transferring-freenas-8-to-a-different-usb-drive/feed/1http://base6.com/2011/05/31/transferring-freenas-8-to-a-different-usb-drive/Guide to cryptographic hashes for content-based addressinghttp://feedproxy.google.com/~r/BaseSix/~3/eQVLXyLg3k8/ http://base6.com/2011/05/27/guide-to-cryptographic-hashes-for-content-based-addressing/#commentsFri, 27 May 2011 08:50:19 +0000James Furnesshttp://base6.com/?p=147Just came across an interesting article on the use of cryptographic hashes in content-based addressing (e.g. Git, Rsync, Bittorrent) whilst doing some reading around ZFS deduplication in ZFS v21 which is coming soon (with v26) in FreeBSD (and hence hopefully soon in FreeNAS!) ]]>http://base6.com/2011/05/27/guide-to-cryptographic-hashes-for-content-based-addressing/feed/0http://base6.com/2011/05/27/guide-to-cryptographic-hashes-for-content-based-addressing/FreeNAS i3 setuphttp://feedproxy.google.com/~r/BaseSix/~3/21zu-E7xbHM/ http://base6.com/2011/05/08/freenas-i3-setup/#commentsSun, 08 May 2011 10:00:54 +0000James Furnesshttp://base6.com/?p=144Just finished building some new hardware to run FreeNAS 8.0. As there’s not a huge deal of info kicking around the internet about working hardware configurations I thought i’d post my experiences.

Last time I built a PC I almost built a NAS box at the same, but looking at the increase in cost of building a separate network attached PC and the decrease in performance from accessing storage via a LAN I decided to put a RAID array inside my PC instead. The RAID array (on-board Intel Matrix RAID from my motherboard) has served me well and seen me through 2 drive failures in the past 5 years without issue – fortunately the Western Digital Caviar RAID Edition drives I purchased come with a 5 year guarantee with Advance Replacement (Western Digital will ship the replacement drive within 3-5 days, without receiving the faulty one first as long as you provide credit card details). Luckily my Samsung Spinpoint boot disk has not failed thus far!

I recently upgraded my network to gigabit ethernet, so network attached storage now seems more viable, plus I have filled up the RAID storage on my PC (which is probably close to wearing out anyway and I don’t fancy having to find a compatible motherboard to get my data back out again)… ZFS seems to be all the rage these days, and so it seems like hardware RAID is redundant. Some forum research seemed to indicate that ZFS needs a reasonably powerful CPU and plenty of memory, which ruled out my hopes of building a low-power fanless Intel Atom system. Therefore I decided to go with an i3, and the Zotac H55 Mini-ITX motherboard as it has 6 SATA ports.

I also managed to find a Transcend 2GB USB drive intended for industrial use which fits onto a standard motherboard 10-pin USB header to avoid having a USB thumb drive sticking out of the back of the case.

A review appeared to confirm that the ES34169 would work nicely with the Zotac motherboard and an i3. When all the parts finally arrived and I built the system, unfortunately it would not boot. Some swapping of PSUs eventually confirmed that the Chenbro PSU was fine (it would boot a lower wattage system) as was the Zotac board, CPU and RAM (it would boot on another PSU), so the only conclusion was that 120W was not enough for the system.

Fortunately, Kustom PCs were very understanding and shipped me a 180W ES34069 (which has an external power brick) whilst I shipped the 120W ES34069 (which has an internal open-frame PSU, and is not available in a 180W version) back to them.

I had already purchased a low-height CPU cooler after reading the ES34169 review, and this fitted without issue. The only issue I did have building the case was that the SATA cables on the ES34069 were shorter than the ES34169 and two were not able to reach the SATA ports on the motherboard, so I had to replace these with some longer cables. After building the system, initially two of the HDDs did not register with the BIOS. These were the two bays I had switched cables for so I assumed there was an issue with the cables, however after ejecting and re-inserting the HDD caddies the drives appeared.

The ES34069 looks good, the translucent front allows the blinkenlights inside to be visible, which include a power and activity light on each individual disk caddy, somehow magically driven through the backplane (I had always assumed these would need a proprietary connection to a RAID controller).

On booting FreeNAS from a USB stick I initially had an issue with the system hanging whilst trying to load the network card driver, which seems to be a problem with the i386 BSD driver, however it works fine with the amd64 build (which is required for 64 bit support anyway).

So, I can confirm without further ado that the following setup works with FreeNAS 8:

FreeNAS seems pretty easy to use so far. FreeNAS 8.0 is a complete rewrite so unfortunately it only supports basic storage/sharing at the moment, however many more features are on the way in 8.1. Now to copy my data on and start using FreeNAS!

]]>http://base6.com/2011/05/08/freenas-i3-setup/feed/10http://base6.com/2011/05/08/freenas-i3-setup/Tungsten FSM: A lightweight Java finite state machine libraryhttp://feedproxy.google.com/~r/BaseSix/~3/1nao7aqQVmE/ http://base6.com/2010/12/05/tungsten-fsm-a-lightweight-java-finite-state-machine-library/#commentsSun, 05 Dec 2010 18:36:00 +0000James Furnesshttp://base6.com/?p=136I recently came across Tungsten FSM whilst looking for an off the shelf FSM implementation. Ideally I was looking for something which was a lightweight and no-frills but robust FSM implementation, and Tungsten FSM seemed to exactly fit the bill. All configuration is done in code, so no messing around with XML files, and the implementation itself is only a handful of classes with only one dependency (log4j).

All in all worked out very well, and it seems to do exactly what it promises. The support for sub-states is useful to cut down on config bloat by defining common transitions on a parent state.

If I were to nitpick it would have been nice to see generics used to avoid needing to cast the entities/events, however this would arguably bloat the Tungsten source somewhat. It would have also been nice to be able to specify an “ignore” type transition which could be specified on a parent state to ignore an event rather than having to define transitions on all sub states of the parent state for an event in order to ignore it and stay in the same state.

]]>http://base6.com/2010/12/05/tungsten-fsm-a-lightweight-java-finite-state-machine-library/feed/1http://base6.com/2010/12/05/tungsten-fsm-a-lightweight-java-finite-state-machine-library/A-Team London Insight Exchangehttp://feedproxy.google.com/~r/BaseSix/~3/j4hKdxO4tP8/ http://base6.com/2010/09/16/a-team-london-insight-exchange/#commentsThu, 16 Sep 2010 13:59:43 +0000James Furnesshttp://base6.com/?p=120Myself and a colleague were offered some tickets for the A-Team Insight Exchange (High Performance Technologies for Trading and Risk) in London yesterday, and were able to get away from our desk long enough to attend the first half of the day!

Overall a lot of the things discussed were things that we were already aware of as a team, and although it was disappointing not to have any huge takeaways from the day it was heartening to know that our team is at pace with the current state of the art (although clearly the state of the art as presented predominately by vendors at such a conference does not necessarily equal the true state of the art in in-house technologies developed by banks/funds).

A few interesting themes from the day:

Integration/Standards – A lot of interest in making proprietary components e.g. for risk/algorithmic execution use industry standards (e.g. FIXatdl for algo trading) to speed up integration and facilitate reuse of off the shelf components.

Build vs buy – Many of the panel discussions focused around this with the vendors obviously arguing the buy case for time to market, less developers required etc.

Interest in low-latency/HFT increasingly spreading to FX/options – According to the vendors, a lot of the technologies previously used almost exclusively by equities such as InfiniBand/10 GigE and colocation are now being taken up by increasing numbers of customers for FX/options.

The need for education – One of the panel members made an interesting point that a lot of customers have infrastructure teams who have no idea what the High Frequency Trading teams in their bank are doing, this can be counter-productive as the HFT teams build/support everything themselves as they don’t feel they can trust the infrastructure teams to understand/implement their requirements correctly. If infrastructure teams were better educated about HFT/low-latency this would be less of an issue.

Different types of latency – Darshan Chandarana from Oracle address touched on realtime JVMs a bit and re-iterated the fact that it is generally not possible to have both the lowest latency and maximum determinism – realtime technologies generally decrease variance at the expense of increasing the mean. The only counterexample given to this was InfiniBand, which apparently is indeed a magic bullet!

A few interesting vendors:

Panopticon – Partners of Sybase’s CEP offering (Aleri), they demoed alongside Sybase. Some interesting visualisations on top of the risk system (e.g. their treemap).

Sumerian – Came up with a nice sound byte in one of the panel discussions: “Latency is a distribution, not a number”. This piqued my interest as this was a view that our team hold which some of the other latency monitoring vendors we have previously met didn’t implement. Also, unlike some of the other vendors we have previously met, Sumerian’s approach is not a real-time dashboard – instead data is shipped to them and they analyse it to produce a one-off report which identifies which areas of the system are most latent and therefore benefit from development investment. Obviously there are pros and cons to this approach vs a real-time monitoring dashboard.

Oracle – Thanks to the merger with Sun, they are now producing hybrid appliances using Sun hardware, e.g. they believe they have built one of the fastest database servers available (and they had brought this in an impressive display rack to their stand). Will be interesting to see if they come up with any challenges to Azul in the JVM appliance space.

]]>http://base6.com/2010/09/16/a-team-london-insight-exchange/feed/0http://base6.com/2010/09/16/a-team-london-insight-exchange/Garbage Collection Tuninghttp://feedproxy.google.com/~r/BaseSix/~3/W9ZDp39D8P4/ http://base6.com/2010/08/23/garbage-collection-tuning/#commentsMon, 23 Aug 2010 12:59:42 +0000James Furnesshttp://base6.com/?p=118I recently stumbled across a useful presentation: “GC Tuning In the HotSpot JVM” from FISL 10, which provides a good overview of how to tune the ParNew, Paralell and CMS collectors…

Also quite useful is this blog entry which explains how to understand CMS GC logs.

]]>http://base6.com/2010/08/23/garbage-collection-tuning/feed/0http://base6.com/2010/08/23/garbage-collection-tuning/Performance techniques used in the Hotspot JVMhttp://feedproxy.google.com/~r/BaseSix/~3/SrfHJ89_D6c/ http://base6.com/2010/07/27/performance-techniques-used-in-the-hotspot-jvm/#commentsTue, 27 Jul 2010 09:26:13 +0000James Furnesshttp://base6.com/?p=114Little gem from the Hotspot Internals wiki helping to solve puzzles such as is “X.class.isAssignableFrom(obj)” slower than “obj instanceof X“!

]]>http://base6.com/2010/07/27/performance-techniques-used-in-the-hotspot-jvm/feed/0http://base6.com/2010/07/27/performance-techniques-used-in-the-hotspot-jvm/Calculating floating point epsilon/precision in Javahttp://feedproxy.google.com/~r/BaseSix/~3/gkvN0WK88M8/ http://base6.com/2010/06/24/calculating-floating-point-epsilonprecision-in-java/#commentsThu, 24 Jun 2010 10:25:44 +0000James Furnesshttp://base6.com/?p=96Floating point arithmetic/rounding can be somewhat painful, made worse by the fact that the epsilon (error) in the machine representation of floating point varies depending on the exponent (i.e. how large/small the number being represented is):

A very comprehensive paper (from which the above image is taken) is available here. In previous teams we have implemented our own functions to derive an approximation of the epsilon from the number to be represented, however I discovered recently to my surprise that such a function was added to Java in 1.5: Math.ulp!

]]>http://base6.com/2010/06/24/calculating-floating-point-epsilonprecision-in-java/feed/0http://base6.com/2010/06/24/calculating-floating-point-epsilonprecision-in-java/JMM Synopsishttp://feedproxy.google.com/~r/BaseSix/~3/MdZUCsUT028/ http://base6.com/2009/09/15/jmm-synopsis/#commentsTue, 15 Sep 2009 10:32:49 +0000James Furnesshttp://base6.com/?p=77Useful synopsis of the Java Memory Model from Doug Lea – in particular the clearest explanation I have found so far of the meaning of “happens-before”, and some useful definitions which helped to get a concrete idea of the semantics around safe-publication of variables through Thread.start()… ]]>http://base6.com/2009/09/15/jmm-synopsis/feed/0http://base6.com/2009/09/15/jmm-synopsis/Server upgrade to Intel Atom Mini-ITXhttp://feedproxy.google.com/~r/BaseSix/~3/Rx2J_PO9BwA/ http://base6.com/2009/07/30/server-upgrade-to-intel-atom-mini-itx/#commentsThu, 30 Jul 2009 22:04:41 +0000James Furnesshttp://base6.com/?p=74My home linux server (formerly my desktop PC), which has been sitting in the corner of my lounge for a few years (with all fans other than the CPU fan unplugged in order to keep the noise down), finally blew up a few weeks ago. The motherboard was loading the BIOS but failing to recognise the HDDs or boot from a CD despite the fact the HDD/CD seemed fine in another PC, so I presumed that the Southbridge had failed due to overheating.

I decided to switch to a low-power Mini-ITX based design rather than replacing the broken motherboard with a comparable one, and after a quick bit of research decided upon an Intel D945GCLF2 motherboard – which is based around the Atom 330 (dual core 1.6 GHz) processor, 2 Gb of RAM and a Morex Venux 668 case from ITX Warehouse. A complete PC (excepting disks) with change to spare from £150 – pretty impressive!

The parts arrived two days later (I ordered after the 5pm cutoff), and within a few hours everything was installed in the new case and ready to go. I was amazed as Debian booted off of the old disk without any issues (try changing the motherboard architecture on Windows without reinstalling from scratch!). After some slight issues with the network I eventually realised the new network card was coming up as eth1 rather than eth0. A quick check of google revealed that the old network card needed to be removed from /etc/udev/rules.d/70-persistent-net.rules. Following this everything was up and running as before.

The fan on the D945GCLF2 is apparently notorious for becoming very noisy after a few weeks, and the fans in the case are of a similar diameter, so I am expecting my next project will be to replace these with either low-noise fans or passive cooling.