RAID 10 in a Mac Pro

August 27th, 2008

I wanted to set up RAID 10 a.k.a. 1+0 in a Mac Pro for a particular application, and could not find any good guides online so I thought I’d share my notes here.

It’s not obvious, but it’s not terribly hard after all.

Install the 4 drives in the Mac Pro.

Boot from OS X install disc, go to the Disk Utility (under one of the menus), make sure all the drives show up.

Erase each one individually (not sure this step is needed but I did it so I’m including it)

Go to the RAID tab and click the + button three times to create 3 entries in the main window

Highlight the first entry, and change it to a Striped raid set

Highlight the second and third sets and make sure each is a Mirrored raid set

Drag the first and second disks from the left window onto the second raid set (first mirrored set)

Drag the third and fourth disks from the left window onto the third raid set (second mirrored set)

Within the main window, drag the second raid set (first mirrored set) onto the first/striped raid set

Within the main window, drag the third raid set (second mirrored set) onto the first/striped raid set

You should now have a hierarchy with one raid set containing two others, each with two disks under it. See screenshot here.

Click Create. This step takes a while.

When the window updates afterward, it may not show everything correctly. Early 10.5.x disk utilities were buggy, it seems. Quit and relaunch disk utility.

Highlight the volume under your striped raid set in the left, go to the Erase tab, name the volume ‘boot’ or whatever, and erase it

Quit disk utility and proceed with the OS X install.

Dan to all vendors: take our money

August 21st, 2008

Last Fall, I wrote about the miserable experience I had while trying to give Dell some cash.

It seems it’s spreading. Right now, I am trying to get no fewer than three technology vendors to take varying amounts of our money.

I’m trying to spend $800 for a license for some color proofing software from a company in the newspaper industry. My contact has been checking on whether they can accept credit cards for the past two weeks or so. (I know, right?!)

I’m trying to buy a large color proofer from HP, to the tune of $4,800 list price. Our contact there responds to emails about once a week, and very tersely - along the lines of “I’m not aware of any recent order”. We’ve been asking them for this proofer for about a month now.

I’m trying to spend $30K-40K with Apple for hardware and services to implement roaming user accounts. I can’t get a statement of work to save my life, and we’ve been talking about it since May.

What’s the deal here? Not enough money involved to make it worthwhile for the vendor? What’s the tipping point?

Anyone else have similar experiences?

Where is Bob?

August 18th, 2008

I think I know this person!

http://whereisbob.wordpress.com/

Gas prices on the way down …. bummer?

August 16th, 2008

I filled up the CR-V last night for $3.42 per gallon, quite a bit lower than our recent high of around $3.95. Yes, yes, I know, people in big cities pay even more and ethanol subsidies are unfair. Too big a topic to tackle here.

I was reflecting on the fact that I was disappointed that gas prices are falling. Is that bad?

I can see how it would cause a budget crunch for some people …on the other hand, the U.S. won’t see meaningful change in the area of energy policy or energy use unless and until people really get socked in the wallet. That just seems to be how most Americans are.

My family is fortunate enough that the gas prices haven’t caused us any issues; I never really pay attention to what it costs since my wife drives the car most of the time, and I shake my head at stories of people looking for the lowest local prices on the Web, then queuing up at those stations to save a few cents. What they burn in their time and with the engine idling kills any savings at the pump.

I’ve been commuting by bike off and on since 2000, and until this year it was rare that I would see more than one other bike commuter on my roughly 8 mile daily trek. This summer I would see larger numbers of riders, especially after the 5 o’clock mark. Never hordes, but a definite increase - but the numbers are already dropping in the last few weeks as gas prices drop.

Not that you have to ride a bike to work - but what about public transportation? Walking? 1 person driving 1 car to work every day is not an efficient model, it’s not good for our national security/independence, nor is it good for our planet.

Sad, I say. Without some sort of driver like $6/gallon gas, and with politicians pandering to America’s lazy and selfish habits, we’re going to be right back to status quo gas-thirsty America.

I propose we raise the gas tax by 50 cents a gallon every year for the next 5 to 8 years, fund educations for our kids with the haul, and see what happens over the next 20 years. Our kids will figure out how to make solar-powered Segways that will go 100 miles on a battery charge and sell for $50 each.

