140 likes | 346 Views
Webcal: A Domain-specific Language for Web Caching Sumit Gulvani, Asha Tarachandani, Deepak Gupta, Dheeraj Sanghi Indian Institute of Technology, Kanpur, India Luciano Porto Barreto, Gilles Muller, Charles Consel INRIA/IRISA - Compose group, Rennes, France. Outline.
E N D
Webcal: A Domain-specific Language for Web Caching Sumit Gulvani, Asha Tarachandani, Deepak Gupta, Dheeraj Sanghi Indian Institute of Technology, Kanpur, India Luciano Porto Barreto, Gilles Muller, Charles Consel INRIA/IRISA - Compose group, Rennes, France
Outline • Limitations in existing web caches • A DSL-based approach • Language abstractions andExecution Model • Status and on-going work
Limited Flexibility of Web Caches • Existing caches provide too limited customization • Fixed policies • Do not consider changes in the execution environment
Reasons for Extensibility • Why should caches be extensible ? • Universal solutions do not exist • Customized policies tend to provide better results • Caches should adapt to new users and applications
Problems in extending existing Cache Systems • Not structured for extension purposes • COTS, parameters... • Development time • Code hacking • Error-prone • Safety Can we do better ?
A DSL-based Approach • Why a DSL is useful for web caching ? • (-) Development time: • Provides powerful abstractions to the programmer improving productivity • (+) Layer decomposition: • Clear separation of functional components which eases code re-use • (+) Safety/robustness: • Improves safety via program verification • Ex: message loop detection and matching, program termination
What do we want to program ? • Policy => Program family • Removal • Prefetching • Placement • Inter-cache protocols • Others...
Event-action Model • Events • Temporal events • Transition events • Message arrival • Actions • Cache storehouse management: SQL-like • Communication - send • Cache statements - remove, prefetch, etc. • Event-action statements: jump, return, end • Others: definitions, assignments, if-then-else, etc.
Programming in WebCal • Define cache policies as a Finite State Machine (FSM) • Intercache protocol • Define policy events and their predicates • Timeouts • Write actions to be executed when an event is triggered Examples
Removal Policy define MAX_CACHE_SIZE 128Mb; FSM removal [ start { entrycode { event E1 = cacheSize > 0.8*MAX_CACHE_SIZE; } E1 -> ( remove from DOC_INFO_TABLE where contentType == "gif" until cachesize < 0.5*MAX_CACHE_SIZE; ) } ]
Prefetching Policy FSM prefetch [ start { entrycode { event E1 = at 00:00:00 hours; } E1 -> ( if cacheSize < 0.7*MAX_CACHE_SIZE { prefetch ("http://www.Mysite.Com"); ) } ]
Webcal Execution Model DSL Compiler WebCal Program Event-action Backbone Caching Policy in Java Policies Jigsaw Library Web Cache
Status and on-going Work • Webcal: • Working prototype using Jigsaw • Event-action backbone / Compiler • Tested policies: prefetching, removal, placement • Experiments • Inter-cache protocols