's bl.aagh

BSD, Ruby, Rust, Rambling

Excessive Swapping with FreeBSD NUMA

Poor VM behaviour with ZFS ARC and unbalanced NUMA domains


Early last year I finally diagnosed a long-standing issue with my FreeBSD machine, which always had gobs of memory for things but which frequently encountered swap pressure for no discenerable reason.

This is a slightly edited copy of an unpublushed report I wrote back then, prior to the hardware being retired. Maybe it’ll be useful to someone.

Continue Reading

Micro-Optimising in JRuby

Calling Java from JRuby for fun and profit

[ruby] [jruby] [java]

One of the neatest bits of JRuby is the simple way you can call out to Java. There’s a lot of Java out there, and you can wrap it up in nice little Ruby interfaces with just a few lines of code.

Let’s illustrate with some trivial examples, hooking up bits of Java to Ruby and seeing how well they perform compared to the equivalent pure Ruby.

Continue Reading

Password Generation in Ruby and Rust

Writing the same small program in two different languages.

[ruby] [rust]

I’ve been doing a fair bit of Rust lately. Honestly, I haven’t been so smitten with a language since I started writing Ruby back in 1999.

Rust is many of the things Ruby isn’t—precompiled, screaming fast, meticulously efficient, static, explicit, type-safe. But it’s also expressive and, above all, fun. I think this rare mix makes it a good companion language for Ruby developers, particularly with things like Helix and rutie making it easy to bridge the two.

The best way of learning is by doing, so why not avoid that and just read about me doing something instead?

Continue Reading

First Post

Someone... pays me for this, right? Guys?

[meta] [web]

Hmm, I’m doing this again, am I?

Last time was a custom PHP CMS with enough fancy features it even had dual-mode HTML/XHTML rendering based on the Accept-Content header. Look. It made sense at the time. Sort of. Shut up.

16(!) years later… it still mostly works, and it’s certainly not the worst thing I’ve ever written, but I haven’t been a PHP guy in a long time, and it’s time for a change.

So here I am with Gutenberg, a static site generator written in my new favourite language, Rust. Whether or not I actually do anything with it, I helped fix bugs in four different projects in the process of setting it up, and made a FreeBSD port, so it’s already paid off in my book.