Thoughts on the 2008 triathlon

July 7th, 2008

Just realized I never published this post … rats!

First, did you know our governor participated in the recent Hy-Vee triathlon? He was the swimmer on a relay team - see here. Cool.

I surprised myself by going just a little bit faster overall this year than last - 2:37 vs 2:38. My swim time was just slightly slower, and the same for the bike leg. My run was quite a bit faster, but my transition times took a real beating - it’s clear that I did not practice, and that I spent too much time worrying about whether I had everything during the 6 minute T1. Yes, 6 minutes.

My times this year:
Swim: 27:09
T1: 6:01
Bike: 1:11:13
T2: 4:36
Run: 48:23
Overall: 2:37:21

And last year:
Swim: 26:49
T1: 4:01
Bike: 1:10:58
T2: 3:21
Run: 53:34
Overall: 2:38:41

So clearly all the running has helped, as not only was my run time more than 5 minutes better, I felt a lot better running than last year, too.

It’s also exciting to see that I could shave several minutes just by improving transitions. Some ideas are to use a tri suit so I don’t have to try to pull on a bike jersey wen I’m wet, use a race belt to hold my bib number, use a Bento Box or similar on the bike for gels, and do a better job of laying out my gear in transitions. And of course, practice.

Looking ahead to next year, I am motivated right now to think that barring a major illness like I had this Spring, I could drastically improve my time.

With over 10.5 minutes in transition this year, I am confident in saying that I could shave 5 to 6 minutes there.

What else?

I’m a strong cyclist, but didn’t get a lot of time on the bike in after being sick in March. I think with some strength training, interval training, and additional miles, I could easily shave 5 or more minutes there.

The run still has a lot of room for improvement. I felt good and strong all the way through this year, the only issue being a thigh muscle that threatened to cramp up around mile 5. My PR for a 10K is 46-something, and I just ran a 20:32 5K at the Urbandale 4th of July race, which means I actually can run kinda sorta fast when I want to. With some additional speedwork, I wonder if I could shave 4 or 5 minutes off the 10K time on the end of a tri?

As for swimming - that’s tough. I’m at 27 minutes now, and while my 26:49 last year had me as one of the first people out of the water, it wasn’t the case this year; it seemed there were more fast swimmers this year than last. I just didn’t have as many yards in this year as I did last year, and the only reason the difference isn’t larger is that I strayed off course last year. I would see some improvement from strength training, and think saving 3 minutes or so here is reasonable.

Add that up and what do you get? let’s say save 5 in transition, 5 in biking, 4 in running, and 3 in swimming, for a total of 17. So - that means a 2:20 tri next year.  Right….?
Let’s see what happens.

Closing out June

July 7th, 2008

Over a month since my last post - sorry, dear reader. The blog has been much neglected of late, and I fear will continue to be neglected for a time as my family celebrated the arrival of Ian Spencer Buettner-Cable on June 26. Now 12 days old, he is the object of much adoration from his older sister, who describes him as both cuddly and floppy. My wife seems quite happy with her latest accomplishment, and I like the little guy pretty well myself. I am trying to keep a lid on the anxiety that plagued me about reliving the terrible time that was Adrienne’s first few months.

As Mike noted recently, to those people who look at a newborn and say “oh, isn’t it wonderful” - I say, no, it really isn’t. They eat, sleep, cry, pee, and poop. But it gets wonderful. My daughter will turn 3 at the end of the month, and most days she is a treat. She ran her first race the other day and loved it.

After that announcement, everything else about June is anticlimactic, but here are the highlights:

- participated in 2nd annual Hy-Vee triathlon, and actually bettered my time slightly over last year. That was a surprise as I hadn’t been as focused on it this year as I was last.

- ran my first 5K race (all my others have been longer) and surprised myself with a 20:32 time. It wasn’t that long ago that I struggled to run 5K without stopping, and it took me 30 minutes or so.

- Adrienne ran the tot trot at the Urbandale 4th of July races (where I did the above 5K), and had a great time even though it was all of about 50 yards. We had been practicing with chalk lines for start and finish in our driveway, and she is ready to run one again (”papa, can we run my race again today?”)

