Splash picture next

GCalendar Reminders

Google recently added the ability to create a birthday calendar. However, Google didn’t give one the ability to send reminders for the events on that calendar. This is the same thing that Apple has done for years with their Address Book and iCal integration. And I hate missing someone’s birthday when I don’t happen to look at my calendar that day.

I saw this as an opportunity for improvement. I also saw this an opportunity to learn about Google App Engine. So I wrote a python application that lets you schedule email reminders for the Contacts Birthday Calendar. In addition, you can select a specific hour in a specific time-zone to send the reminders at as well. The application use’s the Google App Engine user authentication and the Google Data AuthSub permission request API to get upcoming events for display and email reminders.

This gave me some good experience with Google App Engine’s scheduled tasks and Task Queues, as well as a chance to hone up on my Python. Without further ado, I present GCalendar Reminders. Feel free to use it to send yourself emails using the security of Google App Engine.


Benchmarking Redis and PRedis

At work, I recently was tasked with looking into some NoSQL solutions for upcoming projects. For various reasons, I focused on the open source Redis project. Redis looks to be adding new features quickly and seemed to be a great potential solution.

I then started looking into PHP clients as our current environment is mostly PHP. We require that the client support consistent hashing, and, from a quick search, a couple turned up. PRedis seemed to offer the most potential, and after some quick tests, also seemed to offer the greatest performance. So I set up a more elaborate benchmark of the the client and server package.

My test setup involved using 5 servers with between 2 and 5 enabled at a time on the clients (ie. I disabled up to 3 of the servers in the client configurations). For performance, I configured the servers to never write to disk, though periodically syncing to disk should not cause too much of a performance loss. In fact performance was most greatly affected by forcing an fsync after every write. I then had 9 other client boxes running the same code base, with all 9 enabled for each test.

Each client would start a master PHP process that forked 20, 30 or 40 child processes to simulate greater and greater load. Each forked PHP process then did 10,000 SETs on random keys with 4 byte payloads (early tests showed that payload size didn’t drastically affect the results). I was using the PHP 4.2.6 branch of the PRedis client, and had optimized it a bit so that it did fewer counts of the consistent hash array. I made the optimizations based on some results after profiling the code. I then had the master PHP process on each box repeat the test 5 times to help to average the test results.

I used dsh to start the test simultaneously on all the clients, timing how long it took the dsh process to start and finish executing. This was the amount of time it took to execute (5 repeats) * (9 client boxes) * (20, 30 or 40 client processes / box) * (10,000 requests) = X total requests. I then graphed the results below.

Graphing Requests / Second With Redis and PRedis

Graphing Requests / Second With Redis and PRedis

This ended up showing that with 9 clients, going up to 4 servers was the point of diminishing returns. Adding the fifth server (with that client box count) did not increase throughput, but rather, the throughput went down. The reason for this is most likely a combination of network interface contention on each client and higher overhead from consistent hashing. So with 9 clients, I found that the sweet spot, with my setup, was 4 servers. By adding more clients, along with more servers, the throughput would increase, instead of the decrease I was starting to see.


22nd Annual Tri For Fun #3

This post is pretty late, but I figured it is still good to post for record keeping. In June, I did the Tri For Fun #1 and it was the first triathlon for a couple of my friends. Well, I must have some great powers of persuasion, because I convinced two more people to start and complete their first tri. After at least two years, my sister Amy Streeter decided to do the great introductory course. In addition, Amy’s friend Margo Fahey also signed up for her first tri.

Starting the race, my goal as to finish in an hour or less. Looking at the last race, I thought that a 9 minute improvement was reasonable, despite the fact I spent a significant portion of the month between races in the Caribbean. I’d say my biggest weakness was still my cycling performance, though I was able to improve.

