PakYak

Well, I have been talking about making a PakYak for a while now. This weekend, and to some degree even more so tonight, I started on it.
 This weekend I cut down a sheet of 1/2 inch Birch plywood into 1 inch strips and a 2 inch strip with a bit left over. Hence the tablesaw.

 I bundled up the 1 inch pieces into groups of 8 like this and tied them together so that they wouldn’t warp standing up in the corner like they are. Well, that’s the theory. They are also easier to handle this way.

 The sheet of plywood I got looks to be a “bad” piece for what I am doing. I am looking for strength, and voids in the plys of wood weaken the piece. Well my sheet looks to have several voids all at the same spot dead center in the middle of the board. A firm flex breaks the piece right in half. I guess this made it easier to handle the pieces for cutting. But I need a lot of 24 inch long pieces and with an inch unusable in the middle, I can only get two 24 inch pieces out of my 8 foot length! How frustrating.

 This is about half of a complete boat’s worth of pieces. I need to cut a dozen and a half 2 foot long pieces and a handful of little pieces between 7 and 4 inches yet.

Next step. drilling and shaping. They are all to be rounded with a 1/4 inch bevel. I am going to do this with a block plane instead of a router. The big reason is that the table saw ate up my power-tool allotment for a while and I don’t have a place to keep the saw, much less a table router as well. I also just like the sound of a good sharp block plane. That sizzle and pile of shavings just really adds a hand crafted feeling to the piece. Between cutting the pieces to length with a hand saw, and shaping all the edges by hand my need to “Make something with my hands” should be satisfied..

Table Saw

 Katie dropped in Thursday night unannounced. Lucky me! She had her brother’s truck, so after I took her to lunch today at a chinese restaraunt, we went to Lowes to pick up a table saw I have been looking at for a few weeks now and a sheet of plywood. The last saw they had. Every other person who walks through that door is likely to toss the box that the saw came in, but I am only going to use the thing every six months or so, right? Of COURSE my box is completely mangled. No point tearing the thing down and re-packing it for storage now.
 The saw is a “contractors” saw, so it is designed to be portable. The legs fold up, and it has a handle and wheels so it can be pushed around where you want it. Really quite slick. It weighs in at a trim 73 pounds. I am not going to want to put it up on a shelf or anything, but it is managable.
 The table expands to a pretty big size. The table goes out like 16″ before you can expand the table out with the rip fence on it. Pretty cool. There is a section in back to help hold the material as well. I also picked up 2 adjustable, folding roller stands. I knew I was going to have trouble manhandling a sheet of plywood by myself. I am likely to go get 2 more if I ever need to do a full sheet of plywood by myself again.
 This is all that is left of my $26.95 peice of 1/2 inch birch plywood. I am cutting it into 1 inch strips to make the frame of a folding kayak I am going to make. I made $2.21 worth of sawdust in the dust collector which caught probably 3/4 of the sawdust and on the ground. I had to go to Target and get a little hand broom to clean off the saw and clean up my mess.

I am tired. I walked about 5 miles today between going to Target and Skyline for supper, plus I was on my feet all afternoon assembling and working that saw – I am used to sitting on my duff all day long.

Oh yeah! I put the whole saw together and only had one little un-opened baggy of spare parts! (I think they are adjustment shims to square up the saw blade to the table incase it is off. The instructions don’t mention them beyond the parts list).

Library Thing

Ok, I have been a bit quite lately, I have been working on… stuff. You shall see, it’s the biggest thing since, well, I moved to Florida.

Anyway, I digress, I have added a new feature to my blog. I have a random list of books that I own courtesy of Library Thing in the narrow column. You can also search my current books.

I had ran across them a while ago, how long ago, I don’t remember, but it is that long ago (what, 3 minutes some of my friends may claim?). I have been meaning to check them out and whatnot, so tonight I did.

I found a use for my CueCat. That’s right, they allow you to scan in the ISBN bar codes with your CueCat directly. How is THAT for convenient. Talk about a BFO (blinding flash of the obvious). Pure Genius! The only thing I saw about it, is that I was mentally saying “beep” in my head every time I scanned a bar code. I was running around my apartment (read: stand up, reach, sit down) thinking “beep beep beep this is so cool beep beep”.

Now, too bad most of my books are in storage, at my folks place, etc. Now I have yet another reason to go back to Barnes & Noble’s and get more!.

Ten Dollar Dates

A friend of mine has started a new website. The site is all about inexpensive date ideas. http://www.tendollardates.com/

