liuxunorg opened a new pull request #3442: [ZEPPELIN-4283] Choose which server 
to run the interpreter process
URL: https://github.com/apache/zeppelin/pull/3442
 
 
   ### What is this PR for?
   Currently creating an interpreter in cluster mode,
   Run on a server that has the least memory resources in all servers in the 
cluster,
   However, jdk does not accurately obtain memory usage.
   So, modify to the average policy and start the same number of interpreters 
in each server.
   
   
   Obtaining the operating system's memory usage through the 
OperatingSystemMXBean is quite different from the actual physical memory usage.
   The CPU information is accurate.
   
   ```
   OperatingSystemMXBean operatingSystemMXBean
       = ManagementFactory.getPlatformMXBean(OperatingSystemMXBean.class);
   
   // Returns the amount of free physical memory in bytes.
   long freePhysicalMemorySize = 
operatingSystemMXBean.getFreePhysicalMemorySize();
   
   // Returns the total amount of physical memory in bytes.
   long totalPhysicalMemorySize = 
operatingSystemMXBean.getTotalPhysicalMemorySize();
   
   // Returns the "recent cpu usage" for the whole system.
   double systemCpuLoad = operatingSystemMXBean.getSystemCpuLoad();
   
   int process = Runtime.getRuntime().availableProcessors();
   ```
   
   
   ### What type of PR is it?
   Improvement
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/ZEPPELIN-4283
   
   ### How should this be tested?
   [CI Pass](https://travis-ci.org/liuxunorg/zeppelin/builds/583024446)
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   

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


With regards,
Apache Git Services

Reply via email to