Subsystems are a fundamental concept in IBM i (formerly AS400) that provide a way to manage and control the execution of jobs (programs and processes). Think of them as separate environments within the operating system, each with its own set of resources and rules.
Here's a breakdown of how subsystems work:
1. Subsystem Descriptions:
- Each subsystem is defined by a subsystem description object. This object contains information about the subsystem, such as:
- The maximum number of jobs that can run concurrently in the subsystem.
- The storage pools (memory areas) that the subsystem can use.
- The job queues associated with the subsystem.
- The classes that define the runtime attributes of jobs entering the subsystem.
2. Job Queues:
- Job queues are like waiting areas for jobs that are ready to be executed.
- When a job is submitted to the system, it is placed in a job queue.
- Each subsystem is associated with one or more job queues.
3. Routing Entries:
- Routing entries define how jobs are selected from job queues and assigned to the subsystem for execution.
- They specify criteria such as the job name, user profile, or job type.
4. Classes:
- Classes define the runtime attributes of jobs, such as their priority, time slice, and memory allocation.
- Each job is associated with a class.
How it all works together:
- When a job is submitted, it is placed in a job queue.
- The subsystem monitors its associated job queues for jobs that match its routing entries.
- When a matching job is found, the subsystem selects it for execution.
- The subsystem uses the job's class to determine its runtime attributes.
- The job is then executed within the subsystem's environment, using the resources defined in the subsystem description.
Benefits of using subsystems:
- Resource management: Subsystems allow you to allocate system resources (CPU, memory, etc.) to different types of work. For example, you might have one subsystem for interactive jobs and another for batch jobs.
- Performance tuning: By configuring subsystems appropriately, you can optimize the performance of different workloads.
- Security: Subsystems can be used to isolate different types of work, which can improve security.
- System availability: If one subsystem fails, it does not necessarily affect other subsystems.
Examples of common subsystems:
- QINTER: Handles interactive jobs (user sessions).
- QBATCH: Handles batch jobs (programs that run without user interaction).
- QCMN: Handles communication jobs (network-related tasks).
- QSYSWRK: Handles system work (background processes).