Split Distance (mi) Time (h:mm:ss.ms) Pace
Swim 0.227 6:35 29:00 min/mi
Swim to Bike Transition 1:59
Bike 11 30:33 21.6mph
Bike to Run Transition 1:35
Run 3.1 22:47 7:21 min/mi
Overall 1:06:28

Not the blowout improvement I was hoping for, but improvement none-the-less. Plus I beat Amy, Margot and Joe :) I am definitely looking forward to the next tri I’m doing.


Pictures From Alviso

This past Sunday, a buddy and I met up to head out on a photo shoot. I’ve had a goal of trying to take more pictures and also to think more about the pictures I’m taking, and going on a trip with the explicit goal of taking pictures is exactly what I need to do. We did this once before at the Arastradero Open Space in Palo Alto.

So Wenzhe and I met up and drove to a place he had visited before, Alviso, CA. Alviso is on the South edge of the San Francisco Bay, situated between Moffett and Milpitas. There are a number of older buildings, some train tracks and promised to hold some interesting subjects near sunset. I ended up taking quite a few shots (180+ in total) and narrowed it down to 31 pictures that I found interesting. One of my goals this trip was to think about different ways that a scene could be cropped once the picture was taken. So I’d take a picture thinking that it might work one way, but a subset of the frame could work with a different crop. So I tried experimenting with that in mind a bit.

Check out the pictures and let me know your thoughts.


22nd Annual Tri For Fun #1

This past Saturday I did the first in the Tri for Fun series in Pleasanton. This was my first race since Wildflower, and my first race since getting injured. The race went well, and I felt pretty comfortable the whole time, though my legs were quite tired. Which is to be expected after not running for over 6 weeks.

In addition, this was the first triathlon for my friends Joe and Rachel. They absolutely killed it and did very well. After they came and watched me do Wildflower, they got motivated to try a triathlon themselves. I suggested the Tri for Fun series as those races are nearby, quite fun and an easy course that is great for beginners. Both of them finished strong and are planning on doing more triathlons in the future. Here’s to the Wildflower Olympic race next year!

As this race doesn’t collect splits, I collected them myself and posted them below.

Split Distance (mi) Time (h:mm:ss.ms) Pace
Swim 0.227 7:21 32:20 min/mi
Swim to Bike Transition 2:37
Bike 11 34:10.0 19.32mph
Bike to Run Transition 1:19.0
Run 3.1 24:18.0 7:50 min/mi
Overall 1:09:47

Despite the year of experience since doing the exact same course, exercising more and, in general, being more prepared, I was slower in all three events. I wasn’t too much slower in the run or bike, which is good considering that I was injured. But it is still disappointing. As usual, I passed a lot of people on the run, and got passed on the bike. However, I’ve been starting to look into improving my cycling legs. I’ve got another Tri for Fun in 2 months, so I’ll see how well that training works out.


Wildflower

Wildflower: “The Woodstock of Triathlons”. I can now say this seems like a very accurate description.  This past weekend was the twenty-something-th running of the Wildflower Triathlon event at Lake San Antonio on the Central Coast.

Starting the Bike

Starting the Bike

I had first heard of Wildflower a few years back when my sister told me about an event she was going to where there was a giant party and, almost as an afterthought, a triathlon was held. As my interest in tri’s increased, I of course heard more about Wildflower. I came to find out that there are 3 events: the long course (a half Ironman), an Olympic distance course and a mountain bike sprint.

Then, sometime in the last couple months, I decided to start my 2009 Olympic distance tri season with Wildflower. The first thing I did after signing up was to begin to round up a posse to join me at the event. I managed to convince my friends Dean, Joe and Rachel to come. My sister and her friend also decided to volunteer, so I’d be seeing them on the course somewhere. The plan was coming along beautifully. Until I realized the Olympic event was on Sunday, and the other two were on Saturday. This was a major bummer as I was hoping to totally enjoy the festival and relax and camp after my race. Instead, I had to go through another full day of anxiety as I watched the other races. I just hoped to find a camping spot that wasn’t going to be too loud Saturday night.

So in the months leading up to the event my training consisted mostly of frequent CrossFitting, biking on some weekends, and when the event got closer, swimming a couple times a week.  I really should have done more cycling and running, but a combination of laziness and busyness led to more nights not running, and more excuses to no cycle places. Plus it was cold out lots of times! I did feel a bit underprepared for the event, and plan to change that feeling in the future, but I knew I could finish. Based on my previous Olympic distance tri, I set a goal of 3 hours and 30 minutes. Yes, this is 40 minutes slower, but I liked that it was a round number. I decided to shoot for around a 30 minute swim, 2 hour bike and an hour run. I knew the bike and run had more hills than other tris, and I suck at biking, so I added more time to them than my previous tri.

Originally, our posse was set to leave Friday night from the Bay Area, and drive down to Lake San Antonio where we would get to hang out all day Saturday before my race Sunday. But then a storm came in and dumped rain on us and we got scared. So we postponed our departure until Saturday morning, attempting to get down and witness part of the end of the long course bike and run. The drive down was (mostly) uneventful and got to drive next to athletes tackling Nasty Grade and Heart Rate Hill. I was not jealous of them. We finally arrived at the entrance to the lake, but had to wait for most of the bikers to make it back before we could drive down. So we hung out, ate lunch and eventually took a drive down the Olympic distance bike course before we were able to enter and setup camp. Saturday evening I setup my gear and prepared my transition bag before taking an Ambien to get the best sleep I could.

I woke up at 6:30am to prepare for the event. We had a nice breakfast before I began to change into my tri shorts. As I was getting them out of my bag, I noticed what seemed to be a hole in the butt. Upon closer examination, it was indeed a hole, a big hole at that. I have no idea when or how it got there, but I’m just hoping that I hadn’t been mooning the people of the Stanfurd pool for too long. The only option was to get a new pair, and quick. I found a good pair at the festival, changed, and proceeded to set up transition. Crisis averted.

In preparation for the race, Saturday was spent hydrating as much as possible. I know I succeeded because I woke up 3 times to pee Saturday night. For the race, I had 2 Gu packs on my bike, and one on my shorts for the run. I planned to have one at the top of Lynch Hill (the first bike hill out of transition), and then one after the 12 mile turn around. And then I had plenty of Gatorade. The race started at 9:20am and I finished a few hours later:

Split Distance Time (min) Pace Rank (overall) SF Tri Time
Swim 1.5 km 29:52 32:03 min/mi 1123 29:16
T1 4:33 4:04
Bike 40km 1:43:48 14.37 mph XXX 1:24:16
T2 2:59 3:55
Run 10km 53:00 8:32 min/mi 683 50:49
Overall 3:14:12 1262 2:52:21

[Official Results Here - Bib 5634]

So as you can see, I did better than my goal. My swim was almost dead on with my last race, and my run was only slightly slower, despite the fact that Wildflower has about a 1200 ft elevation gain in the run alone, and the SF tri was completely flat. As usual for me, the bike killed me. My super slow pace seriously hurt me. The top guys had paces of 23 MPH, with one guy at 27 MPH! I did pass 5 people on the bike. And only 2 of them had flat tires. There was no point in trying to count the number of guys who passed me. Though I’m sure I passed quite a few of them on the run. Obviously, I need to work on this area. I really think I just don’t know how to cycle, plus I’m just not used to it. So if you know how to cycle and want to give me tips, and/or have an indoor trainer for me to use, please let me know!

Race Finish

Race Finish

I felt really good at the finish, save for some initial feelings of wanting to puke. But that was cause I was sprinting the last couple hundred meters. I even had some gelato shortly after the race (thanks Dean, Joe and Rachel!). Also, I really do want to thank those guys for coming. I really, really liked having them at the various transition areas during the race. I also want to thank my sister Amy and her friend Margo for bailing on their volunteer duties to cheer and study. Having someone you know at the race cheering you on really boosts your spirit and gives you that much more energy and motivation to do your best and fight on, which is really important in endurance events. And having an entire posse, that is truly awesome :).