- At my wife’s insistence, I went and helped make sandbags for most of a day during Iowa’s recent flooding. That is pretty hard work, my friends, but rewarding too. I won’t hesitate to volunteer again when needed.

- Andy and family left the sweltering midwest for the land of free Starbucks and beer in the fridge as a Microsoft employee, though he has already returned to Iowa once this month and will do so again yet this month. Likely to remind himself why he left.

- Adrienne discovered that repeated use of the word “why?” will lead to her parents’ going insane.

Dam to Dam 2008

June 2nd, 2008

Saturday, I ran the 2008 Dam to Dam 20K - my longest run in a few months, and longest race since last Fall’s Des Moines Marathon.  It was a beautiful morning for any kind of outdoor event, and this time of year being what it is in Iowa, the lush green scenery on the somewhat-rural north edge of the city was amazing.

When I signed up, Active.com (see trainwreck) asked me to estimate my finish time.  I estimated 2 hours 10 minutes (my half marathon split last Fall was 2 hours 3 minutes and I haven’t been running much) and didn’t think much of it, but it turns out that time was used to slot people in the starting lineup.  It wasn’t being enforced, but I slunk to the back of the pack with my blue tag - #3918 of 5300-some 20K registrants.

That was a mistake.

I spent the first 20+ minutes dodging in and out of traffic.  My first mile was well over 13 minutes.  Slow even for me…  Still, after a couple of miles, it had thinned enough that I was generally able to run without issue on the left shoulder, and I steadily passed people for most of the rest of the race.

It was a great crowd to run with, though after about mile 5 people really seemed to stop talking.  Crowd support was pretty good for an early Saturday morning event - start time was 7 AM.

I managed to slowly increase my pace each mile for the first several, but struggled around miles 9 and 10 before picking it back up for a finish that felt pretty strong.  I came in at 1:44:50, #853 of the 4813 finishers.  Jim smoked me at 1:31:33 but that’s to be expected as he’s such a rock star these days.

I’ll definitely run Dam to Dam again next year.  Great race, great post-party.  Now if only I had enough runner friends to form a post-party troupe with…
Less than 3 weeks to the triathlon.  No idea what that’s going to look like as my training’s been off and my new kid should be here practically any day now!

More news by category Topic -: Buy phentermine saturday delivery ohio Tramadol hydrochloride tablets Picture of xanax pills Free shipping cheap phentermine Buying phentermine without prescription Safety of phentermine Pyridium Generic viagra cialis Cialis generic india Pink oval pill 17 xanax identification Buy free phentermine shipping Best price for generic viagra Information about street drugs or xanax bars Ordering viagra Snorting phentermine Hydrocodone overdose Lithium Amiodarone Get online viagra Order viagra prescription Order xanax paying cod Cheap phentermine free shipping Imiquimod Tramadol next day Linkdomain buy online viagra info domain buy onlin Pfizer viagra sperm Vidarabine Cheapest viagra price Prevacid Viagra cialis levitra comparison Dutasteride Lisinopril Thiotepa Female spray viagra Black market phentermine Betamethasone Cialis forums What does xanax look like Loss phentermine story success weight Order xanax overnight Viagra alternative uk Diet online phentermine pill Order xanax cod Mecamylamine Eulexin Cheap hydrocodone Buy cheapest viagra Viagra xenical Phentermine with no prior prescription Xanax in urine Macrodantin Cheap phentermine with online consultation Epivir Buy phentermine epharmacist Ditropan Woman use viagra Cialis erectile dysfunction Xanax withdrawl message boards Viagra online store Atorvastatin Generic ambien Is phentermine addictive Next day delivery on phentermine Buy online viagra Ethanol Natural phentermine Avandamet Xanax long term use Diet page phentermine pill yellow 5 cheap Cheapest secure delivery cialis uk Information medical phentermine Cialis experience Phentermine no perscription Compare ionamin phentermine Viagra cialis levivia dose comparison Noroxin Effects of viagra on women Buy cheap cialis Viagra shelf life Hydroxyurea Phentermine discount no prescription Buy cheap online viagra Dog xanax Online cialis Viagra class action Viagra price Phentermine without prescription and energy pill Hydrocodone cod only Nicoumalone Cheapest viagra Cheap ambien Vicodin without prescription Phentermine prescription online Phentermine snorting Mirtazapine Quazepam Isradipine Buy generic viagra online Xanax look alike Moxifloxacin Viagra experiences Piroxicam Nicorette Free try viagra Sotalol Cash on delivery shipping of phentermine How do i stop taking phentermine Xanax prescriptions Cheapest phentermine 90 day order Niacinamide Phentermine weight loss Phentermine

