ADM004
ADM004
4
System
Administration
Background Job Processing
1
System Administration Background Job Processing Online Training
Abstract:
This training includes details of two job application – Executor and Scheduler and will show how job processing works, and what kind of
business challenges you may need to address using this functionality.
Target audience:
People who will need to design, implement, and/or maintain jobs in DELMIA Apriso solutions
2
System Administration Background Job Processing Online Training
Requirements:
General understanding of Job Executing, Apriso Portal Usage, and Windows Administration.
Recommended trainings:
ADM001 – System Administration Installation ADM002 – System Administration Upgrade
ADM003 – System Administration Configuration
Duration:
1,5 hours
3
Chapter 1: Overview of Job Processing
DELMIA Apriso contains two complementary engines for 1. Overview of Job Processing
background processing: Job Executor (JE) and Job Scheduler (JS). 2.JE Processing Model
They are optimized for processing two main types of background •JS Processing Model
jobs: one-time jobs and recurring jobs.
Job Sources:
Various components of DELMIA Apriso: Function Interpreter
Business Integrator
Printing Module
Jobs are usually created by Administrators
4
Job Executor (JE)
5
Job Scheduler (JS)
6
JE and JS Common Features
7
Job Executor vs Job Scheduler
Jobs with only one action, only a schedule to be run Complex jobs (multiple actions, multiple schedules).
immediately.
Jobs created by other DELMIA Apriso modules Jobs usually created manually by Administrators.
(Business Integrator, Printing, FI).
Reprocessing performed by creating new jobs Reprocessing performed by creating new schedules
(duplicating existing ones). for the same job.
8
Chapter 2: JE Processing Model
Job Executor (JE) is the primary DELMIA Apriso component for 1. Overview of Job Processing
processing system background tasks. It is designed as a high- 2. JE Processing Model
performance execution engine for executing queue-like (FIFO - First
3. JS Processing Model
In, First Out) background tasks.
JE consists of two parts: a background service that actually executes
jobs and UI monitoring screens that allow for the monitoring,
configuration and troubleshooting of JE.
9
JE Processing Model
10
JE Processing Model
11
JE Processing Model – Sequence
In cases where jobs must be executed in a particular order, Synchronization Queues should be used.
Each job can have a Synchronization Queue assigned, which is an identifier (string) that groups all jobs from the same pool that should be
executed exactly in the same order as they are created.
12
JE Processing Model – Double Retry Mechanism
13
JE Processing Model – Finishing
14
JE Self-Monitoring
Memory management – this self-check is performed every 5 minutes and is controlled by Private Bytes performance counter, where
the following memory thresholds apply:
For 32-bit environments – 1,5 GB
For 64-bit environments – 3 GB
I. if the values above are exceeded, service restart is performed
Database access control – if no database access is detected, the service remains in starting status until the connection is
restored; after establishing the connection, the service proceeds to started status
Job timeout check – the check is performed every 5 minutes; the service is restarted when the following condition is met: Now - Job
Timeout > Last Job Timeout + 20%
JE Recycling:
In the case of database access problems, the service is configured and maintained by infrastructure/operating system and not by
Job Executor
In the case of failure:
Non-clustered environment – the behavior is controlled by Windows service properties
Clustered environment – several service restarts are performed (depending on cluster configuration); if the problem persists
after the specified number of retries, it is switched to another node
15
JE Central Configuration
For proper configuration, it is mandatory to provide the proper data in the Central Configuration file with a path to system services:
16
Job Pool Configuration Screen
17
Configuration of Job Pools
Configuration of job pools has an impact on the way jobs are processed and may influence the performance and responsiveness of JE
JE can work with a default configuration that contains only one job pool (all jobs are processed in the same way, have equal
priorities, and are executed as they come)
It is recommended to define separate job pools for jobs requiring different priority of processing. By limiting the number of available
threads it is possible to eliminate the potential issue of “starving” lower priority pools
18
Sample Configuration of Job Pools – Correct
The configuration can be done in few way, but the mportant paramenter to consider is MaximumExecutionThreads.
Let’s assume, that MaximumExecutionThreads is set as 10. Now, we can divide the slots in different ways:
Example 1: In this configuration “Printing” and “Default” are executed with the same priority. “Printing” is limited to a maximum of 3
concurrent jobs and “Default” is limited to 5. As a result, all pools can be processed at the same time. The “Interfacing” pool can take
all threads only if there are no higher priority jobs. This is one of the correct ways.
Example 2: In this configuration, the highest priority belongs to “Machine Processing” jobs. They are executed first using a maximum
of 2 threads. Remaining available threads (8) are split between “Print” and “Default” and “Interfacing” jobs. This means that all job
pools can be executed at the same time, if required. The “Interfacing” pool can take all threads only if there are no higher priority jobs.
This also allocates the slots correcntly.
19
Sample Configuration of Job Pools – Incorrect
Example 3: The below table shows that all possible threads can be taken by the “Printing” pool. This may result in the “Default” and
“Interfacing” pools being “starved” and not processed until all “Printing” jobs are completed. This is not recommended, as it doesn’t
use the slots efficiently.
Pool name Priority Threads
Printing 1 10
Default 2 5
Interfacing 3 10
Example 4: In the table below, all possible (10) threads are not distributed. This means that each job pool is processed in the one-job-
at-the-time mode. Increasing the number of threads could improve performance. Again, the available slots are waisted in this example.
Pool name Priority Threads
Printing 1 1
MI Events 2 1
Default 3 1
Interfacing 4 1
The configuration of job pools requires knowledge about the type of processing expected in the given deployment of DELMIA Apriso. It
may also require some experimenting and performance tuning to obtain the best results.
20
Job Pools – Recommendations
21
Chapter 3: JS Processing Model
22
JS Processing Model
API
Job Scheduler
tasks.
JS also supports automatic retry of an action execution when it fails due to database deadlock or concurrency error Each job
is executed as a single transaction. If the job execution fails, the whole transaction is rolled back
After the job has completed, JS stores history of the execution in tables JOB_HISTORY and JOB_ACTION_HISTORY. Each
execution of the job adds new rows into these tables
All history rows are related to the single job stored in the JOB table
24
JS Central Configuration
For proper configuration, it is mandatory to provide the proper data in the Central Configuration file with a path to system services:
25
Job Executor and Scheduler User Interface
Scheduled Jobs
Jobs Currently Executed
Synchronization Queues Status
XML Messages
Execution Log
Job Pools
Immediate Jobs
Immediate Jobs History
26
Scheduled Jobs
Used by JS
Allows creation of user defined jobs: Defines job schedules
Defines job actions
Displays all user defined jobs
Enables and disables jobs
Executes jobs manually:
Does not need a schedule to do this
Does not display jobs related to XML Messages originating from BI
27
Jobs Currently Executed
The list of jobs currently executed can be found on the Jobs Currently Executed screen accessible from Job Scheduler main screen:
Used by JS
Displays jobs that are currently being executed
28
Synchronization Queues Status
The Synchronization Queue Status grid displays all the disabled queues (and only the disabled ones) together with the Disabled On
and Disabled Until dates.
Used by JS
Allows user to manually disable a synchronization queue
Can specify start and stop times for disabling the queue
When disabled, pauses the processing of all messages assigned to the queue
29
XML Messages Screen
30
Execution Log
Used by JS
Displays history of executed job actions
Allows re-executing job actions
Allows viewing job action details
31
Immediate Jobs History
32
Logging
As with every other application within DELMIA Apriso, the Job Executor and Job Scheduler keep track of all activities in execution logs.
By default these logs can be found in the C:\Temp\AprisoLogs\directory.
JE and JS log all activity using the DELMIA Apriso logging framework
The C:\Temp\AprisoLogs\ directory contains the following log files:
AprisoJobExecutorService_*.log for JE
AprisoSchedulingService_*.log for JS
Commonly used to find more detailed error messages for failed jobs
Performance counters can be used to observe the health of the system
33
Performance Counters
34
Troubleshooting
If I have multiple JE instances running on my server (not very frequent), how do I know which one has the job that is causing
trouble?
The Job Pools screen shows the relationship between Job Pools and JE instances (installing additional JE instances is rare and
requires DELMIA Apriso Support help).
35
LAB 1: Creating a User Defined Job
36
LAB 1: Creating a User Defined Job
Task:
Create a job Add a job action Run the job Schedule the job
Training environment:
You should have the address and the credentials from your instructor or the DELMIA Apriso training team
In case of any technical problems, please contact [email protected]
20 min
37
LAB 1: Creating a User Defined Job
38
LAB 1: Creating a User Defined Job
39
LAB 1: Creating a User Defined Job
40
LAB 1: Creating a User Defined Job
41
LAB 1: Creating a User Defined Job
42
LAB 1: Creating a User Defined Job
43
LAB 1: Creating a User Defined Job
44
LAB 1: Creating a User Defined Job
45
LAB 1: Creating a User Defined Job
46
LAB 1: Creating a User Defined Job
47
LAB 1: Creating a User Defined Job
48
End of LAB
49
Thank you for your attention
50