So what did I gain from this? I had an amazing weekend and really enjoyed the race. I’ve also decided that 2010 is the year of the half Ironman for me. Right now, I’m planning on doing the Wildflower long course. I’m going to do several more Olympic distance tris, and really work on that cycling (!) in preparation. Also, Joe and Rachel have been inspired to do the Wildflower Olympic distance course next year. I look forward to being at many of their races cheering them on!

As I write this today, the day after the race, I do so without being sore. I can feel that my muscles did something, but I have no trouble moving and would have hit up CrossFit today except for one thing: I am terribly sunburned. I put on sunscreen, but that much exercise and swimming just stripped it from my body. I can attribute this lack of soreness to two things: CrossFit is awesome, and that I should have given more yesterday during the race. It seems weird to have done 3 hours 15 minutes of exercise and feel the way I do today. Granted, I was a bit stiff for a bit yesterday, even after post event stretching, but not today.

A great race, with some great weather. Wildflower, til next year.


GMail IMAP Backup With mbsync on Ubuntu

Well, it sure has been a while since my last post on here. So I thought I’d kick it off with a discussion of how I went about getting my email backed up.

First, a description of my situation. I run all my email through GMail. I enjoy the interface and the fact that it is a cloud service; I can access my email seamlessly on my phone, my home computer, my work computer, some other computer, etc. However, I don’t want to lose all that information. Google is great, but who is to say that something terrible won’t happen and some (or all) of my mail is lost? So I wanted to setup some sort of backup. And then once I got that setup, make it automated.

At home, I run an Ubuntu box, that I just upgraded to 9.04, Jaunty Jackalope. This machine primarily serves as a media box, hosting video that streams to my Tivo off the 1.5TB RAID 5 array. I also use it as a network mounted TimeMachine box as well. Since I have extra storage on it, I figured I’d get something to sync my mail over IMAP periodically, and then I have a nice little backup.

After some searching, I came across two sites that had instructions using the utility mbsync (formerly isync). I found that following the instructions worked pretty well, though I had to customize the patch provided to get it to work with the version provided by Ubuntu.  And then I thought I’d detail my steps here for others to see.
(more…)


The North Face Endurance Challenge 10k

Over the weekend, I participated in a trail running 10k. I did the 10k distance, which turned out to be more difficult than my previous trail run. This course wasn’t as aggressive as the Dip Sea trail, with a sloping 1000 foot elevation gain, followed by a steep downhill back to the start, where we also finished.

I opted to do the 10k distance, and convinced my sister to also do the race, which was her first race. And I was informed about the race by some CrossFit friends who all did the 50k distance. Saul, Samantha and Dustin are pretty crazy for doing it, but accomplished the monstrous achievement. Saul wrote up the summary from their race over at the Peninsula CrossFit site. He also has some great endurance training ideas there too. So congrats to them and to my sister.

I’ve done the 10k distance a number of times before, though this was my first 10k trail race (though the Stintson 12k pretty much counts). I really think that I wasn’t as prepared physically as I should have been. My legs were still sore from my CrossFit workout the Wednesday before, where I did Barbara. So I ended up walking up the hill quite a bit more than I wanted to. But I’m pretty sure I made up some time on the downhill. The official results got posted, and my time was 55:53.7 minutes, for an average pace of 9:12 minutes /mile. This was good enough for 35th overall out of 255, 17th of 46 in my age division (ages 21-29), and 31st of 119 of all men in the 10k race. So I’m not fully happy with my result since I know I could have done better a day later and with more rest. However, Amy killed the race where she completed the course with a time of 1:03:25.6 minutes for 10:26 pace. I need to start training more to make sure I stay ahead of her pace.

