Set clean period for DONE jobs

You can control the amount of time during which successfully finished jobs are kept in mbatchd memory. This is useful if you ran thousands of jobs which finished successfully and you do not want to keep them stored in memory, which results in receiving a huge list of jobs every time you query with bjobs -a.

You can use the CLEAN_PERIOD_DONE parameter in lsb.params to set the amount of time (in seconds) to keep DONE and PDONE (post job execution processing) jobs in mbatchd memory after they have finished.

For example, to clean DONE and PDONE jobs from memory after one day, set CLEAN_PERIOD_DONE= 86400.

To set the amount of time:

  1. Configure CLEAN_PERIOD_DONE in lsb.params.

  2. Run badmin reconfig to have the changes take effect.

  3. Optional: Run bparams -a | grep CLEAN_PERIOD_DONE to verify the parameter setting:

    bparams -a | grep CLEAN_PERIOD_DONE

    CLEAN_PERIOD_DONE = 604800

  4. Submit your job.

  5. You can see the configured time period for which successfully finished jobs are kept in mbatchd memory with the bparams command:

    $ bparams -a
            SCHEDULER_THREADS = 0
            BJOBS_RES_REQ_DISPLAY = brief
            CLEAN_PERIOD_DONE = 604800
    $ bparams -l
    The amount of time during which successfully finished jobs are kept in memory:
        CLEAN_PERIOD_DONE = 604800 

When changing the value for CLEAN_PERIOD_DONE, note the following:

  • CLEAN_PERIOD_DONE is limited to one week.

  • The value for CLEAN_PERIOD_DONE must be less than the value for CLEAN_PERIOD, or the value is ignored and a warning message appears.

  • If CLEAN_PERIOD_DONE is defined and historical run time is enabled, then a DONE job's historical run time will be used to calculate dynamic user priority until the job reaches its clean period which is CLEAN_PERIOD_DONE.