What did Informix do when it was initialized?

Source: Internet
Author: User
Tags informix cpu usage vps
What are the Onstat tools for Informix initialization?

Install software for each machine
Check release notes in the $infomrixdir/release directory
Configure the recommended core configuration parameters
Preparing disk space
Setting the desired environment variables
Create a sqlhosts file
Setting up Onconfig files in the $informixdir/etc directory
Initialize online with the OnInit tool



The steps for initializing a dynamic server are as shown above.

The user should perform a reading of the release note under the $informixdir/release directory during the initialization of the system. This file contains a number of important information related to the operating system, kernel parameters, and system updates.

The machines have preset core configuration parameters at the factory, but they need to be adjusted further if the user wants them. Check release notes for core parameter configurations.

When you prepare disk space for your system, you must first set the following permissions correctly:

chmod 660 Device_name

CHGRP Informix Device_name

Chown Informix Device_name


We recommend that users have the best ability to create linked files for the original device for two reasons:

1. A link command can be used to describe a device's use of information, such as the one chunk using that device;

2. Easy recovery.

Using the LN command to create a link in a UNIX system


Environment variables


Informixdir is set to the same directory as the Informix product

Path including Informixdir/bin

Onconfig Set ONCONFIG file name

Infomrixserver is set to the Dbservernam value in the dimension onconfig parameter

Psort_nprocs set as physical CPU VPS number





We recommend that all Informix and database users use the Korn shell. The registration environment must be set up automatically when registering. In general, all environment variables are set in. Profile. We want all system users to use the same registration file. Informix must set the environment variable as shown above.

Connection triangle

A client's connection to a dynamic server consists of three parts. The environment variable informixserver is a pointer to a destination in the communication configuration file. The default path and name for the communication configuration file is $/infomrixdir/etc/sqlhosts. The first field of the file contains the value of the configuration parameter DbServerName or dbserveraliases, where dbservername can only have one, and the user can change the storage path and name of the communication profile through the environment variable informixsqlhosts.

The record format for the communication profile (Sqlhosts) is as follows:

DbServerName Netttype Hostsname ServiceName

The meanings of each field are as follows:

DbServerName or dbserveraliases in the Dbservernameonconfig file
Nettype
is Onipcshm for shared memory connections
is ontlitcp for tli TCP/IP connections
is ONSOCKCP for sockets TCP/IP connections


Host name of Hostname machine
Servicename file/etc/services service name, useless for shared memory connection method


System initialization

#root dbspace Configuration

Rootnamerootdbs #root dbspace Name

Rootpath/dev/online_root #构成root dbspace Device path

Rootoffset0 #root dbspace Device offset (Kbyte)

Rootsize50000 #root dbspace size (Kbyte)

#磁盘镜像配置参数 

Mirror0 #镜像标志 (yes=1,no=0)

Mirrorpath #镜像root dbspace Device amount Path

Mirroroffset0 #镜像root dbspace Device offset

#物理日志配置

Location of the Physdbsrootdbs #物理日志 (dbspace)

Physfile1000 #物理日志文件大小 (Kbytes)

#逻辑日志配置

Logfiles10 #逻辑日志文件数量

Logsize3000 #逻辑日志大小 (Kbyte)





Initialization of a dynamic server consists of two parts: disk initialization, creating root dbsapce. Root Dbspace has 12 pages dedicated to storing system information, called System retention pages. The remaining space contains pages called chunk free list, 50 pages tblspace, 4 pages of database tablespace. The Sysmaster and sysutils databases are also stored in root dbspace.

Both physical and logical logs are automatically established in root dbspace when the system is initialized. The optimal size of the logical log is difficult to determine, because it is closely related to the transaction activity status of each system. You can set the size to 3 to 5MB at the beginning, if not enough, to append at any time.

You should create a smaller physical log when you initialize. Because in the DBMS system, especially in the OLTP environment, the database operation is very frequent, log must record a large amount of information, so users should be able to distribute multiple logs on different devices. There is a very simple way to move the physical log to another device and expand its space after the system has been initialized. In general, physical log size is good (300m-500m), which avoids frequent initialization of checkpoints (physical log 75% is full).

Keep in mind that the location of the root dbspace and the size of the initial chunk cannot be changed unless the system is reinitialized, but this clears all information from the existing system.

The mirroring feature of the root dbspace can be opened on initialization or later.


Message and Tape parameters

#诊断

Msgpath/dev/informix/online.log #系统消息日志文件路径

Console/dev/console #系统控制台消息路径

Alarmprogram/usr/informix/log_full.sh #报警程序路径及名称

#系统归档磁带设备

Tapedev/dev/null #磁带设备路径

Tapeblk16 #磁带块大小 (Kbytes)

Tapesize10240 #磁带最大容量 (Kbytes)

#日志归档磁带设备

ltapedev/dev/null# Log Tape device path

Ltapeblk16 #日志磁带设备大小 (Kbytes)

Ltapesize10240 #输出到磁带上的最大数据量 (Kbytes)

Stageblob #INFORMIX光机缓冲区





The location and name of the system message log file are recorded in the variable Msgpath. You should monitor the file at run time. The user can open another screen and run Tail-f on the file. System messages are continually added to the message file, and users should always be aware of the length of the file.

We recommend that you redirect the console to a file that is in the same directory as Msgpath.

Tape device parameters user system archiving and logical log backups. The parameter alarmprogram is automatically set to log_full.sh. The file automatically starts the On_bar backup logical log when the logical log is full. If you do not need this feature, you only need to set the Alarmprogram to a no_log.sh file.

