You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/12/16 07:39:21 UTC

[GitHub] merlimat opened a new pull request #3199: Use direct memory instead of Heap to determine a broker is "overloaded" in memory usage

merlimat opened a new pull request #3199: Use direct memory instead of Heap to determine a broker is "overloaded" in memory usage
URL: https://github.com/apache/pulsar/pull/3199
 
 
   ### Motivation
   
   When a broker is configured with a relatively low JVM heap size, it might be reporting it's "overloaded" by exceeding the default threshold of max 85% of Heap memory used, when in fact it's not overloaded.
   
   The reason is that the jvm heap will grow and shrink like:
   
   ![image](https://user-images.githubusercontent.com/62500/50051148-ef994c00-00c1-11e9-9d79-29b04e2e958a.png)
   
   This is typically not a problem with larger heap sizes (and using the `-XX:G1NewSizePercent=50` flag which forces G1GC to do young gen collection when the 50% threshold is filled up. In this case the heap will be cleaned well before the 85% value is reached.
   
   On the other hand, on smaller heaps like the above example with `-Xmx512MB`, since the load report uses the instant value of the heap size, it might be signaling that the broker is overloaded (mem usage >85%) while in fact is just that JVM is deferring the GC until the 512MB are entirely filled up.
   
   Since there is no way to get a good proxy measure for "real" heap usage from JVM, we should just rather use the direct memory for the overload considerations.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services