NMIS 9 has performed a big change vs NMIS 8 where the main process was executed by a cron job.

NMIS 9 works as a service with a main process - the scheduler - redirecting all the jobs to a queue. It allows control of the priority, and other improvements.

The scheduler starts a number of workers that perform the jobs in the queue. 

The scheduler

What jobs does the scheduler have? We can have a look at the jobs in progress and scheduler with the following command:

/bin# ./nmis-cli act=list-schedule

We can remove the scheduled jobs or one specific job with the following:

/bin# ./nmis-cli act=delete-schedule id=<schedule_id|ALL> [job.X=...]

Controlling the nmis workers

We can control the number of workers with the following parameters in nmis9/conf/Config.nmis file: 

Max number of workers

The max number of child processes is controlled by the following parameter:

'nmisd_max_workers' => 10,

Worker cycles

By default, a worker is started by the scheduler and the worker will not die while the scheduler process is alive.

The worker process will sleep for 30 default seconds if it doesn't have any job to perform. This can be changed with the following parameter: 

'nmisd_worker_cycle' => 30

We can change the default behaviour so the worker is killed every N cycles. Another worker process will be started by the scheduler once the worker process reaches the max cycles, if the number of worker processes doesn't reach the max_workers. 

	'nmisd_worker_max_cycles' => 5,

Scheduler cycle

The scheduler process will sleep for 10 seconds once it finishes to review all the workers and sends the jobs to the queue. We can control the number of seconds the scheduler is sleeping with the following parameter:

	'nmisd_scheduler_cycle' => 10,
  • No labels