The margin Stageblob is only valid for Informix DYnamic server/optical systems.


System Configuration

#系统配置

Servernum1 #每个服务器的唯一值

Dbservernameonlineshm #数据库服务器主名

Dbserverallasesonlinesoc #数据库服务器别名

Nettypeipcshm,,10,cpu #为nettype配置轮询线索

Nettypesoctcp,2.25.net

Deadlock_timeout60 #在分布环境下等待锁的最长时间

Resident1 #强制驻留标志 (yes=1,no=0)

Multiprocessor1 #0单处理器, more than 1 processors

Number of Numcpuvps10 #用户cpu VPS

Single_cpu_vp0 #如果非0, limit CPU VP to 1

Noage1 #进程调度

Aff_sproc0 #绑定初始处理器

Aff_nprocs10 #绑定处理器数



A dynamic server must have a unique servernum. Use the parameter as the Code (key) for the system shared memory segment. When a client connects, the server is confirmed based on the parameter dbservername, so this parameter must also be unique, and it must match the entry in the communication configuration file. Dbservdername or dbservderaliases must correspond to a communication interface (shared memory, tli,sockets). All server names must be included in the communication configuration file. If the system is severely low on memory, UNIX swaps some processes out of existence. By setting the resident parameter, you can guarantee that the resident segment of shared memory will never be swapped to disk in shared memory, otherwise the performance of the system will be greatly affected.

Many UNIX operating systems reduce the priority of long-running processes. The oninit process that makes up the server is thus affected, resulting in degraded system performance. Parameter noage will prevent this from happening. This parameter is related to the system platform. If this behavior occurs in the system, but the system does not support noage parameters, you can use the Renice command to increase the priority. The PRI column of the PS command represents the priority of the process. On some systems, a process priority can also be displayed with the top command.

NetType

Parameter NetType defines how the client connects to a dynamic server. If you want to connect to the system, you must define a nettype for each type of connection to record the types of network and communication protocols.

The second field in NetType specifies the number of polling (poll) threads that are started for the protocol. These polling leads are responsible for communication between the customer and the server. In general, a polling thread can serve up to 100 users. How to configure the number of threads to achieve optimal, will be discussed in detail in later chapters.

The third field of NetType determines the number of connections for this protocol. The shared memory protocol uses this parameter to determine the size of the shared memory message segment. The last field in NetType determines that the polling thread should run on that VP class. There are two VP classes that can be selected: CPU or net. VP belonging to net classes includes Soc,tli or SHM. Runs most efficiently on the CPU VP, but only one communication protocol can be run.

If the polling thread runs on the CPU VP, the number of polling threads cannot exceed the number of CPU VP. However, if the polling thread runs on the net class VP, the number of polling threads determines the number of Soc,tli, or shared memory VP, meaning that the system will start a net class VP for each polling thread

If you set the following NetType

Sockcp,2,10,net

The system will start with two Soc VP.

Note the number of connections that each polling thread can support is the maximum number of users, so the settings in the previous example can support 20 users. Please do not exceed the maximum user limit, or it will bring a lot of burden to the polling leads.


Configuring the CPU VP

The correct configuration of the number of CPU VP has a great effect on the performance of the system. The system needs to have a sufficient number of CPU VP to speed up the execution of the thread to ensure that the other processes in the system can occupy enough CPU time.

The specific configuration method is as follows:

Use the Onstat-g rea command to monitor the thread readiness queue. Check whether the number of CPU VP threads is always greater than the number of CPUs VP. If so, it indicates that there are always some CPU threads waiting for the CPU VP and should increase the number of CPU VP.

Command Onstat-glo can display information about the CPU VP.

From the system point of view should be monitored at any time to analyze the CPU usage, to understand whether the system has the potential to dig. There are many systems that provide this type of tool, such as SAR. As long as there is CPU idle time or i/0 wait time, it is possible to increase the number of CPU VP to complete more tasks (at the same time). However, if the system CPU resources are fully utilized, increasing the number of CPU VP will not improve system performance.


Processor Bindings

The so-called processor bindings (processor affinity) are specific processes that can only be executed on a specific CPU. A specific CPU can still serve other processes, but a specific process can only execute on that CPU, and if platform support, Informix Dynamic servers can bind the CPU VP (OnInit) to the specified processor.

The processor is numbered consecutively starting with 0. On some SMP platforms, a CPU specializes in system interrupts. If the number of CPU VP configured is less than the number of physical processors, you should avoid binding the CPU VP to the CPU that handles interrupts. Use the Mpstat command to find out which CPU processing interrupts (identified by the Intr column).

If the system user is very much (>;300). The user process may compete with the CPU VP for the processor. At this point, the CPU VP can be bound to some processors, and the user process is bound to another processor. For example, if the system has 16 CPUs, the CPU VP is bound to 0 to 10th CPUs, and all application processes are bound to the 11-15 process. How to allocate the number of CPUs in both types of processes requires testing to achieve superior performance.

Configuring the Environment

The optimal configuration of shared memory parameters depends on the dynamic server's operating environment. The system runtime environment we are discussing includes data loading, indexing, OLTP, and DSS. In the actual system, it is best to establish a parameter profile for each of these different environments.

For example:

Data loading: onconfig.load

Index Establishment: onconfig.index

Oltp:onconfig.oltp

Dss:onconfig.dss

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.