| [ |
mood |
| |
hard-workin' dank |
] |
| [ |
music |
| |
the roots - phrenology - thought@work |
] |
While walking to the Highlander tonight around 0100, I suddenly realized what seems my first Great Insight (which likely means it was realized by Dijkstra in 1965 or so, scribbled down in inscrutable EWD Dutchlangtechnik and forgotten, until Knuth came upon it, corrected a minor flaw, and deemed it insufficiently notable to include in TAOCP's small I/O section):
The great advantage (as device speeds increase and multicore pervades, asymptotically the only advantage) of edge-triggered event polling interfaces is NOT the reduction of system calls, but the idempotency -- and thus parallelism -- to which it gives rise.
Event queue logic capable of rigorously and robustly driving edge-triggered event notification must be independent of queueing nondeterminism. This is not true for systems with level-triggered cores, and gives rise to many difficulties when attempting true multi-instance parallelism; such designs parallelize via functional decomposition into large chunks of asynchronous code with small critical sections, as opposed to iterative parallelism. Only the latter, of course, can be made to arbitrarily scale.
I've recently reimplemented my ICAP server snare using the edge-triggered interfaces provided by Linux and FreeBSD, and with that alone reduced latency across a broad testing pattern to <%50 of our closest competitor (I annihilate my reference implementation making use of libev, and I'd argue my core is just as generic for sd's, though it does not possess certain other properties (mainly signal- and timer-related genericness, due to optimizing assumptions I made of the underlying kernel -- ahhh, 2.6.23 was a good time)). Currently, snare takes advantage of multiple execution units only via process replication + client/network-based load balancing, allowing for gross asymmetries in the small (and god bless Dr. Kleinrock's execellent Queueing Systems texts, without which I could never model any of this shite, although I did amuse myself by attempting to apply turbulent flow/Rayleigh-Taylor methods to such problems over a long weekend months ago. Results included: fatigue, eye strain, reminder to self that I'm not a physicist). This weekend I've begun experimenting with parallelizing the core in toto, take no prisoners, damn-the-feedbacks-full-speed-ahead, and the results are awe-inspiring.
I ought be able to begin using kernel splicebufs (see tee(2), splice(2) and vmsplice(2) [3]) in an optimization orthogonal to all of this, achieving true zero-softcopy (ie just two DMAs) transaction processing. When 10Gb starts DCA'ing directly into L2 cache, I want to be ready to soar with it. Single pass, baby, nothin' but net; girl, let me touch you there, I wanna feel you.
Should I pull this off, I think snare might replace tako as the code of which I'm most proud -- I never got to take tako the places I wanted to. Reflex was too small; I had too much to do and too little time for experimentation; the mysteries and incantations were yet unknown to me; the techniques were nascent and nebulous in my mind. Had I have remained there another year, or had justben or stnuke or sstrickl backing me up for a year longer...sigh, dashed hopes and idle dreams. But this, this is huge -- go shove map reduce up your asses; I've got truly scalable I/O with negligible contention and minimal thread overhead, capable of running like code possessed on anything from a 1024-node Inifiniband cluster [0] to a 32-CPU eServer to that old PII in your basement.
It already eats less CPU, serving several hundred connections at a time on a UP P4, than the freakin' SNMP daemon [1]...with an RSS of less than 30MB. lol. f'n awesome.
countdown to grad school: 28 days omfg!!!!! zounds i can't wait!!!
Sorry that I never post here anymore, sigh. I'm not sure why; I'd like to think I've grown out of an attention-starved phase (phase? life), but it's more likely that I've just become boring. Worry not: I still hold down my side of the ATL, collectin' so much grass po-po's thinkin' I mow lawns, getting burned by the Great Game in the Sky and every now and then taking a point for the home team. I just can't anymore seem to imagine that people're interested in the little musings that float to my heap's root...also, the Nick Black band has firmly seized our common google share [2], which I guess provides less incentives to keep the Word Horde flowing. Beyond that, I've started spending much more free time reading and preparing for the Road to Ph-dizzlehood; I fully intend to compete for primacy among my fellow grad students, and must be tanned, rested, and ready.
[0] not that there'd be any reason to do this [1] admittedly, this is net-snmpd (not the native bsnmpd(8)) on freebsd. but still. [2] I know this sounds paranoid and nuts, but I think they're blacklisting me or something. Check this shit out, for instance -- reddit links to the actual text are found, but not a one of the entry (which certainly used to show up). wtf? information wants to be free yo! [3] FreeBSD's zero_copy(9) is like a satire. I've scraped more sensible API's off the dark side of my nutsack.
|