NMIS 9 has performed a big change VS nmis vs NMIS 8 where the main process was executed by a cron job.
NMIS 9 works as a service and with a main process - the scheduler - redirect redirecting all the jobs to a queue. It allows to control of the priority, between and other improvements.
The scheduler starts a number of workers that perform the jobs in the queue.
The scheduler
What jobs does the scheduler hashave? We can have a look at the jobs in progress and scheduler with the following command:
Code Block | ||
---|---|---|
| ||
/bin# ./nmis-cli act=list-schedule |
We can remove the scheduled jobs or one specific job with the following:
Code Block | ||
---|---|---|
| ||
/bin# ./nmis-cli act=delete-schedule id=<schedule_id|ALL> [job.X=...] |
...
The max number of child processes is controlled by the following parameter:
Code Block | ||
---|---|---|
| ||
'nmisd_max_workers' => 10, |
...
By default, a worker is started by the scheduler and the process worker will not die while the parent scheduler process is alive.
The worker process will sleep for 30 default seconds is if it doesn't have any job to perform. This can be changed with the following parameter:
Code Block | ||
---|---|---|
| ||
'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 parent scheduler once the child worker process reaches the max cycles, if the number of children worker processes doesn't reach the max_workers.
Code Block | ||
---|---|---|
| ||
'nmisd_worker_max_cycles' => 5, |
Scheduler cycle
The main 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:
Code Block | ||
---|---|---|
| ||
'nmisd_scheduler_cycle' => 10, |
...