Body: <p>What strategy of load balancing in k8s would be recommended between Slurm (think SGE) clusters?</p>
  <p>The reason I raise this is Slurm has a Pythonic API governing the queuing system.</p>
  <p>Information can freely pass from the queuing system to the load balancer in Nginx (k8s) via the API. The  load balancer here is not within the cluster (which uses &quot;round robin&quot;) that ensures all nodes are equally active, it's the load balancer in Nginx determining which cluster to place the job on. The jobs involved on the clusters will vary from being very quick (seconds) to really slow (days), therefore ideally the exact queue state of each cluster is preferred for determining which cluster is allocated.</p>
  <p>The load balancing strategies I am familiar with is</p>
  <ul>
  <li>&quot;Round robin&quot; (wouldn't work here)</li>
  </ul>
  <p>However, the others that are more applicable could be,</p>
  <ul>
  <li>Weighted round-robin method*</li>
  <li>Dynamic load balancing*</li>
  <li>Least connection method</li>
  <li>Resource-based method*</li>
  </ul>
  <p>... any others welcome.</p>
  <p>*, These methods would work if the state of the server's queue (headnode) was weighting or shifting the allocation of jobs, e.g. queue size and estimated time each job will take.</p>
  <hr />
  <p>Just to mention &quot;auto-scaling&quot; (e.g. AWS) has been mentioned as a solution. Thats a great idea. AWS is obviously one of the Slurm clusters in the description and they have auto-scaling. ParallelCluster (AWS) does auto-scaling without needing to use AWS autoscale (it can be configured to auto-scale). It's an inbuilt ability. Anyway I do fully appreciate the comment by @JamesShewey. In really complex architecture the suggestion is doable, i.e. to create a new ParallelCluster on demand, spinning a cluster is more demanding that a single instance.</p>
  <p>What I think is that &quot;resource based method&quot; would work because it would be aware of headnode activity.</p>
  
Comments: CC BY-SA 4.0
Comments: 2023-10-25T05:19:33.193Z
Comments: Maybe yanking a server from the cluster or pool using a health monitor would be a better option? Then you could depend on auto-scaling to make sure you still have nodes available for requests?
Comments: James Shewey
Comments: CC BY-SA 4.0
Comments: 2023-10-25T18:39:37.867Z
Comments: Auto-scaling is a great idea ... I've answered this below '------'. Thanks again.
Comments: M__
Tags: <kubernetes><amazon-ec2><nginx><load-balance><loadbalancing>
Title: Load balancing between Slurm clusters
UserDisplayName: M__
ThreadText: # Load balancing between Slurm clusters
  
  (Asked by: username_0 on 2023-10-24)
  
  What strategy of load balancing in k8s would be recommended between Slurm (think SGE) clusters?
  
  The reason I raise this is Slurm has a Pythonic API governing the queuing system.
  
  Information can freely pass from the queuing system to the load balancer in Nginx (k8s) via the API. The load balancer here is not within the cluster (which uses "round robin") that ensures all nodes are equally active, it's the load balancer in Nginx determining which cluster to place the job on. The jobs involved on the clusters will vary from being very quick (seconds) to really slow (days), therefore ideally the exact queue state of each cluster is preferred for determining which cluster is allocated.
  
  The load balancing strategies I am familiar with is
  
  * "Round robin" (wouldn't work here)
  
  However, the others that are more applicable could be,
  
  * Weighted round-robin method\*
  * Dynamic load balancing\*
  * Least connection method
  * Resource-based method\*
  
  ... any others welcome.
  
  \*, These methods would work if the state of the server's queue (headnode) was weighting or shifting the allocation of jobs, e.g. queue size and estimated time each job will take.
  
  ---
  
  Just to mention "auto-scaling" (e.g. AWS) has been mentioned as a solution. Thats a great idea. AWS is obviously one of the Slurm clusters in the description and they have auto-scaling. ParallelCluster (AWS) does auto-scaling without needing to use AWS autoscale (it can be configured to auto-scale). It's an inbuilt ability. Anyway I do fully appreciate the comment by @username_1. In really complex architecture the suggestion is doable, i.e. to create a new ParallelCluster on demand, spinning a cluster is more demanding that a single instance.
  
  What I think is that "resource based method" would work because it would be aware of headnode activity.
  
  **Tags:** kubernetes, amazon-ec2, nginx, load-balance, loadbalancing
  
  > **Comments:**
  > **username_1**: Maybe yanking a server from the cluster or pool using a health monitor would be a better option? Then you could depend on auto-scaling to make sure you still have nodes available for requests?  
  > **username_0**: Auto-scaling is a great idea ... I've answered this below '------'. Thanks again.  
  
  ---
  
  ## 0 answers
  
  