The Winter Manhattan - a tasty variation on a classic

June 2nd, 2008

I started drinking Manhattans about a year ago - I have no idea how I managed to avoid this wonderful treat for so long - and since then have enjoyed probably a couple too many.

Also last year, my wife purchased a book with 101 martini recipes, and while I think it’s unlikely most martini drinkers would call most of those drinks martinis, it did have in it a recipe for a “winter Manhattan”. As is my wont, I got bored with the status quo and decided to try it out. (Even though it’s nearly Summer, we had some pretty cold weather in Iowa last week). It’s not something you can just whip up spur of the moment, but it’s pretty easy.

The gist is that you use raspberry- and cinnamon-infused bourbon and apricot brandy in place of the usual rye whiskey and sweet vermouth. (those bartenders who use grenadine are out on a limb in my opinion).

2 parts bourbon, 1 part apricot brandy, a few dashes of bitters, shake, pour over a bit of crushed ice in a chilled glass. Enjoy.

The bourbon is easy to do - you’ll need a clean bottle with a wide enough opening to put raspberries down, and big enough to hold the bourbon + the raspberries. I used Maker’s Mark - though about going cheaper, but wanted to give the recipe a fair shake. I combined 3 cinnamon sticks, 1 pint of raspberries, and 1 750ml bottle of Maker’s Mark, corked it, and let it sit in my basement for a week.

I used a large pyrex measuring bowl and some cheesecloth over the bottle mouth to drain the infused bourbon out, then I shook the cinnamon sticks and raspberries out of my bottle. Washed it and then poured the bourbon back in for storage.

When mixed as described above, this is a tasty treat! It tastes surprisingly little like the apricot brandy, which smells rather cheap like peach schnapps, but rather like a less-sweet, slightly-spicy Cosmopolitan.

My wife was not impressed, labeling it “cough syrup”. (She doesn’t like regular Manhattans or martinis either).

I’ll definitely plan to make one of these the next time there’s a cold winter day!  Next time I make up the bourbon, I plan to try using some higher-grade cinnamon from Penzeys in place of the Hy-Vee generic sticks I got for the first try.

winter-manhattan-components.jpg

winter-manhattan.jpg

Rails, MySQL, enterprise advisor - the intersection of two bugs

May 16th, 2008

My Rails application for Gigantic News Corp. has been pretty successful in its first two months of life, but we’ve been seeing some intermittent, nagging performance issues. I’ve spent the last couple weeks optimizing Rails and SQL code to reduce object instantiation overhead and also reduce a number of database table scans. That’s shown good results so far, but I’ve been banging my head on one issue the last few days - namely, an extremely high proportion of MySQL’s temp tables are being written on disk. Using temp tables is slower than buffers, of course, and disk of course is much slower than in-memory temp tables.

I could not figure out why this was happening, even though I could duplicate the on-disk temp table creation on my laptop, until I stepped back a little bit and compared last week’s statistics to this week’s, did a little research online, and found it’s the result of two bugs of sorts.

For above mentioned workflow app, we subscribed to the MySQL Enterprise service, at least for the first year. It comes with an automated advisor which gives you some performance graphing and also attempts to advise you on ways to improve database performance. It’s not bad but I’m not sure it’s worth $3K/server/year.

These two graphs are examples of what it produces - one for last Friday May 9 AM, the other for this Friday May 16 AM. They show the number of temporary tables created and number of on-disk temporary tables created.

Last Friday:

temp-tables-friday09.png

This Friday:

temp-tables-friday16.png

Compare the scales on the two graphs; the worst temp table peak this morning is about one third that of last Friday morning, and the sustained number is much lower at under 200 compared to over 500. After a code update on production earlier this week, I had focused on the on-disk-to-total ratio being much, much higher, and had overlooked the fact that the overall numbers were down significantly.