Update: My split for the course was 36:39 to the aid station, which was at the top of the hill, 3.45 miles in, and then 19:13 from there to the finish (the final 2.75 miles).  This gave me a 10:37 pace up the hill and a 6:59 pace down the hill to the finish.  I really should have walked less going up the hill.


Stinson Beach Trail Run

Over the weekend, I participated in my first Pacific Coast Trail Runs event.  I did the Stinson Beach 12k which turned out to be a more difficult event than I expected.  The trail has a pretty aggressive elevation gain with just about all of the gain at the start of the trail.  Starting from Stinson State Beach, we ran 4.9 km uphill, going about 1600 feet before running along the side of the mountain for a short distance before turning pretty much straight downhill to go back to the beach.  The total elevation gain on the course was 1850 feet.

This was the second time I’d run a 12k distance race, with this one being decidedly harder than the bridge to bridge run in San Francisco I did last time.  In the 12k overall, I got 13th place, and got second place in the age group results. My time of 1:18:14 got me an average of a 10:43 minutes / mile pace. Seeing as how challenging the course was, I’m not disappointed in my results, but am confident that on my next run in December, I can turn it up a notch to 11.


2008 Treasure Island Olympic Triathlon

A couple months ago I heard about the San Francisco Triathlon on Treasure Island.  At the time, I knew there was a sprint and an Olympic distance, but relegated myself to the sprint distance. However, after the last triathlon I did, I just decided to try for the Olympic distance.  Last year, in 2007, I made a personal goal to do an Olympic distance tri in 2008, and the SF Triathlon seemed to be my last chance.

Well, I signed up for the event, which occurred yesterday morning.  The race took place on Treasure Island in the San Francisco bay. Treasure Island is part of the island the Bay Bridge passes through.  I woke up at the super early hour of 5am to make it to the island by 6am so I could check in and prepare my transition area before the early race start at 7:15am.

Since the island isn’t very big, the course was a series of loops.  The first event, swimming was 1.5km, where I swam twice around a triangle with 250m sides.  From there I jumped on my bike for a 40km bike course.  The 40km course consisted of 6 laps of a ~6.66km circuit.  After biking was the run, 3 laps at ~3.33km each, for a total of 10k.  The distance are the same as the ones used in the Olympics, making this an Olympic triathlon, and thus, much harder than the previous sprint triathlons I’ve done.

My initial estimate for the course was to complete it all in about 3 1/2 hours, broken down as follows: 30min for the swim, 2 hours for the bike, and 1 hour for the run. The estimate for the bike was taken from a recent 25.4 mile ride that I completed in just under 2 hours. This ended up being the estimate that was very exaggerated because the triathlon course was so flat.  With that being said, here is a breakdown of my results:

Split Distance Time (min) Pace Rank (overall)
Swim 1.5 km 29:16 31:24 min/mi 119
T1 4:04 268
Bike L1 15:01 16.5 mph 297
Bike L2 13:58 17.74 mph 328
Bike L3 13:50 17.91 mph 310
Bike L4 13:41 18.11 mph 282
Bike L5 13:31 18:33 mph 251
Bike L6 14:13 17.43 mph 234
Bike Total 40 km 1:24:16 17.64 mph 281
T2 3:55 418
Run L1 17:05 8:14 min/mi 139
Run L2 17:14 8:19 min/mi 146
Run L3 16:29 7:57 min/mi 114
Run Total 10 km 50:49 8:10 min/mi 132
Overall 2:52:21 202

So as has been the case with all the past tri’s I have done, biking is my weakest link.  I really need to do more bike training next time.  I’m pretty sure that the only people I passed on my bike yesterday were the people with flat tires (and there were a lot of them!).  The first place guy finished with a time of 2:04:49, which means I’ve got quite a bit of improvement to make. I’m not sure when my next tri is going to be, but now that I know what the Olympic distance is like, I know I can do many more of them.


     older »