Jobstats

When to Use

This article explains how to use the jobstats command to view the amount of resources your job is consuming.

Monitoring your jobs with jobstats can help ensure that the optimal amount of resources are requested when submitting a job to the HPC cluster. Properly sized and timed jobs help reduce wait times for everyone using the cluster.

The jobstats command can be run on both running and completed jobs. The goal for each user should be to utilize 90% or more of the resources they have requested.

Process

To find a running job, run the following command:

squeue

This will list all the jobs running on the cluster. Find the line with your job — it will show you the job ID.

If you are looking for a completed job of your own, run this command:

sacct -u username

Example:

sacct -u hpcuser1

Now run the following command:

jobstats "JobID"

Example:

jobstats 123456

The output displays the average usage of CPU, memory, and GPU resources for the specified job.

Output will look something like this:

Example jobstats output showing CPU, memory, and GPU usage

As you can see, this job requested 8 cores and 64GB of RAM but is only using an average of 16% of the CPU and 14% of the memory. If your job shows similar stats, you should reconsider your resource request and aim for closer to 90% efficiency.