maoling edited a comment on issue #1098: ZOOKEEPER-3560: Add response cache to serve get children (2) requests. URL: https://github.com/apache/zookeeper/pull/1098#issuecomment-544462596 - Look at the original design from ZOOKEEPER-3180, it wants to put the serialization of response into the cache to save the cost of serialization of read operation. - My confusion is: this optimization is only appiled to the big znode(> 1MB), it should be enable by default? - I also see the description mentions this optimization will ease GC's overhead - serialization is a cpu-cost operation? Putting more thing into the cache(memory) will hava more likely to trigger the full GC(STW)? - I also doubt about: adding this cache will bring about some issues about read inconsistency? but if client is FIFO, it may not a problem. - I also do a benchmark for this feature:my env:8Core,16G,256SSD; standalone mode;1000 znodes operationcount=1000(all is read).thread count=1 ``` Test for small znode: data length:100 -Dzookeeper.maxGetChildrenResponseCacheSize=-1 -Dzookeeper.maxResponseCacheSize=-1 Sample 5 times:Throughput(ops/sec): (778.21 + 954.19 + 1019.36 + 974.65 + 1209.18)/5=987.11 -Dzookeeper.maxGetChildrenResponseCacheSize=1000 -Dzookeeper.maxResponseCacheSize=1000 cache_hits_rate:5012.0/(5012 + 989.0)= 83% Sample 5 times:Throughput(ops/sec): (794.91 + 833.33 + 953.28 + 812.34 + 591.36)/5=797.04 ------------------------------------------------------------------------ Test for big znode: data length:10000 -Dzookeeper.maxGetChildrenResponseCacheSize=-1 -Dzookeeper.maxResponseCacheSize=-1 (704.72 + 475.05 + 900.90 + 736.91 + 836.82)/5=730.88 -Dzookeeper.maxGetChildrenResponseCacheSize=1000 -Dzookeeper.maxResponseCacheSize=1000 cache_hits_rate:4012.0/(4012.0+988.0)=80% (508.13 + 891.26 + 811.03 + 901.71 + 985.22)/5=819.47 ------------------------------------------------------------------------ Test for big znode: data length:100000 -Dzookeeper.maxGetChildrenResponseCacheSize=-1 -Dzookeeper.maxResponseCacheSize=-1 (299.94 + 339.21 + 318.67 + 261.98 + 364.29)/5=316.81 -Dzookeeper.maxGetChildrenResponseCacheSize=1000 -Dzookeeper.maxResponseCacheSize=1000 cache_hits_rate: 4021/(4021+979)=80% (349.77 + 332.66 + 386.39 + 392.92 + 343.76)/5=361.1 ``` My observation is: enable this feature will have a performance degradation for small znode. For big znode have slight performance improvement(almost 15%), not notable as expected.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