I think this may be an excellent resource for us guys to get a woman’s perspective on what we can do to be sweet. Cheap.

This should be an excellent resource for me down the road – good thing Katie doesn’t know about the site yet. I am going to subscribe to the RSS feed and get my daily dose of do-good ideas.

Lets all leave comments or trackbacks, and let her know we are interested so she gets into the habit of posting an idea a day. If you have any suggestions, feel free to leave a comment here with them or email them to me and I will forward them on to her..

Homepage Caching

I have been having a problem at work. My homepage is now getting 100,000 hits a month. My home page is big unfortunately, about 43Kb plus auxiliary files. But the worst part is the 10 different calls to the database under 5 different modules, each with it’s own connection to the DB. This racks up some serious MySQL disk IO along with logs, and all that other stuff. Needless to say, I have been encountering some minor performance issues.

Simple solution is to cache the homepage.

I want to be able to regenerate the homepage whenever I want. I want the homepage to regenerate itself periodically, especially immediately into a new day as much of the content on the homepage is date specific. I don’t want to do any extra work to process this cache.

For my implementation, I am taking advantage of the fact that Apache will search for an index page: index.html, index.php, default,htm etc. I let index.html be my rendered, static copy of my homepage with index.php being the dynamic version. The big trick is that every time index.php is called, it writes out to index.html. Now it’s just a matter of getting index.php called at appropriate times.

In index.php, I am using php’s output buffering to capture the content of the homepage. I then write that buffer, unchanged, out to index.html and to the web-browser.

At the top of my homepage you would see the following:

/* Output Buffer
* We are doing something a bit odd here. The home page is the most hit page on the site. There are a LOT of calls on the home page to database, etc.
*
* In an attempt to make the server load go down, this index.php file will write out an index.html file as a static file
* This takes advantage of the fact that apache is looking for index.html before index.php
* running index.php will create index.html
* removing index.html will cause index.php to run and create index.html
*
* A cronjob removes index.html hourly
* Admin tools that modify data that could be displayed on the homepage should cause to have deleted index.html
*
* You can manually force an update to index.html by loading www.r-world.com/index.php (a clever way is to have the webmaster bookmark index.php as his start page.)
*
*/

function callback($buffer)
{
// lets write this page out to index.html.
$indexbufferfilename = 'index.html';

$indexbuffererror = '';

if (!$handle = fopen($indexbufferfilename, 'w')){
$indexbuffererror .= "Cannot open file ($indexbufferfilename)n";
exit;
}

if (fwrite($handle, $buffer) === FALSE) {
$indexbuffererror.= "Cannot write to file ($indexbufferfilename)n";
exit;
}

//echo "Success, wrote ($somecontent) to file($indexbufferfilename)";

fclose($handle);

if(!empty($indexbuffererror))
{
mail('webmaster@r-world.com', "Error in creating homepage", $indexbuffererror);
}

// send the page to the browser
return $buffer;

}

ob_start("callback");

I then have the content of my homepage. I then end the page with a ob_end_flush(); as the very last line of code on the page.

This takes care of the creating of the homepage cache.

In order to dynamically have the cache created, I added a few lines of mod_rewrite to my .htaccess file that will check to see if index.html exists and has something in it or it calls an alternate file, my index.php. I found the idea on theApache1.3 URL Rewriting Guide.

My .htaccess file looks like:


Directory Index index.html index.php

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^index.html$ index.php [L]

I have several administration tools to edit data that is being displayed on the homepage. I have added an include to a file that simply deletes the index.html page. Now, whenever I modify data that may be displayed on the homepage, it is automatically displayed on the homepage as the homepage is re-created. I also have a cronjob that runs this file at the top of every hour.

As for how well it works. My average number of MySQL connections per second fell from 32 to 26 for a 20% reduction in MySQL calls. The CPU usage used by MySQL fell a couple of percentage points on the server, as several of the SQL statements for the homepage are 7 SELECT UNIONs that aren’t exactly trivial. The system Load Average also dropped about 33% as MySQL and apache aren’t hitting the drive near as much anymore.

The best part is that the PHP processing time has been taken out of the Load Time for the homepage. 1 poor sod per hour, and the first person to get the latest update will need to wait for the PHP processing (which everyone used to do anyhow) and writing out to disk. I also set me and my bosses bookmarks to load the index.php version of the page as whenever one of the two of us are looking at the site, we are likely looking to verify a change, and this will force an update.

Clever, eh?

.