Brian's Waste of Time

Sat, 26 Jan 2008

an interesting milestone: mod_slow

Crossed some kind of threshold today, I am sure. I needed a quick'n'dirty web server hack so broke out C for an apache module! What is happening to me?!

Basically, I needed something to put behind a proxy to do some load and capacity testing of the proxy. As I wanted to have things like the size of the response and time of the response be easily configurable on the load generator I needed to hack something up...

#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "ap_config.h"
#include "apr_time.h"
#include "apr_strings.h"

static int handler(request_rec *r)
{
    if (r->args)
        apr_sleep(apr_atoi64(r->args) * 1000);
    return DECLINED;
}

static void register_hooks(apr_pool_t *p)
{
    ap_hook_handler(handler, NULL, NULL, APR_HOOK_MIDDLE);
}

module AP_MODULE_DECLARE_DATA slow_module = {
    STANDARD20_MODULE_STUFF, 
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    register_hooks
};

This very nicely lets me drop artificial slowdowns in front of the the default handler (serve up files) so I can control "processing time" and file size (pick the file with the size I want): http://binky/big.html?2000 Sweet! Am kind of floored that the first solution which leapt to mind for me was an apache module in C, though!

For some reason, putting the sleep in fixups doubled the sleep time, so I made it a declined handler and things worked fine. Need to figure out why.... someday.

2 writebacks [/src/apache] permanent link

Tue, 13 Feb 2007

Niq's Apache Modules Book is Out!

Woo hoo, my copy of Nick's Apache Modules Book (amazon link) arrived. It is basically the best available guide on writing apache modules around. Nick was kind enough to share an early draft with me and I have thoroughly dog-eared and abused my printout of that. Am glad to have the final copy in my hands :-)

0 writebacks [/src/apache] permanent link

Sat, 07 Oct 2006

ApacheCon US 2006 TODO List

Henri got it started, so I'll go ahead and list my goals as well :-)

I guess I have a much less ambitious list than some others, but hey, I bet I complete mine ;-)

0 writebacks [/src/apache] permanent link

Mon, 14 Aug 2006

Sri Lanka Bombings

The most recent bombing in Colombo was all of 200 meters from some of my friends' offices. Meanwhile, several other colleagues are in Colombo for a conference at the moment.

These are the some of the same folks who wrote Sahana for disaster management. Grrr.

3 writebacks [/src/apache] permanent link

Sun, 02 Apr 2006

Ted for the Win!

Ted Husted wins...

Q: How many ASF committers does it take to change a lightbulb?

A: Three. One to hold the bulb and two to turn the ladder while chanting "+1".

Kathy Sierra takes the honorable mention:

According to Sierra, "As a music style, Emo represents emotionally-charged punk rock--Emo is short for 'emotional'. What David and I have done is apply the underlying sensibilities of Emo music to the typically un-emotional world of computer programming.

0 writebacks [/src/apache] permanent link

Tue, 07 Mar 2006

Chapter 2: In Which Susie Lays Down the Smack

Susie corrects an issue with some sharp words =)

Oracle has been making a lot of noise about open source lately. Sadly, some reporters take everything in a press release at face value. Whether Oracle is knowingly wrong or some guy said "it's mentioned as an option for authentication, so it must be embedded," is an open question. Considering how much ASF software is embedded in Oracle products, and how careful they are with intellectual property, I should think they know better than to release a factually wrong press release. Oh well.

On the other hand, I do really like Susie's suggestion that Oracle release BDB under a ASL compatible license -- then it very likely might be embedded like sdbm as it is a damned good database.

Aside from Oracle, I should think that no reporter would just repeat a press release as fact. Has fact checking become passe? I know it is amongst bloggers, but don't all the traditional journalists keep decrying bloggers for just those things? Doh!

1 writebacks [/src/apache] permanent link

Thu, 15 Dec 2005

ApacheCon US 2k5: Heading Home

Sitting in the San Diego airport waiting for a delayed flight =( I even got here early to be safe, spend almost no time in security, and now... wait. That said, is a nice chance to unwind. I have been running on nerves most of the conference for various reasons. Really, I won't get to unwind until (hopefully) Saturday, but this is a wee bit of a teensy breather.

Was a great conference, ApacheCon is still my favorite, bar none =) I wound up doing lots of DB PMC business, which was actually good as it was face to face instead of email to email. Got lots of hacking done as well, but most of it was day job stuff -- a few non-day-job things deserve note though.

