Packaging Ruby Enterprise Edition into RPM
It’s unfortunate that past versions of Ruby have gained a reputation of performing poorly, consuming too much memory, or otherwise being “unfit for the enterprise.” According to the fine folks at Phusion, this is partly due to the way Ruby does memory management. And they’ve created an alternative branch of Ruby 1.8 called “Ruby Enterprise Edition.” This code base includes many significant patches to the stock Ruby code which dramatically improve performance.
Phusion advertises an average memory savings of 33% when combined with Passenger, their Apache module for serving Rails apps. We did some testing of our own, using virtualized Xen servers from our Spreecamps.com offering. These servers use the DevCamps system to run several separate instances of httpd for each developer, so reducing the usage of Passenger was crucial to fitting into less than a gigabyte of memory. Our findings were dramatic: one instance dropped 100MB down to 40MB. (The status tools included with Passenger were very helpful in confirming this.)
There has been some discussion on the Phusion Passenger and other mailing lists about packaging Ruby Enterprise Edition for Red Hat Enterprise Linux and its derivatives …
hosting redhat ruby spree
Inside PostgreSQL - Clause selectivity
One of the more valuable features of any conference is the so-called “hall track”, or in other words, the opportunity to talk to all sorts of people about all sorts of things. PGCon was no exception, and I found the hall track particularly interesting because of suggestions I was able to gather regarding multi-column statistics, not all of which boiled down to “You’re dreaming—give it a rest”. One of the problems I’d been trying to solve was where, precisely, to put the code that actually applies the statistics to a useful problem. There are several candidate locations, and certainly quite a few places where we could make use of such statistics. The lowest-hanging fruit, however, seems to be finding groups of query clauses that aren’t as independent as we would normally assume. Between PGCon sessions one day, Tom Lane pointed me to a place where we already do something very similar: clausesel.c
“Clause selectivity” means much the same thing as any other selectivity: it’s the proportion of rows from a relation that an operation will return. A “clause”, in this case, is a filter on a relation, such as the “X = 1” and the “Y < 10” in “WHERE X = 1 AND Y < 10”. PostgreSQL uses …
postgres
Using the new-style Google Analytics pageTracker functions in Interchange
For a while now there have been two different ways to setup the JavaScript calls to report traffic back to Google Analytics. The older method uses functions names that mention “urchin,” while the newer method uses a function named “pageTracker”. This post describes an approach for using the new method at a standard Interchange store.
You can see an example of the new method of reporting a page view here. Nothing Interchange-related is required for normal page tracking, but you may want to use a variable for the Google Account Number, of which more below.
If you have your Google Analytics account setup to treat the website as an E-commerce site, then you can also add the order tracking tags to your receipt page, so that it sends order data over to Google Analytics at the time of conversion. The order tracking tags can be viewed here. This gist shows the typical Interchange tags you might want to use to transmit the order specifics. Of course you might need to change the field used for the category for the products since not everyone uses the prod_group field from the products table to hold this information.
As you can see, both normal and the order-conversion scripts need to be …
interchange analytics
The importance of offline community
Today, the June issue of the Open Source Business Review debuts. It features nine women who are active in open source development—as developers, organizers and business leaders.
I wrote about offline community, and how techies in Portland, OR manage to get connected to each other, and how they’ve encouraged participation from women. You don’t often find women at a user group or even a tech-focused meetup at a restaurant or bar. Portland, somehow, has managed to encourage the women in the community to participate and lead. I talk about what I think the factors were that led to the higher percentage of women involved in the community today.
Let me know what you think!
community
Git rebase: Just-Workingness Baked Right In (If you’re cool enough)
Reading about rebase makes it seem somewhat abstract and frightening, but it’s really pretty intuitive when you use it a bit. In terms of how you deal with merging work and addressing conflicts, rebase and merge are very similar.
Given branch “foo” with a sequence of commits:
foo: D --> C --> B --> A
I can make a branch “bar” off of foo: (git branch bar foo)
foo: D --> C --> B --> A
bar: D --> C --> B --> A
Then I do some development on bar, and commit. Meanwhile, somebody else develops on foo, and commits. Introducing new, unrelated commit structures.
foo: E --> D --> C --> B --> A
bar: X --> D --> C --> B --> A
Now I want to take my “bar” work (in commit X) and put it back upstream in “foo”.
- I can’t push from local bar to upstream foo directly because it is not a fast-forward operation; foo has a commit (E) that bar does not.
- I therefore have to either merge local bar into local foo and then push local foo upstream, or rebase bar to foo and then push.
A merge will show up as a separate commit. Meaning, merging bar into foo will result in commit history:
foo: M --> X --> D --> C --> B --> A
\
E …
spree git
PostgreSQL with SystemTap
Those familiar with PostgreSQL know it has supported DTrace since version 8.2. The 8.4beta2 includes support for several new DTrace probes. But for those of us using platforms on which DTrace doesn’t exist, this support hasn’t necessarily meant much. SystemTap is a relatively new, Linux-based package with similar purpose to DTrace, available on Linux, and is under heavy development. As luck would have it, PostgreSQL’s DTrace probes work with SystemTap as well.
A few caveats: it helps to run a very new SystemTap version (I used one I pulled from SystemTap’s git repository today), and in order for SystemTap to have access to userspace software, your kernel must support utrace. I don’t know precisely what kernel versions include the proper patches; my Ubuntu 8.04 laptop didn’t have the right kernel, but the Fedora 10 virtual machine I just set up does.
Step 1 was to build SystemTap. This was a straightforward ./configure, make, make install, once I got the correct packages in place. Step 2 was to build PostgreSQL, including the –enable-dtrace option. This also was straightforward. Note that PostgreSQL won’t build with the –enable-dtrace option unless you’ve already …
postgres
Google I/O 2009 day 1
I’m at Google I/O at the Moscone Center in downtown San Francisco, and today was the first day. Everything was bustling:
The opening keynote started with Google CEO Eric Schmidt, and I was worried wondering how he would make over an hour be interesting. He only took a few minutes, then Vic Gundotra, VP of Engineering, led the rest of the keynote which had many presenters showing off various projects, starting with 5 major HTML 5 features already supported in Chrome, Firefox, Safari, and Opera:
Matt Waddell talked about Canvas, the very nice drawing & animation API with pixel-level control. Brendan Gibson of Backcountry.com used this at SteepandCheap.com and sister sites for the cool People on Site graphs (with a workaround for Internet Explorer which doesn’t support Canvas yet). Also a quick demo of Bespin, an IDE in the browser.
Matt Papakipos showed off o3d, 3-D in the browser with just HTML 5, JavaScript, and CSS. Also the new <video> tag that makes video as easy as <img> is. Geolocation has come a long way with cell tower and wi-fi ID coverage over much of the globe.
Jay Sullivan, VP of Mozilla, showed off Firefox 3.5’s upcoming features. Basically all of the …
conference
Writing Procedural Languages — slides
Although I’ll be working to change this, the slides for my “Writing a PostgreSQL Procedural Language” tutorial available from the PGCon website are from an earlier iteration of the talk. The current ones, which I used in the presentation, are available here, on Scribd.
conference postgres