Running multiple worker daemons SLURM
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Using SLURM (Simple Linux Utility for Resource Management), a powerful open-source workload manager, to orchestrate and manage multiple worker daemons across a distributed computing environment is highly effective for large computations and resource management. This guide describes the process of running multiple worker daemons under SLURM, including relevant technical explanations and examples.
Overview of SLURM
SLURM is a highly scalable and configurable workload manager used primarily on Linux clusters to efficiently distribute jobs among nodes. It supports running under MPI (Message Passing Interface) and allows for complex job scheduling, resource allocation, and efficient job management.
Configuration of SLURM for Worker Daemons
To begin, you must ensure your SLURM configuration is set up to handle daemon processes correctly. This usually involves setting up your slurm.conf file correctly and ensuring nodes are defined properly to handle the types of jobs your daemons will perform.
Running Multiple Worker Daemons
The execution of multiple worker daemons involves creating a SLURM batch script or using srun directly. Here's what these approaches typically look like:
Batch Script Method
- Create a Batch Script: A typical SLURM batch script to launch worker daemons might look like:
- Configure Multi-Prog Options: The
daemon.configmentioned in thesruncommand above should contain mappings of tasks to commands, allowing different nodes to run different commands or parameters:
Direct srun Method
Alternatively, you can launch daemons directly using srun:
Here -N specifies the number of nodes, -n specifies the number of tasks, and --pty runs the job in a new pseudo-terminal.
Monitoring and Managing Daemons
SLURM provides several tools for monitoring and managing daemon processes:
squeue: View job queue status.scancel: Terminate jobs.sacct: Report job accounting data.
Summary Table
| Feature | Description | SLURM Command | Notes |
| Job Submission | Submit jobs to SLURM for scheduling. | sbatch, srun | Use sbatch for scripts, srun for direct submission |
| Job Monitoring | Monitor the status of running jobs. | squeue, sacct | squeue for current status, sacct for historical |
| Resource Management | Allocate resources efficiently. | salloc | Manages interactive job sessions |
| Daemon Configuration | Config tasks and options for daemons. | Multi-prog config | Use config file for complex job task distribution |
Best Practices and Tips
- Scalability: Design daemon tasks to scale across multiple nodes effectively.
- Logging and Debugging: Ensure each daemon has adequate logging to troubleshoot issues.
- Resource Allocation: Monitor and adjust resource allocations based on daemon behavior to optimize cluster usage.
In summary, running multiple worker daemons in a SLURM environment necessitates careful planning around configuration, job submission, and monitoring. Using the tools provided by SLURM, along with best practices for distributed computing, can greatly enhance the efficiency and effectiveness of your computing resources.
Related reading
- SAML2AWS connecting to k8s issues
- Samples on kubernetes helm golang client
- Scalable spring batch job on kubernetes
- Scale down Kubernetes Pods
- Running session using tensorflow c api is significantly slower than using python
- Running time of algorithm A is at least On² - Why is it meaningless?
- Scheduler is not scheduling Pod for DaemonSet in Master node
- script backup namespace,deployment etc.. from kubernetes

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.