Paul Querna gave me a great tutorial on writing apache modules. It has been... a long time (a decade maybe?) since I have hacked any C, and really it was much more C++ than C even then. So, in between writing this and taking breaks from writing I am continueing to hack at mod_wombat, which is the most r0xx0ring apache module yet found, it, er, well, it prints out the wombat's name and age! Woots!

Actually, I really like the module system's design, it makes lots of sense and is straightforward (as straightforward as C gets for a professed ruby hacker) to work in. I also like pulling 1100+ requests per second on my powerbook. Expect more mod_wombat hackery to come!

Trustin Lee's tutorial on MINA (somewhere in the apache directory project, no internet to get the correct link) which is a wonderful looking framework for implementing network protocols. Really slick -- you basically provide a codec and it does the select magic (or however NIO does it on your platform) to slam app level frames/packets/whatevers at you. Really looks like a snap. Alex says it has no external deps, in which case... WOOT!

Julian Cash (google him) was at the conference making photos. He is brilliant. Go find his site (supersnail.[something]) and look over his work.

Lots of exciting Derby announcements. Ted Leung (google again, he'll be on top) blogged one of the most exciting derby things -- Francois [argh, cannot remember his family name] has written an Ajax client for Derby. Yep. Woot!

Caught up with bunches of people I love catching up with and met a passel of people I hadn't yet had the opportunity too. Apache and ApacheCon rock.

1 writebacks [/src/apache] permanent link

Sat, 10 Dec 2005

ApacheCon US 2005: Day -1

Got to hotel, Torsten shows up in line, then Alex, then Leo =)

0 writebacks [/src/apache] permanent link

Mon, 28 Mar 2005

ApacheCon Europe Sessions =)

Three of my talks were accepted for ApacheCon Europe! Woo hoo! I'll be speaking on Managing Open Source, an Introduction to Rules Engines using Drools, and Cheap, Fast, and Good: You can have it all with Ruby on Rails.

The schedule isn't up, but the times and days are attached to sessions, reachable via the speaker list, so you can figure it out if you try hard. It looks like a great session lineup, and a lot of good (the ones I have heard before) speakers, and promising topics from people I haven't.

I've never been to Germany and dont know much German. This'll be fun =)

1 writebacks [/src/apache] permanent link

Tue, 23 Nov 2004

ApacheCon 2004 Thoughts

I'm long overdue in writing up my thoughts on ApacheCon 2004. It was a very good conference, though it wasn't really a conference. More so than last year, my first ApacheCon, it was a gathering of friends and acquaintances.

What I take away from ApacheCon, this year, I take from series of conversations, between individuals and groups. Two thoughts with pithy comments, and one thought with no particular accompanying comment. The first stretches back to JavaOne (the Thirsty Bear, really)....

David, who, when I lamented that no one seemed to know the right way to go on something, and the lack of agreement was creating lethargy, pointed out to me that picking a direction when none is obvious, doing it, trusting it, and convincing others to take action and make decisions is what leadership is all about. Oh yeah, duh =) This conversation actually occured at JavaOne, and it was a quick smack to the face then. It's been rumbling around in my noggin since, and a number of conversations at ApacheCon brought it back to my forethought.

The first thing that brought it back were a series of independent conversations on the same topic between variously, Erin, Santiago, Ted, and myself. They tended to look at the direction development was going, and looked at the problem of languages, platforms, and people. The conversations ranged from language features and feels to the pointlessness of language, to MDA, to human language (which, imho, programming languages are simply a variant thereof), to attitudes and realities of building systems. May delve into the ideas later, as I am far from convinced I walked away with the right ideas. That said, those conversations brought me back to David's comment. I have opinions about what is right. I may not know the end-state, but there are definate thnigs which seem right to me.

The way we *talk* about programming and building systems (the two are converging, thank you), the language we use to implement those (I talk Ruby, and cron, and Java, and SQL, and multicast, and TCP, and files, and functions, and components, etc) does have a massively profound effect upon what happens in those. Language and thought are closely entwined, the exact relationship is subject of too many academic papers for me to dive into while blogging -- people have said more, and more intelligently, than I can rehash here easily -- but I hold that to be true.

The attitude towards building systems matters -- it should be fun, or it should be automated -- and not automated by $20 / hour to India -- automated by $500 to Newegg. This resonates with the common feeling (which I feel too) that Ruby is fun, that *nix is fun, that open source is fun. Fun is playing, and playing is learning -- especially for geeks. Geeks love to learn, and if they find somehting fun, it is usually because it is stretching their brain. Make note of fun things -- they make you smarter (yes, that means that for a lot of fairly smart people, Doom makes them smarter, somehow).

