[ 
https://issues.apache.org/jira/browse/HBASE-5898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Todd Lipcon updated HBASE-5898:
-------------------------------

    Attachment: hbase-5898.txt

Here's a patch which implements the double checked locking. The first attempt 
to look up the value does so without locking it. If it fails, then it tries to 
acquire the lock, and checks again. If the re-check fails, then it actually 
goes to disk. Assuming that going to disk is slow, the extra check of cache 
should be inconsequential, but this made a big difference in throughput of a 
read-only in-cache workload.
                
> Consider double-checked locking for block cache lock
> ----------------------------------------------------
>
>                 Key: HBASE-5898
>                 URL: https://issues.apache.org/jira/browse/HBASE-5898
>             Project: HBase
>          Issue Type: Improvement
>          Components: performance
>    Affects Versions: 0.94.1
>            Reporter: Todd Lipcon
>         Attachments: hbase-5898.txt
>
>
> Running a workload with a high query rate against a dataset that fits in 
> cache, I saw a lot of CPU being used in IdLock.getLockEntry, being called by 
> HFileReaderV2.readBlock. Even though it was all cache hits, it was wasting a 
> lot of CPU doing lock management here. I wrote a quick patch to switch to a 
> double-checked locking and it improved throughput substantially for this 
> workload.

--
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

        

Reply via email to