You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Elliott Clark (JIRA)" <ji...@apache.org> on 2012/10/23 23:44:13 UTC

[jira] [Updated] (HBASE-5898) Consider double-checked locking for block cache lock

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

Elliott Clark updated HBASE-5898:
---------------------------------

    Attachment: HBASE-5898-0.patch

We saw this on a production cluster.

A single data block was being requested by all ipc handlers.  This caused a great deal of lock contention.  Todd's patch fixed the issue and caused reads to go back to a normal duration.

This patch is almost identical to Todd's patch.  It makes the second try to get a block from the block cache not count as a miss.
                
> 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
>            Assignee: Todd Lipcon
>            Priority: Critical
>         Attachments: 5898-TestBlocksRead.txt, HBASE-5898-0.patch, 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
For more information on JIRA, see: http://www.atlassian.com/software/jira