Bryan Beaudreault created HBASE-28009:
-----------------------------------------

             Summary: Document netty memory tunings
                 Key: HBASE-28009
                 URL: https://issues.apache.org/jira/browse/HBASE-28009
             Project: HBase
          Issue Type: Improvement
          Components: netty
            Reporter: Bryan Beaudreault


Netty can work pretty well out of the box, but you can protect your deployment 
from edge cases by tuning a few knobs:
{code:java}
-Dorg.apache.hbase.thirdparty.io.netty.maxDirectMemory
  By default, netty will use your -XX:MaxDirectMemorySize as the limit for its 
own off-heap memory usage. If you use any other off-heap memory features of 
hbase, this could cause a problem. For example, ByteBuffAllocator, BucketCache, 
or off-heap memstore. You should set netty's maxDirectMemory explicitly, and 
make sure to offset HBASE_OFFHEAPSIZE accordingly. Otherwise you risk OOM if 
netty comes under heavy load.

-Dorg.apache.hbase.thirdparty.io.netty.tryReflectionSetAccessible=true
  If you are running java9 or greater, the above maxDirectMemory setting will 
not take effect unless you also set this. Java9+ has extra security features 
which would typically cause a reflective setAccessible call to fail. But HBase 
uses a variety of --add-opens calls to enable access to Unsafe libraries, and 
these will also enable setAccessible to work for netty. Setting this to true 
will enable the feature which allows your custom maxDirectMemory to be be 
honored.{code}
 

We will be adding further protections in HBASE-27947 which we can also document 
here, but those have not been finalized yet.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to