Recent Posts

oh-my-zsh reaches over 500 contributors

December 01, 2013

Earlier today, I noticed that we now have over 500 developers from around the globe who I have accepted pull-requests from[^1^](#fn1){#fnref1 .footnote-ref role=”doc-noteref”}. That is so fantastic.

Thanks to each and every one of you who has helped make this project so wonderful for others. :-)


  1. ::: {#fn1} This number could be a lot higher if I spent more than a hour or two a week on this, but I’m a big fan of slow and steady… a good number of the open pull-requests are themes at the moment.↩︎{.footnote-back role=”doc-backlink”} :::

Reducing MySQL's memory usage on OS X Mavericks

November 24, 2013

Recently, I found myself re-installing everything from Homebrew and began to notice that MySQL was consuming nearly half a gig of memory. Given that I don’t do too much with MySQL on a regular basis, I opted to override a handful of default configuration options to reduce the memory footprint.

As you can see, a fresh MySQL install via homebrew was consuming over 400mb of memory.

Here is how I reduced my memory footprint:

$ mkdir -p /usr/local/etc

Unless you already have a custom MySQL config file, you will want to add one into this directory.

$ vim /usr/local/etc/my.cnf

We’ll then paste in the following options into our file… and save it.


# Robby’s MySQL overrides
[mysqld]
max_connections = 10

key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K\

Finally, we’ll restart MySQL.

$ mysql.server stop

If you have MySQL setup in launchctl, it should restart automatically. After I did this, my MySQL instance was now closer to 80mb.

So far, this has worked out quite well for my local Ruby on Rails development. Mileage may vary…

Having said that, how much memory are you now saving?

See you at LessConf and RailsConf?

April 09, 2013

Hey all,

It’s been a while (most of my blogging is over on the Planet Argon blog..). but I’m hoping to have some technical-related posts coming in the near future.

If you’ll be at LessConf in Florida this week, I’ll be there. Do I owe you a drink?

Also, if you’re coming to visit Portland for RailsConf 2013 and will arrive the weekend before, you should join us on a hike. If you can’t make it, be sure to say hello at the conference!

Hope all is well!

Cheers,
Robby

Setting Akamai Edge-Control headers with Ruby on Rails

June 19, 2012

Just a short and sweet little tip.

Several months ago we moved one of our clients over to Akamai’s Content Delivery Network (CDN). Ww were previously using a combination of Amazon S3 and CloudFront with some benefits, but we were finding several key areas of the world were not s covered by Amazon (yet) for asset delivery. Along with that, we really wanted to take advantage of the CDN for more of our HTML content with a lot of complex rules that related to geo-targeting and regionalization of content.

I’ll try to cover those topics in another post, but wanted to share a few tidbits of code that we are using to manage Akamai’s Edge-control caches from within our Rails application.

With Akamai, we’re able to tell their Edge servers whether it should hold on to the response so it can try to avoid an extra request to the origin (aka our Rails application). From Rails, we just added a few helper methods to our controllers so that we can litter our application with various expiration times.


# Sets the headers for Akamai{lang=”ruby”}
# acceptable formats include:{lang=”ruby”}
# 1m, 10m, 90m, 2h, 5d{lang=”ruby”}
def set_cache_control_for(maxage=“20m”){lang=”ruby”}
headers[‘Edge-control’] = “!no-store, max-age=#{maxage}”{lang=”ruby”}
end{lang=”ruby”}\

This allows us to do things like:


class ProductsController < ApplicationController{lang=”ruby”}
def show{lang=”ruby”}
set_cache_control_for(‘4h’){lang=”ruby”}
@product = Product.find(params[:id]){lang=”ruby”}
end{lang=”ruby”}
end{lang=”ruby”}\

Then when Akamai gets a request for http://domain.com/products/20-foo-bar, it’ll try to keep a cached copy around for four hours before it hits our server again.

Announcing the 2012 Rails Hosting Survery

May 31, 2012

You might recall that back in 2009, we surveyed the Ruby on Rails community to gauge how people were deploying and hosting their applications. It’s been over three years, so we’ve decided to run it again…. I know… we’re crazy like that!

So… without further ado… we present the 2012 Rails Hosting Survey. We’ll be collecting responses for a month, so be sure to put it on your todo list.

Planet Argon is hiring

August 22, 2011

Hello all!

I’ve been so busy this year travelling (for pleasure and work) and helping grow the company that I’ve not had much to say here. Expect some posts soon!

In the meantime, if you’re looking for a new challenge… Planet Argon is seeking a few more Ruby on Rails developers. Interested? get in touch.