初始化动态服务器(Initializingdynamicservers)

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

初始化动态服务器(Initializing dynamic servers)
Your location: HOME->INFORMIX->IDS Management: initializing dynamic servers
Initializing dynamic servers
After studying this chapter, you will be able to
Set the required environment variables
Create sqlhosts file
Prepare disk space
Match the appropriate onconfig parameters for initialization
Initialization system
step
Onstat tools
Install software for each machine
Check the release notes under the $INFOMRIXDIR/release directory
Configuring the recommended core configuration parameters
Prepare disk space
Set required environment variables
Create a sqlhosts file
Set the onconfig file in the $INFORMIXDIR/etc directory Initialize online using the OnInit tool
The steps for initializing a dynamic server are shown above.
The user initializes the system signature and should read the release note under the $INFORMIXDIR/release directory. Many important information related to the operating system, kernel parameters, and system updates are included in the file.
The core configuration parameters are preset when the machine leaves the factory, but further adjustments are needed if the user needs it himself. For core parameter configuration, check release notes.
When you prepare disk space for the system, you must set the following permissions correctly:
Chmod 660, device_name
Chgrp Informix device_name
Chown Informix device_name
We recommend that users should be able to build connections for the original device for two reasons:
1., you can use connection commands to describe device usage information, such as which chunk is using that device;
2. easy recovery. In the UNIX system, the connection is established using the LN command
environment variable
Set the INFORMIXDIR of the brand of the brand Informix product directory
PATH AP AP AP AP INFORMIXDIR/bin
ONCONFIG AP AP AP set onconfig file name
The INFOMRIXSERVER which was set to the DBSERVERNAM value in the onconfig parameter dimension
The PSORT_NPROCS which was set to the physical CPU VPs number
We recommend that all Informix users deteriorate system users using Korn shell. The registration environment must be set automatically at registration. In general, all environment variables are set in.Profile. We want all system users to use the same registration file. Informix must have the environment variable as shown above.
Connection triangle
The connection between the client and the dynamic server
consists of three parts. The environment variable INFORMIXSERVER is a pointer to one of the items in the communication profile. The default path and name of the communication configuration file is
$/INFOMRIXDIR/etc/sqlhosts. The first field of the file contains the configuration parameters for the DBSERVERNAME or DBSERVERALIASES value, the DBSERVERNAME can only have one, and the user can store the path and name of the environment variable INFORMIXSQLHOSTS change communication configuration file.
The format of the communication profile is as follows:
Dbservername netttype hostsname servicename
The meanings of each field are as follows:
Dbservername AP AP onconfig file in DBSERVERNAME or DBSERVERALIASES
Nettype AP AP AP corresponds to a shared memory connection is onipcshm AP AP AP
The brand of the brand of the brand of the brand of the brand is ontlitcp TLI for TCP/IP connections
The brand of the brand of the brand of the brand of the brand is onsockcp sockets for TCP/IP connections
The host name hostname AP AP AP machine
Servicename is the brand of the brand in the /etc/services file
name of the service, for the shared memory connection useless
The
Root initialization
#root DBSPACE configuration
ROOTNAME AP AP AP AP AP AP rootdbs #root DBSPACE
rootpath / dev / online _ root # 构成root dbspace的设备路径
rootoffset 0 # root dbspace 设备的偏移量 (kbytes)
rootsize 50000 # root dbspace大小 (kbytes)
# 磁盘镜像配置参数
mirror 0 # 镜像标志 (yes = 1, no = 0)
mirrorpath # 镜像root dbspace设备额路径
mirroroffset 0 # 镜像root dbspace设备的偏移量
# 物理日志配置
physdbs rootdbs # 物理日志(dbspace) 的位置
physfile 1000 # 物理日志文件大小 (kbytes)
# 逻辑日志配置
logfiles 10 # 逻辑日志文件数量
logsize 3000 # 逻辑日志大小(kbytes)
动态服务器的初始化包括两部分: 磁盘初始化, 创建root dbsapce.root dbspace中有12页专门用于存放系统信息, 称为系统保留页.剩余空间中包含被称为chunk free list的页, 50页tblspace, 4页database tablespace.在root dbspace中还存储sysmaster和sysutils数据库.
在系统初始化时, 物理日志和逻辑日志都自动建立在root dbspace 中.逻辑日志的最优大小很难确定, 因为与各系统的事务活动状况紧密相关.刚开始时可以将其大小设置为3至5mb, 如果不够可以随时追加.
在初始化时应创建一个较小的物理日志.因为在dbms系统中, 尤其在oltp环境下, 数据库的操作非常频繁, 日志中必须记录大量的信息, 所以用户最好能将多个日志分布在不同的设备上.有一种非常简单的方法: 既在系统初始化完毕后, 将物理日志移至其它设备, 并扩大其空间.一般来说物理日志大一些为好 (300m - 500m), 这样可
以避免频繁地初始化检查点 (物理日志75% 满时进行).
请一定牢记, root dbspace的位置和初始chunk的大小是无法改变得, 除非重新初始化系统, 但这将清除现有系统中的所有信息.
root dbspace的镜像功能可以在初始化时打开也可以在以后打开.
消息和磁带参数
# 诊断
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 #日志磁带设备路径
ltapeblk 16 # 日志磁带设备大小 (kbytes)
ltapesize 10240 # 输出到磁带上的最大数据量 (kbytes)
stageblob # informix光机缓冲区
变量msgpath中记录了系统消息日志文件的位置和名称.在运行时应随时监控该文件.用户可以另开出一屏, 对该文件运行tail - f.系统消息将不断地添加在消息文件后, 用户应该经常注意改文件的长度.
我们建议应将console重定向到一个与msgpath同一目录下的文件上.
磁带设备参数用户系统归档和逻辑日志备份.参数alarmprogram被自动设置为log _ full.sh.该文件在逻辑日志满时, 自动启动on _ bar备份逻辑日志.如果不需要此功能, 只需要将alarmprogram设置为no _ log.sh文件.
差数stageblob只对informix dynamic server / optical系统有效.
系统配置
# 系统配置
servernum 1 # 每个服务器的唯一值
dbservername onlineshm # 数据库服务器主名
dbserverallases onlinesoc # 数据库服务器别名
nettype ipcshm,, 10, cpu # 为nettype 配置轮询线索
nettype soctcp,
_ timeout 60 # 在分布环境下等待锁的最长时间 deadlock
resident 1 # 强制驻留标志 (yes = 1, no = 0)
multiprocessor 1 # 0单处理器, 1多处理器
numcpuvps 10 # 用户cpu vps 数量
single _ cpu _ vp 0 # 如果非0, 限制cpu vp为1
noage 1 # 进程调度
aff _ sproc 0 # 绑定初始处理器
_ nprocs 10 # 绑定处理器数aff
动态服务器必须具有唯一的servernum.给参数用作系统共享内存段的码 (key).客户连接时根据参数dbservername确认服务器, 所以该参数也必须唯一, 同时它也必须与通讯配置文件中的条目匹
配.dbservdername或dbservderaliases都必须与一种通讯接口 (共享内存, tl, 相应.在通讯配置文件中必须包括所有的服务器名sockets).
如果系统内存严重不足, unix会将某些进程整个交换出实存.通过设置resident参数, 可以保证共享内存的驻留段始终在共享内存中不会被交换到磁盘上, 否则系统的性能将会受到极大的影响.
许多unix操作系统会降低长时间运行的进程的优先级.组成服务器的oninit进程因而会受到影响, 导致系统性能下降.参数noage将禁止这种情况的发生.该参数与系统平台有关.如果在系统中出现上述现象, 但系统又不支持noage参数, 可以利用renice命令提高优先级.ps命令的pri列表示进程的优先级.在某些系统上, 利用top命令也可以显示进程优先级.
nettype
参数nettype中定义了客户与动态服务器连接的方式.如果要与系统连接, 就必须为每一类连接定义一个nettype以记录网络和通讯协议的类型.
nettype的第二个字段指定了为该协议启动的轮询 (poll) 线索数.
These polling leads are responsible for communication between the client and the server. In general, a polling lead can serve up to 100 users at most. How to configure the number of clues to achieve the optimum will be discussed in detail in later chapters.
The third field of the NETTYPE determines the number of connections to the protocol. The shared memory protocol takes advantage of this parameter to determine the size of the shared memory message segment. The last field of NETTYPE determines how the polling trail should run on that VP class. There are two VP classes that you can choose: CPU or NET. The VP that belongs to the NET class includes SOC, TLI, or SHM. The most efficient run on CPU VP, but only a communication protocol can be run.
If the polling trail runs on CPU VP, the number of polling rounds cannot exceed the number of CPU VP. However, if the polling trail runs on the NET class VP, the number of polling leads will determine the number of SOC, TLI, or shared memory VP, meaning that the system will start a NET class VP for each polling trail
If the following is set, NETTYPE
Sockcp, 2,10, NET
The system will start two SOC VP.
Note that each polling can support the number of connections that leads to the largest number of users, so in the above example set to support 20 users. Please do not exceed the maximum user limit, otherwise you will cause a lot of burden on the poll trail.
Configure CPU VP
The proper allocation of the number of CPU VP has a great impact on the performance of the system. The system needs to have enough CPU VP to speed up the execution of the leads, so that other processes in the system can take up enough CPU time.
Specific configuration methods are as follows:
Monitor the trace ready queue using the onstat -g rea command. Check whether the number of CPU VP class clues is always greater than the number of CPU VP. If so, it indicates that there are always some CPU clues waiting for CPU VP, and the number of CPU VP should be increased.
The command onstat -glo can display information about CPU VP.
From the point of view of the system, we should monitor and analyze the use of CPU at any time to see if the system has potential to be tapped. There are many systems that provide such tools, such as sar. As long as there is CPU free time or I/0 wait time, it means that you can increase the number of CPU VP to accomplish 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 binding
Processor affinity is a specific process that can only be executed on a particular CPU. A particular CPU can still serve other processes, but a specific process can only be executed on that CPU. If the platform supports, the INFORMIX dynamic server can bind CPU VP (OnInit) to the specified processor.
The processor starts numbering consecutively from 0. On some SMP platforms, an CPU interrupts the system specifically. If the amount of CPU VP configured is less than the number of physical processors, you should avoid binding CPU VP to the CPU that processes interrupts. Using the mpstat command, you can find out which CPU processing interrupt is identified by the intr column.
If the system user is very large (>300), the user process may compete with the CPU VP processor. At this point, you can bind CPU VP to some processors and bind the user process to another processor. For example, when the system has 16 CPU, it binds CPU VP to 0 to 10 CPU and binds all the application processes to the 11-15 process. How to allocate the number of CPU in these two types of processes requires testing to achieve better performance.
Configuration environment
The optimal allocation of shared memory parameters depends on the runtime environment of the dynamic server. The system running environment we discussed includes data loading, index
creation, OLTP, and DSS. In actual systems, it is best to set up parameter profiles for the different environments described above.
Such as:
Data loading: the brand of the brand onconfig.load
Create index: the brand of the brand onconfig.index
OLTP: AP AP AP onconfig.oltp
DSS: AP AP AP onconfig.dss。

相关文档
最新文档