The Informix dynamic server adopts a multi-clue architecture, which means that a process can complete multiple tasks at the same time using multiple clues of its own, therefore, the entire system requires only a small number of processes to complete DBMS tasks.
A dynamic server system consists of three main components: Shared Memory, processes, and disks. The shared memory includes three segments: Resident segments. Virtual and message segments. The residence segment is mainly used as the cache of disk data. Virtual segments are mainly used as memory pools to support processes and related session sessions) and clues. When the customer communicates with the server using the shared memory, the message segment is used as the message buffer between the two.
The system also contains several UNIX processes that constitute the database server, called oninit. These processes are called virtual processors (virtual processors ). Each VP belongs to a virtual processing class. Each virtual processor class is responsible for a specific type of tasks.
The system's disk components consist of multiple original disk spaces, called chunk. The chunk uses page as the basic unit. Multiple chunk sets logically constitute the data space dbspace ). A data space is used to store database, table, system information, physical logs, and logical logs. A data space must contain at least one chunk.
Shared Memory segments
The shared memory of the dynamic server consists of three segments: the resident segments are mainly used as the buffer pool, including the logical log and physical log buffers and other system data structures. The size of the CIDR block is determined by the BUFFERS parameter.
Virtual segments are mainly used as memory pools to support sessions and clues. Based on different purposes, the memory pool can be further divided into: Session pool, multi-clue pool, Dictionary pool, stored procedure pool, sorting pool, large buffer pool, and global pool. The memory pool is allocated and released dynamically. The memory pool size is 8 KB. If the virtual segments are exhausted, the dynamic server can dynamically apply again based on the onconfig parameter. The initial size of the virtual memory segment is determined by the shm1_size parameter, and its increment is determined by the SHMADD parameter. However, the size of the entire shared memory segment cannot exceed SHMTOTAL.
If the customer communicates with the server using the shared memory, the message segment is used as the communication buffer. Every user connects to communicate with each other using the shared memory) It occupies about 12 kb of space. The number of user connections is defined in the NETTYPE parameter. You can use the ipcs or onstat-gseg command to monitor the status of shared memory segments.
Virtual processor VirtualProcessors)Virtual Processor
Oninit cpu class: 95% of all user threads and some system clues)
Oninit AIO class: runs all internal clues to execute I/O, except for log writing.
Oninit PIO class: Run internal clues to write physical logs
Oninit LIO class: Run internal clues to write logical logs
Oninit SHM class: running shared memory communication clues
Oninit TLI class: running internal TLI network communication clues
Oninit SOC class: running internal Sockets network communication clues
Oninit MSC class: other task clues
Oninit ADM class: running clock
Oninit OPT class: responsible for managing BLOB transfers to the CD Subsystem
Oninit ADT class: run security audit clue
The database system server is composed of several UNIX processes called oninit. In the system, these processes are called virtual processor VP ). All VPNs are the entity of the executable program oninit. Each VP belongs to a specific virtual processor class, and different virtual processor classes complete different tasks respectively. The number of VPNs per virtual processor is determined by the following parameters:
CPUNUMCPUVPS
AIONUMAIOVPS
PIO automatically starts a VP. If the physical log is mirrored, two VPNs are started.
LIO automatically starts a VP. If the logical log is mirrored, two VPNs are started.
SHMNETTYPE
TLINETTYPE
SOCNETTYPE
MSC automatically starts a VP
ADM automatically starts a VP
OPTSTAGEBLOB is set, and then an VP is automatically started.
ADTADTMODE is set, and then an VP is automatically started.
You can use the PS or onstat-gglo command to monitor the VP status.
Clues
Onstat-gath show all clues
Onstat-gact shows activity clues
Onstat-grea shows all readiness clues
In a dynamic server, the clue is a command stream executed in oninit. The multi-clue mechanism allows a process to serve multiple tasks at the same time without generating multiple OS-level processes. The oninit process can start multiple clues, execute each clue in sequence, and transfer control to other clues as appropriate. In a multi-clue process, each clue has its own execution environment, including its own code space and its own local variables. A multi-clue process is responsible for switching the text between multiple clues.
In the system, a clue can only exist in two states: running on a certain VP or waiting in a queue. The body of all the clues in the ready queue that are ready for execution is saved. Once an idle VP occurs, the VP selects a clue for execution from the ready queue, and the selection criteria are determined by the internal priority mechanism.
At a specific time, the current running clue transfers control of VP to other clues. There are several types that can lead to control transfer:
Wait for disk read/write operations
Waiting for application requests
Waiting for lock or other resources
Transfer the running opportunity to other clues
Once a clue is handed over control, the context of the clue will be included in the waiting or sleep queue. All the clues waiting for some operation enter the waiting queue, and all the clues that need to be awakened later enter the sleeping queue.
Disk Components
In the dynamic server, page is used as the basic storage and I/0 units. The page size varies depending on the machine and operating system. Generally, the page size is 2 kb or 4 kb. You cannot change the page size.
The unit of disk space allocated to the system is chunk. A chunk consists of multiple pages. It is a typical UNIX original device. The chunk size is set by the system administrator.
Data Space (dbspace) is a logical set of multiple chunks. Each data space must contain at least one chunk. Databases and tables are created in the specified data space. The system must include at least one data space: rootd bspace. Information about the system is stored in the space.
Physical log physica llog) is composed of consecutive disk space, which stores all the modified data pages in the shared memory buffer but not written to the disk) the image before the modification. Therefore, physical logs are mainly used for fast recovery. Only when the data page is modified for the first time will the system write its image into the physical log.
Logical log logs is also composed of consecutive disk space, which stores transaction records, DDL statements, and checkpoint records. Set the number of logical logs by the Administrator. The system uses logical logs cyclically. During the first system initialization, both the physical and logical logs are automatically created on the root dbspace.