You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Tao Xie <xi...@gmail.com> on 2010/09/19 10:05:19 UTC

block cache

Now my scenario is running ycsb doing heavy read. I compared the results of
setting hfile.block.cache.size to 0.2 with 0.  I found with the factor 0 the
hbase metric 'get_avg_time' is even smaller. Maybe I should turn off block
cache in such scenario. I wonder if there are performance tests show the
benefits of block cache?  Or there are other configurations for me to pay
attention to?

Btw, I give hbase 18G memory.

Re: block cache

Posted by Tao Xie <xi...@gmail.com>.
Yes, I agree. But in my case, I checked the regionserver log. See the
snippet below, is  a 77% hit ratio still low?

2010-09-20 00:06:25,991 DEBUG
org.apache.hadoop.hbase.io.hfile.LruBlockCache: Cache Stats: Sizes:
Total=2856.691MB (2995457464), Free=741.30914MB (777318984), Max=3598.0MB
(3772776448), Counts: Blocks=45098, Access=1906554, Hit=1474704,
Miss=431850, Evictions=65, Evicted=372179, Ratios: Hit
Ratio=77.34918594360352%, Miss Ratio=22.650814056396484%,
Evicted/Run=5725.83056640625
2010-09-20 00:07:25,991 DEBUG
org.apache.hadoop.hbase.io.hfile.LruBlockCache: Cache Stats: Sizes:
Total=2856.691MB (2995457464), Free=741.30914MB (777318984), Max=3598.0MB
(3772776448), Counts: Blocks=45098, Access=1906560, Hit=1474710,
Miss=431850, Evictions=65, Evicted=372179, Ratios: Hit
Ratio=77.34925746917725%, Miss Ratio=22.650742530822754%,
Evicted/Run=5725.83056640625
2010-09-20 00:08:25,992 DEBUG
org.apache.hadoop.hbase.io.hfile.LruBlockCache: Cache Stats: Sizes:
Total=2856.691MB (2995457464), Free=741.30914MB (777318984), Max=3598.0MB
(3772776448), Counts: Blocks=45098, Access=1906566, Hit=1474716,
Miss=431850, Evictions=65, Evicted=372179, Ratios: Hit
Ratio=77.34932899475098%, Miss Ratio=22.650671005249023%,
Evicted/Run=5725.83056640625
2010-09-20 00:09:25,992 DEBUG
org.apache.hadoop.hbase.io.hfile.LruBlockCache: Cache Stats: Sizes:
Total=2856.691MB (2995457464), Free=741.30914MB (777318984), Max=3598.0MB
(3772776448), Counts: Blocks=45098, Access=1906572, Hit=1474722,
Miss=431850, Evictions=65, Evicted=372179, Ratios: Hit
Ratio=77.3494005203247%, Miss Ratio=22.650599479675293%,
Evicted/Run=5725.83056640625
2010-09-20 00:10:25,992 DEBUG
org.apache.hadoop.hbase.io.hfile.LruBlockCache: Cache Stats: Sizes:
Total=2856.691MB (2995457464), Free=741.30914MB (777318984), Max=3598.0MB
(3772776448), Counts: Blocks=45098, Access=1906578, Hit=1474728,
Miss=431850, Evictions=65, Evicted=372179, Ratios: Hit
Ratio=77.34947204589844%, Miss Ratio=22.650529444217682%,
Evicted/Run=5725.83056640625
2010-09-20 00:11:25,991 DEBUG
org.apache.hadoop.hbase.io.hfile.LruBlockCache: Cache Stats: Sizes:
Total=2856.691MB (2995457464), Free=741.30914MB (777318984), Max=3598.0MB
(3772776448), Counts: Blocks=45098, Access=1906584, Hit=1474734,
Miss=431850, Evictions=65, Evicted=372179, Ratios: Hit
Ratio=77.34954357147217%, Miss Ratio=22.65045791864395%,
Evicted/Run=5725.83056640625


2010/9/20 Todd Lipcon <to...@cloudera.com>

> On Sun, Sep 19, 2010 at 1:05 AM, Tao Xie <xi...@gmail.com> wrote:
>
> > Now my scenario is running ycsb doing heavy read. I compared the results
> of
> > setting hfile.block.cache.size to 0.2 with 0.  I found with the factor 0
> > the
> > hbase metric 'get_avg_time' is even smaller. Maybe I should turn off
> block
> > cache in such scenario. I wonder if there are performance tests show the
> > benefits of block cache?  Or there are other configurations for me to pay
> > attention to?
> >
> > Btw, I give hbase 18G memory.
> >
>
> If the "working set" of your YCSB test is larger than your available RAM,
> and you are using the "uniform" YCSB distribution, it's likely that the
> cache isn't buying you any efficiency - ie you have something like 100%
> miss
> rate. So disabling it gets you a bit of speedup since it avoids GC churn.
>
> If you use a smaller working set and a zipfian distribution you'll probably
> see a much better hit rate, and YCSB will indicate better response times
> for
> gets.
>
> -Todd
>
> --
> Todd Lipcon
> Software Engineer, Cloudera
>

Re: block cache

Posted by Todd Lipcon <to...@cloudera.com>.
On Sun, Sep 19, 2010 at 1:05 AM, Tao Xie <xi...@gmail.com> wrote:

> Now my scenario is running ycsb doing heavy read. I compared the results of
> setting hfile.block.cache.size to 0.2 with 0.  I found with the factor 0
> the
> hbase metric 'get_avg_time' is even smaller. Maybe I should turn off block
> cache in such scenario. I wonder if there are performance tests show the
> benefits of block cache?  Or there are other configurations for me to pay
> attention to?
>
> Btw, I give hbase 18G memory.
>

