SlideShare a Scribd company logo
GlusterFS Translators
Almost Live Tutorial
Jeff Darcy
August 28, 2012
Session Overview
● Build a “negative lookup” caching translator
● add functionality
● hook things together
● build
● configure
● debug
● Almost live - see each step as code is written,
built, and run
The Problem
Dir A

file 4
Dir B
file 1

Dir C

file 3
Dir D
file 2
● First process misses in A/B/C
● Second process has no “memory” of misses,
searches from the beginning again
● Idea: cache the misses, return immediately
On the Shoulders of Giants
++++
Minor Changes 1
Back for Seconds
Minor Changes 2
Boiler Plate
init
fini
Header File
Updating the Cache (negatives)
Updating the Cache (positives)
Checking the Cache
Final Pieces (create and mkdir)
Time to Build
Almost There
Original Volfile
Modified Volfile
Running in a Debugger
Setting First Breakpoint
First Failed Lookup
Cache Kicks In
How Well Does It Work?
● Simulate PHP workload
● 1000 files spread across 10 directories
● 80% of requests to 10% of files
● test time for 10000 searches
● Numbers for comparison only
● debug build
● wimpy test machines (GigE)
Getting a Baseline
Are You Ready?
Interlude: glupy
● Write translators in Python
● Uses extending/embedding, ctypes module
● Brand new project
● weekend hacking, mid-August 2012
● still implementing 70+ operation types
● Article coming soon in $major_publication
Python Lookup Function
Python Callback Function
Python Setup
Yet Another Volfile
Scripting Languages Aren't So Slow
Conclusion
● Even simple translators can produce big
effects
● Writing translators isn't that hard
● Writing glupy translators will be even
easier
● What would you like GlusterFS to do
today?
Resources
http://hekafs.org/index.php/2011/11/translator-101-class-1-setting-the-stage/
http://hekafs.org/index.php/2011/11/translator-101-lesson-2-init-fini-and-private-
context/
http://hekafs.org/index.php/2011/11/translator-101-lesson-3-this-time-for-real/
http://hekafs.org/index.php/2011/11/translator-101-lesson-4-debugging-a-
translator/
https://github.com/jdarcy/negative-lookup
https://github.com/jdarcy/glupy
http://www.gluster.org/

More Related Content

Lcna example-2012