So to take a cue from Nike, and Paul Graham's most recent essay, go do something about it.

The second pithy comment came from Craig, who asked why bother to do something if it isn't going to be ambitious. This goes back to my reinventing the wheel thoughts from months back. Dwelling on it, there are different ways of reinventing wheels. One way sets out to duplicate the Michelin but in pink. Another way looks at the Michelin, and decides it won't work very well on a tricycle. Another way looks at the Michelin and says "this is crap, I could get 300,000 miles to a set of tires, with better traction, and less road noise by..." Finally, someone looks at a Michelin and creates a log with uneven edges, but that is easier to test.

The first wheel reinvention is masturbation. The second wheel reinvention is pragmatic. The third wheel invention is ambitious. The last is ego. Ambition is in the interesting one, as it is the one that changes the world. Craig was talking about pouring effort into open source projects, ones for which you aren't really recompensed by classical means, or where you could, much mroe easily, and knowing it, be better recompensed for doing something else. Ambition changes the world, for the better. Lots of Apache projects have had this kind of ambition, and have realized it, which is why it resonates with ApacheCon.

These first two ideas are heady things, but the third underlies them. ApacheCon filled me, again, with the importance of humility. The first two can start you down the path to the dark side ;-) But humility, in the classic sense (that being the antithesis of love for thyself), allows these things to actually happen, and really, really happen big. I observed, a while back but just held the thought for a long while, that open source in the Java community is extremely different from open source in the rest of the Unix tradition. Classically, an open source project is someone's. Postfix is Wietse's, linux is Linus's, qmail is DJB's, reiserfs is Hans's, etc. This isn't always true, but is more often then not. In the world of Java though, the opposite holds true. Most Java projects, even those with a strong and identifable leader, are a team's. Tomcat, log4j, JBoss, Hibernate, Eclipse, AspectJ, Groovy, Cocoon, etc. The most successful projects are associated with a team, not a person.

This isn't because of some inherent altruism in Java programmers. It is because, I suspect, open source came to Java mostly through Jakarta. Whether you like it or not, most open source Java projects use Jakarta as a template. Apache has long held humility to be a core value. Heck, there raged recently arguments to remove all @author tags, it is taken to such an extreme. This grew out of the BSD branch of open sourced, but came to fruition at Apache. You don't get involved with Apache to get famous, you do it to accomplish things. The people who have been involved with Apache for a long time seem to adopt this, or drift (or flame) away. So ApacheCon certainly resonates with this idea.

There were also some great sessions that somehow managed to be attended despite all this =)

0 writebacks [/src/apache] permanent link

Sat, 06 Nov 2004

Had to refer them to someone else...

FROM THE DESK OF BARRISTER SAMUEL AGBALA
FIRST CLASS OF LAW CHAMBERS
NO 45 OLD ROAD IKEJA, LAGOS NIGERIA
ONTACT E-MAIL:(barristersamuelagbala@lawyer.com)

ATTN: Apache

Dearest Friend

I am Barrister SAMUEL AGBALA a Solicitor at law.I am the
Personal Attorney to Mr.Albert Apache,a national of your
country, who use to work with shell development company in
Nigeria.

Too good! I don't know if I can represent Apache in this matter though ;-)

0 writebacks [/src/apache] permanent link

Thu, 04 Nov 2004

Derby Coding Contest at ApacheCon!

IBM is putting up a ThinkPad T42 as a prize for a coding contest at this year's ApacheCon. Not many details yet -- those to be announced at the con.

The contest involves developing code using the Apache Derby package (http://incubator.apache.org/derby/). There is documentation about the package on the project's Web site, and one of the ApacheCon tutorials the Sunday before the conference is a half-day devoted solely to the Derby software ? and to make it even more useful, that tutorial has been made free! So if you're interested in participating but aren't sure what Apache Derby is all about, there's still time and opportunity to learn from the documentation or in an intensive class given by one of the community developers.

Oh yeah, the Derby tutorial on Sunday is free now! I'm signed up =)

0 writebacks [/src/apache] permanent link

Fri, 16 Apr 2004

Apache DB PMC

Looks like I have been elected to the Apache DB Project PMC. Sort of scary =)

3 writebacks [/src/apache] permanent link