Once I noticed that, I thought I was getting closer. Enterprise Advisor gives me a little message like so:

temp-tables-excessive.png

I figured I just had to up one of MySQL’s memory buffers a bit more to get the last temp tables off the disk, and spent some time experimenting with that.

No joy.

After much time spent loading Rails pages and running the queries to see if I could get them to increment my development MySQL’s created_tmp_disk_tables counter, I stumbled upon the fact that when one issues a ‘SHOW COLUMNS FROM table’, MySQL not only creates an on-disk temp table due to the type of data it presents (LONGTEXT), it counts it as such in the performance stats. Yikes. Bug if you ask me.

OK, that’s fine and all, you say, but according to all the comments from all the people on all the sites about Rails’ behavior in a production environment, Rails doesn’t issue those incessant ‘SHOW COLUMNS FROM’ commands in production mode, where classes are cached. Only in development mode so you don’t have to restart the web server every time you tweak your code.

Right?

Wrong.

Turns out that Rails in production mode (i.e. config.cache_classes = true) still issues those commands for the join tables used in has-and-belongs-to-many (many-to-many) relationships. Perhaps because they’re not a class unto themselves. Bug.

Combine the Rails bug with MySQL’s odd buggish behavior that a command to describe a table is counted as an on-disk temp table in performance analysis, and you’ve got an ongoing problem getting accurate info on the number of temp tables being generated. Bummer.

On the bright side, I’ve reduced overall temp table usage by perhaps two-thirds, and I feel very comfortable saying based on the high ratio seen in the graph that all but a handful of the on-disk temp tables reported are the result of the MySQL bug.

:lock => true, or, MySQL sees the glass half full

May 16th, 2008

I recently had occasion to uncover the fact that a database transaction in MySQL isn’t a real transaction, at least by my way of thinking, unless you tell MySQL you’re serious about it.

This came up in a Rails app I’ve written for workflow management here at Gigantic News Corporation. While I had carefully wrapped every database activity relating to file check-ins and check-outs, among other things, in a Ruby “transaction do … end” block, once we applied some load to the system (i.e. went live) we started to see two people managing to check out the same job at once.

OK, that’s weird.

After a little bit of puzzling, it turns out MySQL is a glass-half-full kind of gal. When you do a SELECT to find a record and then an UPDATE to make the record yours, even inside a SQL transaction … it’s not really yours. Something like this:

BEGIN;
SELECT id FROM jobs WHERE checked_out_to IS NULL LIMIT 1;
/* get 1 */
UPDATE jobs SET checked_out_to = ‘me’ WHERE id = 1;
COMMIT;

By default MySQL does this with “optimistic locking” - so the row is not locked during the SELECT, only during the UPDATE.
To me this feels a bit like writing one’s name on an envelope full of cash, stuffing it in an ATM, and hoping for the best - even though you forgot your ATM card at home.

See, I cut my database teeth on Sybase. Say whatever you want about Sybase - and believe me I could say a lot - one thing it isn’t, is optimistic. It assumes the worst, and as a result things always turn out for the best. I was always good-and-goddamned sure that if I wrapped things inside a transaction block, it either all happened or didn’t, and no-one else on earth was able to get a wayward command executed in the middle while it was happening.

Enter pessimistic locking (’FOR UPDATE’ in MySQL). For you Railers, that’s ‘:lock => true’, like so:

find(:first, :conditions => ‘checked_out_to IS NULL’, :limit => 1, :lock => true)

See the MySQL info here, and ActiveRecord info here - bottom line is you have to append ‘FOR UPDATE’ to the end of your SELECT in MySQL to make sure your transaction is a real transaction. This yields a modest change:

SELECT id FROM jobs WHERE checked_out_to IS NULL LIMIT 1 FOR UPDATE;

*sigh* I feel like this is something I should have known by now, given about 9 years of MySQL use. On the other hand, it also feels like maybe something is VERY STINKING WRONG with the default transaction processing method in MySQL.

I’m not getting duplicate job checkouts anymore. Now if I could get InnoDB to stop deadlocking and killing requests, it would be smooth sailing.