Name: Adrian Chadd
Member since: 2000-04-04 17:58:16
Last Login: 2007-05-24 13:07:58
Homepage: http://www.creative.net.au/
Notes:
I work on a few projects, sproadically, in my spare time.
that includes freebsd, squid, ircd-hybrid and stuff I've forgotten.
In my spare time I'm working on some genetic programming engines.
COSS was originally implemented as an on-disk LRU. I'll describe the original implementation as I grabbed from Eric Stern now.
A filesystem is just a single large file or physical device.
A membuf - 1 megabyte in size - is initially allocated to represent the first megabyte of the filesystem. Objects are copied into the membuf if their size is known up front (and thus space can be 'pre-allocated' in the stripe.) When the stripe is filled up it is marked as "full" and written to the filesystem. Objects are added to the beginning of a linked list as this happens.
Objects are referenced by their offset on the disk: any read is first checked against the in-memory membuf list. If an object is found to be in a membuf then a copy of the object data is taken and the data is handed back to Squid. If an object is not found in a membuf it is read from the filesystem, placed at the head of the current membuf - and they are re-added to the head of the linked list - and the squid file pointer is updated to point to this new position.
As stripes are successively allocated and written to the filesystem in order the 'popular' objects stay near the 'head'. This happens until the last stripe on disk is written: at which point the write pointer is cycled to the beginning of the filesystem.
At this point the LRU implementation kicks in: the objects which are at the end of this linked list match those at the beginning of the filesystem. COSS will start at the end of the linked list and move backwards, deallocating objects, until it reaches the beginning of the next stripe. It then has enough room to allocate a 1 megabyte stripe (and its membuf.) at the beginning of the disk. It then fills this membuf as described above.
When this membuf is filled it writes the stripe to disk, frees the objects in the next megabyte of disk and then allocates a membuf and fills that.
This implementation wasn't complete:
When I adapted the codebase to use POSIX AIO I discovered a number of race conditions in the COSS code:
The nice features of COSS was the simple writing and object pool maintainence: writes were aggregated and predictable (being in 1 megabyte chunks.) Popular objects had more of a possibility of staying in the current membuf.
I recently took the code and began fixing the bugs. These included:
The problems seen so far:
Possible directions to take (although I do need some actual world-testing and statistics first!):
Interested in the work? I'm placing snapshots up on my squid website - here.
In short; it works, and it works fine.
The trouble now: how to rebuild the store index from disk during startup.
I've got it mostly stable. The main problem right now? The linux user-space Posix AIO support only seems to de-queue one op at a time per FD. I think this is severely hampering the disk performance; but there's little I can do about it for now. Grr.
Today's amusement #2: my little co-operative multitasking message-passing thingy is running and passing messages between modules. The most it can do? 10 million events in 14 seconds, and not one memory leak. I wonder if it'll leak memory during error conditions..
22 Mar 2006 (updated 22 Mar 2006 at 06:20 UTC) »
Updates:
* still owe a lot on my credit card. Wow, who would've thought financial planning was so crucial. :)
* bored at work. There's stuff to do, but its not challenging. Sigh.
* studying psychology/linguistics at UWA. Yes, I'm a second year (ie, not a first year). I gave up studying CompSci - first and second year stuff just frustrates me and I don't need frustrating things whilst I'm working full time.
What I'm currently working on:
* I'm a programmer for an online MUD. No, I won't say which. Its nifty though - it uses a proprietary engine and a crazy syntax which is the bastard child of C and BASIC. Very good for writing MUD code in.
* I'm still tinkering with fast network application frameworks: check my homepage for the CVS repo. "projects/col" has what I'm working on.
k certified others as follows:
Others have certified k as follows:
[ Certification disabled because you're not logged in. ]
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!