If the "working set" of your YCSB test is larger than your available RAM,
and you are using the "uniform" YCSB distribution, it's likely that the
cache isn't buying you any efficiency - ie you have something like 100% miss
rate. So disabling it gets you a bit of speedup since it avoids GC churn.

If you use a smaller working set and a zipfian distribution you'll probably
see a much better hit rate, and YCSB will indicate better response times for
gets.

-Todd

-- 
Todd Lipcon
Software Engineer, Cloudera

Re: block cache

Posted by Tao Xie <xi...@gmail.com>.
Here is the gc log: http://pastebin.com/1bGZvMri

2010/9/19 Ryan Rawson <ry...@gmail.com>

> I'd love to see a GC log, and yes it can be possible for ParNew to
> take a long long time.
>
> Thanks,
> -ryan
>
> On Sun, Sep 19, 2010 at 1:20 AM, Tao Xie <xi...@gmail.com> wrote:
> > At first when I running the test, one of my regionserver shuts down. I
> found
> > the gc has problems on that node. Then I enabled the jvm options listed
> in
> > http://wiki.apache.org/hadoop/PerformanceTuning. After that, the test
> runs
> > well. I checked the log and I do not know if it's normal for ParNew  to
> take
> > as long as 500 ms. I will attach a snippet of that if necessary.
> >
> > Thanks.
> >
> >
> > 2010/9/19 Ryan Rawson <ry...@gmail.com>
> >
> >> What does your GC situation look like?
> >>
> >>
> >>
> >> On Sun, Sep 19, 2010 at 1:05 AM, Tao Xie <xi...@gmail.com>
> wrote:
> >> > Now my scenario is running ycsb doing heavy read. I compared the
> results
> >> of
> >> > setting hfile.block.cache.size to 0.2 with 0.  I found with the factor
> 0
> >> the
> >> > hbase metric 'get_avg_time' is even smaller. Maybe I should turn off
> >> block
> >> > cache in such scenario. I wonder if there are performance tests show
> the
> >> > benefits of block cache?  Or there are other configurations for me to
> pay
> >> > attention to?
> >> >
> >> > Btw, I give hbase 18G memory.
> >> >
> >>
> >
>

Re: block cache

Posted by Ryan Rawson <ry...@gmail.com>.
I'd love to see a GC log, and yes it can be possible for ParNew to
take a long long time.

Thanks,
-ryan

On Sun, Sep 19, 2010 at 1:20 AM, Tao Xie <xi...@gmail.com> wrote:
> At first when I running the test, one of my regionserver shuts down. I found
> the gc has problems on that node. Then I enabled the jvm options listed in
> http://wiki.apache.org/hadoop/PerformanceTuning. After that, the test runs
> well. I checked the log and I do not know if it's normal for ParNew  to take
> as long as 500 ms. I will attach a snippet of that if necessary.
>
> Thanks.
>
>
> 2010/9/19 Ryan Rawson <ry...@gmail.com>
>
>> What does your GC situation look like?
>>
>>
>>
>> On Sun, Sep 19, 2010 at 1:05 AM, Tao Xie <xi...@gmail.com> wrote:
>> > Now my scenario is running ycsb doing heavy read. I compared the results
>> of
>> > setting hfile.block.cache.size to 0.2 with 0.  I found with the factor 0
>> the
>> > hbase metric 'get_avg_time' is even smaller. Maybe I should turn off
>> block
>> > cache in such scenario. I wonder if there are performance tests show the
>> > benefits of block cache?  Or there are other configurations for me to pay
>> > attention to?
>> >
>> > Btw, I give hbase 18G memory.
>> >
>>
>

Re: block cache

Posted by Tao Xie <xi...@gmail.com>.
At first when I running the test, one of my regionserver shuts down. I found
the gc has problems on that node. Then I enabled the jvm options listed in
http://wiki.apache.org/hadoop/PerformanceTuning. After that, the test runs
well. I checked the log and I do not know if it's normal for ParNew  to take
as long as 500 ms. I will attach a snippet of that if necessary.

Thanks.


2010/9/19 Ryan Rawson <ry...@gmail.com>

> What does your GC situation look like?
>
>
>
> On Sun, Sep 19, 2010 at 1:05 AM, Tao Xie <xi...@gmail.com> wrote:
> > Now my scenario is running ycsb doing heavy read. I compared the results
> of
> > setting hfile.block.cache.size to 0.2 with 0.  I found with the factor 0
> the
> > hbase metric 'get_avg_time' is even smaller. Maybe I should turn off
> block
> > cache in such scenario. I wonder if there are performance tests show the
> > benefits of block cache?  Or there are other configurations for me to pay
> > attention to?
> >
> > Btw, I give hbase 18G memory.
> >
>

Re: block cache

Posted by Ryan Rawson <ry...@gmail.com>.
What does your GC situation look like?



On Sun, Sep 19, 2010 at 1:05 AM, Tao Xie <xi...@gmail.com> wrote:
> Now my scenario is running ycsb doing heavy read. I compared the results of
> setting hfile.block.cache.size to 0.2 with 0.  I found with the factor 0 the
> hbase metric 'get_avg_time' is even smaller. Maybe I should turn off block
> cache in such scenario. I wonder if there are performance tests show the
> benefits of block cache?  Or there are other configurations for me to pay
> attention to?
>
> Btw, I give hbase 18G memory.
>