Brian “Krow” Aker’s Idle Thoughts - Solaris, Linux, it is GNU folks…
Brian hits the nail on the head… The way you get a usable system is install all the GNU tools.
This is how I go from fresh Ubuntu install to building MySQL:
apt-get build-dep mysql-server
apt-get install bison
(now go and build).
(and i could do this graphically if I wasn’t so stuck in my ways)
For Solaris? umm… there was a point where I could get Solaris to apply security updates and Brian could get all the stuff needed to build a MySQL Server. Together we had the knowledge needed… but neither was as trivial as with Ubuntu and combining knowledge was too much - I just gave up and went on to more productive things.
Even on an existing Solaris system… getting your PATH right is a trip into some weird fantasy land seemingly designed to annoy you. No doubt this all made some sense back in the day… but now it just causes pain when all you want to do is compile your program, find the bug and fix it.
When I started at SGI several years ago, what’s the first thing I did? Went and installed all the GNU packages. IRIX is a lot nicer then.
Same with MacOS X - the first thing you do is go and install darwinports or fink and get a remotely usable system.
With Windows, it varies - but the shell is so outrageously shit you need cygwin just for bash, you need either emacs or VisualStudio to get an editor you don’t want to kill, Firefox for a web browser that works etc etc etc. The fact that the Windows packing system just blows chunks makes it the most painful experience of all.
So even if you’ve heard rave things about the debugger in VisualStudio - actually getting a Windows install to the state where you can run the debugger takes hours. Click click click, upgrade, yes, install, swap disks, upgrade, upgrade, wait, reboot, install manually, install manually, install manually. ick.
Project Indiana is possibly the saviour of Solaris. Default userland is gnu, default shell is bash. Starts to make it feel like home. Just as when Solaris started shipping GNOME made it feel more homely.
Solaris comes with a version of vi that is old enough to drink in bars. Project Indiana realises that a drunk editor isn’t a good idea and ships something sensible.
The BSDs get a lot of things right. Sane userland that is familiar to people. Jumping onto a FreeBSD box is remarkably easy.
The typical thing said by people is “backwards compatibility” and all that… basically so that everyone can run their apps from 1985 and not change a thing. Worthy goal. Of course, 1985 does not need to be the default environment in 2008.
There is a standard for the unixy way of things: it’s Linux with GNU tools in userland.
Just as Windows set the big standard for having a kind of usable GUI (the Mac did it better, but Windows got the numbers) - and to get people to use Linux on the Desktop we needed to get it to a stage where those people are comfortable.
If you want your UNIXy system to be used by anybody today, you need to have it be comfortable for Linux people.
On the other hand though, Ubuntu is still the best desktop I’ve ever used and am rather happy with it (no matter how much i bitch and moan about certain things being obviously broken).
(and no, I’m not switching my desktop to any Solaris variant - but wholeheartedly look forward to the days when maintaing software than runs on Solaris is a heck of a lot easier because Solaris becomes less annoying).
One more point: OSX and Solaris are the only remotely proprietary UNIXes left. Everybody else is either dead or doesn’t know it yet. Solaris is nearly all free (AFAIK there’s still just some binary only drivers around… which sucks… but these things can take time, so that’s okay) and OSX has parts which are (sometimes seemingly dependent on phase of the moon) free-ish. So really, OSX is the one last hold out of the largely proprietary UNIX world. It’s a fascinating thing to think about…. freedom wins.
(and this no doubt goes on far too long and incoherently…. but that’s because of long days and late nights because of upcoming really cool stuff which I’ll blog about later)
Following my successful linux.conf.au talk “Eat My Data: How Everybody Gets POSIX File I/O Wrong“, I started to feel the need to easily be able to have my data eaten.
Okay, not quite. However, when you’ve written your software properly, so it uses fsync() correctly, opening files with O_SYNC or whatever - tests take longer as you’re having to wait for things to hit the rust.
So….. LD_PRELOAD=libeatmydata.so to the rescue! With a POSIX compliant fsync() (that does nothing) and filtering on open(2), it can take your test run times down dramatically.
The only time you shouldn’t use it for your tests is when you end up crashing the machine to test durability (i.e. when the OS doesn’t have the opportunity to cleanly write out the data to disk).
See the libeatmydata project page: http://www.flamingspork.com/projects/libeatmydata/
and the bazaar repository: http://www.flamingspork.com/src/libeatmydata
(it’s seemed to have saved somewhere between 20 and 30% of the time for innodb/ndb tests in mysql-test-run).
I am very good at just staying up late to adjust to a timezone. I can do this fairly reliably. Going to the US and Europe can be done by this method (rather well). Coming back is another story though. Going to sleep at an earlier time (for me) doesn’t come easy. Grr…
This year, it seesm that whenever I go out for significant travel, the following things will break on my trip:
At least this time the disk is part of a RAID1 array.
Oh, and for some reason my mythbackend stopped doing anything a few days ago…. and I wasn’t checking it. grr… annoying. At least there’s not much on TV.
Today, immediately after lunch, I got IO errors from my laptop hard drive (ironically while attempting a file system dump). Words to the affect of “oh gosh and bother” exiting my mouth and the decision was made to go get a new drive.
Well… one “shortcut” to the computer store later, have new HD (will travel).
Backup from previous night, xfsrestore here I come. And a good number of hours later… about 1.5million files restored.
I do wish file systems had REPEATABLE_READ though… that would be nice.
So, probably like lots of people - i run a few web apps locally that I use for various purposes. In my case, this also includes some cool custom developed things.
I also use Zeroconf to easily discover all this foo around a network.
I run my critical mysql install by hand - it’s not constantly up. This is so, as somebody noticed (during Eben’s keynote at the MySQL Conference where he talked a lot about privacy) that one of the apps i run is entitled “tax”.
Since I’m somewhere other than at home, my mysql instance was stopped (much harder for people to grab the data out of it if the process isn’t running to begin with).
So yeah… good points - check what random people out on the network may have access to on your laptop - and know what you should not run as default (I’m careful there).
Nine dollars (US) of Water (how many hours would somebody on minimum wage have to work to buy this 1.5L of water?):
Apart from that, jetlagged - managed to find food, TV, internet. All good.
I’ll be putting photos up on my gallery (which is running a MySQL Cluster 5.1 backend - with disk data) over at:
Tomorrow morning (11.5hrs time actually) I’ll be on a plane to SFO (then down to Santa Clara) in preparation for the MySQL Conference.
So, if you’re in the area - give us a buzz. My aussie phone will work, as will traditional email.
Also on IRC… should be easy to find me (freenode).
I’ve used OfflineIMAP for quite a while now. On the whole I’m fairly happy with it. Today I sent this to the list:
Forgive the potentially bad python, not my native tongue :)
This patch is motivated by three things:
- offlineimap is extremely slow at syncing lots of locally deleted
messages
- offlineimap uses lots of memory
- LocalStatus files aren’t written safely (a hard crash can cause
corruption)
- I’ve been bitten by this in the past, causing a complete resync of
the folder… so I get duplicate messages.
I am currently using 4.0.14 (from Debian) with this patch. I used it to
convert the files and everything. Seems quite reliable and quick.
In my tests, execution time for a normal sync is relatively the same.
Execution time for when lots of messages have been deleted in a
reasonably sized folder (e.g. during re-organisation of mail folders) is
as much as 10x faster.
In my tests, running with 1 thread uses as much as 20% less memory with
this patch (i.e. about 160MB instead of 200MB+ for my maildir)
Disk space used by the LocalStatus files isn’t much more… for me it
looks like it’s 6.5MB now versus 4.5MB then. We get the added benefit of
indexes for all our queries… nice :)
I had disable the threading for copying messages as this means that
LocalStatus objects are shared between threads, which pysqlite doesn’t
like (it asserts).
I think the part of this patch that implements the uidexists does
actually slow things down compared with having the messagelist…. a
more optimal implementation may be possible, but I think the other speed
improvements (and memory savings) are worth it.
A future patch may convert other storage types to sqlite (or similar) to
further reduce memory consumption (and hopefully runtime).
This does add a dependency on pysqlite… which is packaged in debian
(and ubuntu) - and i’m using the stock packages for these.
Comments very much appreciated.
Of course, the patch is here. I’m using it now… although I’ll warn you that it does update your .offlineimap to a new format (and doesn’t provide you a way to go back, without restoring the backed-up LocalStatus files and probably getting message duplicates).
So, those around the MySQL circles I tend to hang around may ask “Why not libmysqld?” (the embedded MySQL server). Well… a few reasons… sqlite is file-per-db (even though I’m essentially using file-per-table here), the python bindings are everywhere (and work), it’s tiny and crash safe.
You may also ask “Why?”… well, I’ve been re-organising a bunch of mail folders, which means deleting a *lot* of messages from some folders (and moving them to others).. offlineimap has been really slow at this. So I fixed it, with code (not whining).
I also wrote a bit-of-a-hack perl script to remove duplicate messages from a bunch of folders (a bug in offlineimap had caused me to get several copies of each message in a bunch of my folders a while ago). So that script is here. Commented out are bits to do comparison via md5 as well as message-id. Don’t use unless you know what you’re doing… it may also use a few hundred MB RAM on large (few hundred thousand messages) folder.
Hopefully these will help improve my productivity.
Now, back to my regular programming….