FreeBSD Documentation – 6.12 Tuning Disks

FreeBSD Documentation – 6.12 Tuning Disks:
6.12.1.2 vfs.write_behind

The vfs.write_behind sysctl variable defaults to 1 (on). This tells the file system to issue media writes as full clusters are collected, which typically occurs when writing large sequential files. The idea is to avoid saturating the buffer cache with dirty buffers when it would not benefit I/O performance. However, this may stall processes and under certain circumstances you may wish to turn it off.

I have been seeing some weird performance issues: slowdowns and high loads with the busy processes in the “inode” run state, all of which are httpd processes (load of 18 on a single CPU machine and 4-5 process all splitting 100% of system time). From my reading of this, I guess there is some contention for disk writes (ie, logging). I toggled this sysctl off and hey, presto, loads dropped like a rock. A symptomatic fix, but it will do for now.

more perl fun, or barnyard webservices

I found that Cafepress doesn’t support any kind of webservices or other APIs to display products. So I decided to hack something together myself.

I grabbed a copy of my storefront page and pulled out the information I needed, stuffed the resulting lines into an array, and pulled out a random line.

Randomsp

Now to automate this and see how it goes.

visual logging

Another need to use rrdtool arose. I want to track the ups and down of disk usage compared to CPU load, so here’s what I came up with.

iostat returns some data like this:
% iostat
tty ad0 ad1 acd0 cpu
tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in id
0 179 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 17 0 4 1 79

A little time with the man page and I settled on this incantation:

% iostat -tda -c2 | tail -1 | awk '{ print "N:" $3 ":" $6 ":" $9 ":" $16 }'
N:0.00:0.00:0.00:79

So to create an RRD around that, I used this:
rrdtool create iostat.rrd --step 300
DS:ad0:GAUGE:300:0:1000 RRA:AVERAGE:0.5:1:1200 RRA:MIN:0.5:12:1200 RRA:MAX:0.5:12:2400
DS:ad1:GAUGE:300:0:1000 RRA:AVERAGE:0.5:1:1200 RRA:MIN:0.5:12:1200 RRA:MAX:0.5:12:2400
DS:md0:GAUGE:300:0:1000 RRA:AVERAGE:0.5:1:1200 RRA:MIN:0.5:12:1200 RRA:MAX:0.5:12:2400
DS:cpu:GAUGE:300:0:100 RRA:AVERAGE:0.5:1:1200 RRA:MIN:0.5:12:1200 RRA:MAX:0.5:12:2400

and then I created a wrapper script to both update the RRD and extract the graphs:

Iostat-1

Since iostat returns the idle time and I wanted load, I had to insert a CDEF in the graph instructions: a gentle introduction to Reverse Polish Notation, to be sure.

And the resulting graphs are here.

new camera

Well, we’re getting this one to replace our lost Coolpix 4300. I put a lost notice on craigslist today, but I’m not optimistic.

 Images Products 25513 360

The 5400 has a lot going for it and it comes with a $200 rebate, making the net cost $300 — less than the 3400 was. I considered replacing the 4300 with some I found on eBay, but once the price of those got north of $200, it didn’t make sense. The difference in price is more than offset by the features on the 5400.

No idea if it will get here in time for Saturday: I still have an old school APS film camera so we’ll have some documentary evidence of the carnage.

Now playing:Cumberland Blues by Grateful Dead from the album “Europe ’72

this one goes to 11

Brad DeLong’s Semi-Daily Journal: A Weblog: Yet More Intellectual Property Weirdness:

Graphing Calculator has been part of the Macintosh ever since. Teachers around the world use it as an animated blackboard to illustrate abstract concepts visually. It shipped on more than twenty million machines. It never officially existed.

Why did Greg and I do something so ludicrous as sneaking into an eight-billion-dollar corporation to do volunteer work? Apple was having financial troubles then, so we joked that we were volunteering for a nonprofit organization. In reality, our motivation was complex. Partly, the PowerPC was an awesome machine, and we wanted to show off what could be done with it; in the Spinal Tap idiom, we said, “OK, this one goes to eleven.”

I still remember seeing this in early 1994 and thinking how cool it was. A great story and a great idea: I am downloading the freeware version (it no longer ships with new hardware) just to see it again.

The army we have is as good as it gets

You are our soldiers in Iraq who a few months ago were just Boys! Boys workin the hype for Friday night’s football game. Or out cruisin on a Saturday night hoping to “get lucky”.

You are the boys we have asked to be men
in a real big hurry!

Take a look at this photo-collage tribute to “the army we have.” They’re as good as it gets and more than we deserve.

I look at a kid of 22/24 learning how to use prosthetic legs or to get through the day without his arm and think of the armchair generals who thought this was going to be easy, that the people would strew the streets with rose petals, who blame the soldiers for their lack of planning and reluctance to see that they were wrong.

I’m guessing we won’t see the 101st Fighting Keyboarders talking about these images and the sacrifice they represent.

trying FireFox again

This is a list of the most common keyboard shortcuts in Firefox, and the equivalents in Internet Explorer and Opera.

I installed the FlashBlock plugin and it seems to work as advertised. In the meantime, I had to look up some information on navigating with keyboard (Safari’s simple top and bottom of page commands get used a lot). So if you’re interested, here’s the table of shortcuts in the fine Mozilla family of products.

pessimism may be what’s called for

mozdev.org – flashblock: index:

Flashblock is an extension for the Mozilla and Firefox browsers that takes a pessimistic approach to dealing with Macromedia Flash content on a webpage and blocks ALL Flash content from loading. It then leaves a placeholder on the page that allows you to click to view the Flash content.

Thanks to a comment, I may try FlashBlock. I wasn’t aware of any correlation between my CPU spinouts and Flash-larded pages, but that doesn’t mean it wasn’t a factor.

Now playing:The Other Side Of Summer by Elvis Costello from the album “The Very Best Of Elvis Costello (Disc 1)” | Get it

camera shopping

 Bigpics Nikon 25507
We left our Nikon CoolPix 4300 somewhere the other night at a company Christmas dinner party: we’re not even sure where it was left, but the restaurant hasn’t found it. We’re assuming it’s gone for good. Fortunately we took all the pictures off it before we went out . . .

So it’s time to hunt up a replacement: we’ll want to take some pictures Christmas morning, I expect. eBay has a few, local stores have some, so we’ll likely find one. It’s just a nuisance. One thing I learned from the experience: don’t use a camera bag. I never use one — a camera that small fits in your pocket and belongs there — a bag is just one more thing to keep track of, and with two kids underfoot, and a crowded restaurant to navigate, etc., who needs that?

Now playing:It Takes A Lot To Laugh, It Takes A Train To Cry [Live] by Bob Dylan And The Rolling Thunder Review from the album “Live 1975 – The Rolling Thunder Revue (Bootleg Series Vol. 5) (Disc 2)” | Get it