<p>I am working on improving the utilization of cluster, and the cluster is YARN and will be Kubernetes.</p>
<p>My question is that how to improve the utilization ratio ?
How to think this question, are there some methods?
For YARN, and for Kubernetes?</p>
<p>For YARN, I have read some articles or watched some videos.
YARN has NM and RM.</p>
<ol>
<li>Oversubscription based on historical job running data.  (<a href="https://databricks.com/session/oversubscribing-apache-spark-resource-usage-for-fun-and" rel="nofollow noreferrer">https://databricks.com/session/oversubscribing-apache-spark-resource-usage-for-fun-and</a>)<br/>
a. set appropriate MEMORY (5G) and CPU for job<br/>
b. set a buffer for the job (1G)<br/>
c. do preemption to actively on NM</li>
</ol>
<br/>
<ol start="2">
<li><p>Oversubscription based on the real time utilization. (<a href="https://research.facebook.com/publications/ubis-utilization-aware-cluster-scheduling/" rel="nofollow noreferrer">https://research.facebook.com/publications/ubis-utilization-aware-cluster-scheduling/</a>)<br/>
a. do not modify job settings<br/>
b. monitor the utilization and allocation of NM, do oversubscription to the node<br/>
c. do preemption actively on NM<br/></p>
</li>
<li><p>Oversubscription of NM resources<br/>
a. NM has 100G and 30 cores in physical, but announce have 120G and 40 cores.<br/>
b. preemption handled by spark or YARN framework.<br/></p>
</li>
</ol>

siyu
<p>I have had a lot of success with over subscription.  Classically users overestimate their requirements.</p>
<p>A cool tool that Linked in release is <a href="https://engineering.linkedin.com/blog/2016/04/dr-elephant-open-source-self-serve-performance-tuning-hadoop-spark" rel="nofollow noreferrer">Dr. Elephant</a>.  It looked at helping users tune their own jobs to help educate users/give them the tools to stop over subscription.  <a href="https://github.com/linkedin/dr-elephant" rel="nofollow noreferrer">https://github.com/linkedin/dr-elephant</a>.  It seems to have been quite for a couple of years but might be worth while to look at the code to see what they looked at to help you make some educated judgements about over subscriptions.</p>
<p>I don't have anything to do with <a href="https://www.pepperdata.com/" rel="nofollow noreferrer">PepperData</a> but they're tuning does use over subscription to optimize the cluster.  So it's definitely a recognized pattern.  If you want a service provider to help you with optimizing they might be a good team to talk to.</p>
<p>I would suggest that you just use a classic performance tuning strategy.  Record your existing weekly metrics.  Understand what going on in your cluster.  Make a change - Bump everything by 10% and see if you get a boost in performance.  Understand what going on in your cluster.  If it works and is stable do it again the following week.  Do that until you see an issue or stop seeing improvement.  It takes time and careful recording of what's happening but it's likely the only way to tune your cluster as it's likely special.</p>
