You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Thawan Kooburat (Created) (JIRA)" <ji...@apache.org> on 2012/03/21 18:59:39 UTC

[jira] [Created] (ZOOKEEPER-1429) Response packet caching for get request

Response packet caching for get request
---------------------------------------

                 Key: ZOOKEEPER-1429
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1429
             Project: ZooKeeper
          Issue Type: Improvement
          Components: server
    Affects Versions: 3.4.3
            Reporter: Thawan Kooburat
            Priority: Minor


Motivation:
In our scalability testing, we have a large number of clients watching for data changes. All of them fetch data immediately when a watch is fired. We found that GC consumes significant amount of CPU time in this scenario. In our prototype, we added packet caching for getData() request and found that GC time reduced by 40%. GC that we used is Concurrent Mark Sweep Collector. 

Design and Implementation:
Similar to our prototype, we plan to add packet caching for getData() request using LRU caching. The cache stores serializes response (data + stat) in form of ByteBuffer indexed by its pathname. The cache entry is invalidated when there is a set request that affect the data. 
The data structure that we plan to use for LRU cache is CacheBuilder [http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/cache/CacheBuilder.html] because it provides many tunable features that we try and use in the future. Currently, the eviction policy will be based on memory size. Otherwise, we can implement it using LinkedHashMap if we do not want to rely on external library.  


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira