当前位置:众信范文网 >专题范文 > 公文范文 > 学习性能调优一些笔记(全文)

学习性能调优一些笔记(全文)

时间:2022-08-13 09:00:09 来源:网友投稿

下面是小编为大家整理的学习性能调优一些笔记(全文),供大家参考。

学习性能调优一些笔记(全文)

 

 学习性能调优的一些笔记 学习性能调优的一些笔记

 学了近一个星期的 AIX 性能监控与调优, 今天可以告一段落了。看了许多资料, 该消化吸收的都已经记在脑子里了; 还有一些东西感觉有必要记录在纸面上。

 这些都是东拼西凑摘录来的, 如下:

  ps -ef| sort +3 -r 来看最近或感觉系统紧张时的哪些程序占用比较大, 看 C 列。

 c

 每次系统时钟周期和发现进程或线程运行时增加进程或线程的 CPU 利用率。

 调度程序通过每秒除 2 将该值衰减。

 对于 sched_other 策略, CPU 利用率用于确定进程调度优先级。

 大值表示一个 CPU 密集处理且造成更低的进程优先级而小值表示一个 I/O 密集处理且造成更高的优先级。

 该字段的缺省头为 C。

  换页空间是真实内存的后备。

 真实内存被操作系统划分为 4KB 的页框(page frame)。

 每个页都可以在换页空间中有一个或多个 4KB 页作为其后备。

 真实内存中装入的所有程序和数据所占用的页框, 与换页空间中的页都有映射关系。

 操作系统维护所有页框的状态, 当系统需要某些代码或数据时, 如果真实内存有空闲的页框, 就直接使用它们。

 如果没有, 操作系统将查找最近最少使用的页框, 然后判断其内容与换页空间中的对应内容有无区别, 如果有区别, 操作系统把页框内容写到换页空间中, 这称为“换出” , 然后把新的代码或数据移到腾出的页框中; 如果没有区别, 操作系统将直接用新的代码或数据覆盖页框内容, 这称为“偷换” 。

 当系统需要那些在真实内存中没有, 但换页空间中存在代码或数据时, 操作系统依然根据上述原则为其准备可用的页框, 然后把代码或数据从换页空间中读取进来。

 程序和数据只有活动部分才必须存在于真实内存中, 这使得换页空间的应用成为可能 换页空间不是内存的替代品, 除了暂存数据外, 它不能完成内存的其他功用

 换页空间暂存内存中暂时不被使用的数据或代码。

 当系统中真实内存不够用时, 他把真实内存中最近最少使用的数据换出到换页空间,从而为需要的程序腾出真实内存空间。

 换页空间不是内存的代用品, 无限增加换页空间并不能使系统容纳更多的应用。

 如果应用程序需要经常访问的代码和数据使用了大多数内存, 那么无论有多大的换页空间, 总会造成频繁的换进换出操作,这时系统将忙于进行换进换出操作, 而用于正常处理的资源(包括CPU 和 I/O)

 大为减少。

 如果发生这种情况, 就需要扩展物理内存。

 换页空间在硬盘上的位置 换页空间是属性为“paging” 的逻辑卷 使换页空间发挥最大性能的原则:

 使换页空间逻辑卷位于物理卷的“center” 位置 使用多个大小相差不多的换页空间设备(逻辑卷), 各个设备在不同硬盘上 将换页空间设备放置在比较空闲的硬盘上

  没有换页空间, 系统不能启动。

 操作系统安装过程中, 在物理卷/dev/hdisk0 上创建了默认的换页空间设备/dev/hd6。

 AIX 利用 VMM 进行内存管理, 其中虚存由实存+Paging Space(swapspace)

 组成。

 并且实存可以大致分为两类:

 计算内存和文件型内存, 其中文件型内存用于 AIX 的文件操作的缓存, 在缺省情况下,实存的 20%-80%用于文件型内存。

 所以, 如果你有 dump 数据库等操作, 就一定会有大量的文件型内存被利用, 并且一直被占用。

 直至换叶出现或者备份的文件删除以后, 空间才会释放。

 利用 vmtune 可以控制内存的管理, 在/etc/inittab 文件中加入如下语句:

 vmtune: 2:once:/usr/samples/kernel/vmtune -p 5 -P 10 -h 1

  将文件型内存的范围控制在 5%-10%之间, 当然具体多少自己决定

  前提必须安装 vmtune 软件包:

 bos. adt. sample

 #/> vmtune vmtune:

  current values:

  -p

  -P

 -r

 -R

  -f

  -F

  -N

 -W minperm

 maxperm

 minpgahead maxpgahead

 minfree

 maxfree

 pd_npages maxrandwrt

  0

 0

  2

 8

 120

 128

 65536

 0

 -M

 -w

 -k

 -c

 -b

  -B

  -u

 -l

 -d maxpin npswarn npskill numclust numfsbufs hd_pbuf_cnt lvm_bufcnt lrubucket defps 419418

  16896

 4224

  1

  186

 256

 9

 131072

  1

 -s

 -n

  -S

  -L

 -g

  -h sync_release_ilock

 nokilluid

 v_pinshm

 lgpg_regions

 lgpg_size

 strict_maxperm

  0

  0

  0

  0

 0

 0

 -t

  -j

 -J

  -z maxclient

 j2_nPagesPer j2_maxRandomWrite

 j2_nRandomCluster

 399344

  32

 0

 0

 -Z

 -q

 -Q

 -y j2_nBufferPer

 j2_minPageReadAhead

 j2_maxPageReadAhead

  memory_affinity

  512

 2

 8

  0

 -V

 -i num_spec_dataseg

 spec_dataseg_int

  0

 512

 number of valid memory pages = 524272

  maxperm=NaNQ% of real memory maximum pinable=80. 0% of real memory

 minperm=NaNQ% of real memory number of file memory pages = 0 numperm=NaNQ% of real memory number of compressed memory pages = 0

  compressed=NaNQ% of real memory number of client memory pages = 0

  numclient=NaNQ% of real

 memory # of remote pgs sched-pageout = 0

  maxclient=INF% of real memory #/> vmtune vmtune:

  current values:

  -p

  -P

 -r

 -R

  -f

  -F

  -N

 -W minperm

 maxperm

 minpgahead maxpgahead

 minfree

 maxfree

 pd_npages maxrandwrt

  99836

  399344

  2

 8

 120

 128

 65536

 0

 -M

 -w

 -k

 -c

 -b

  -B

  -u

 -l

 -d maxpin npswarn npskill numclust numfsbufs hd_pbuf_cnt lvm_bufcnt lrubucket defps 419418

  16896

 4224

  1

  186

 256

 9

 131072

  1

 -s

 -n

  -S

  -L

 -g

  -h sync_release_ilock

 nokilluid

 v_pinshm

 lgpg_regions

 lgpg_size

 strict_maxperm

  0

  0

  0

  0

 0

 0

 -v

 -m

  -C

 tuned_num_frs_memp

 tuned_nummemp

 page_color

  2

  0

  0

  -t

  -j

 -J

  -z

 maxclient

 j2_nPagesPer j2_maxRandomWrite

 j2_nRandomCluster

  399344

  32

 0

 0

 -Z

 -q

 -Q

 -y j2_nBufferPer

 j2_minPageReadAhead

 j2_maxPageReadAhead

  memory_affinity

  512

 2

 8

  0

 -V

 -i

  -e

 -E num_spec_dataseg

 spec_dataseg_int jfs_clread_enabled

 jfs_use_read_lock

  0

 512

 0

  1

  -H

  -I

  -G pgs_thresh

 lru_poll_interval

 lru_file_repage

  0

  0

 1

 PTA balance threshold percentage = 50. 000000%

 number of valid memory pages = 524272

  maxperm=79. 8% of real memory maximum pinable=80. 0% of real memory

 minperm=20. 0% of real memory number of file memory pages = 27585

  numperm=5. 5% of real memory number of compressed memory pages = 0

  compressed=0. 0% of real

 memory number of client memory pages = 0

  numclient=0. 0% of real memory # of remote pgs sched-pageout = 0

  maxclient=79. 8% of real memory

 #/> schedtune

  THRASH

  SUSP

  FORK

  SCHED -h

 -p

 -m

 -w

 -e

 -f

  -d

  -r

 -t

  -s SYS

 PROC

 MULTI

  WAIT

 GRACE

  TICKS

  SCHED_D

 SCHED_R

 TIMESLICE MAXSPIN

 0

  4

  2

 1

 2

 10

  16

  16

  1

 16384

  CLOCK

  SCHED_FIFO2

 IDLE MIGRATION

 FIXED_PRI

 TICK_SIZE

 FORCE_GRQ

 -c

 -a

  -b

  -F

  -L

  -G %usDELTA

  AFFINITY_LIM

 BARRIER/16

 GLOBAL(1)

 100

  7

 4

 0

 1

 0

 #/>

 段是一组页面, 用来报告内存消耗的基本对象。

 因此 svmon 所报告的统计信息是以页面表示的。

 一页是 4K 的虚拟内存块, 而一帧是 4K 的实内存块。

 除非另有注释, 否则所有的统计信息以 4096 字节的内存页面为单位。

 段属于以下五种类型之一:

 持久 用于处理文件和目录的段。

  工作 用于实现进程的数据区域的段和共享内存段。

  客户 用于实现诸如网络文件系统(NFS)

 和 CD-ROM 文件系统等虚拟文件系统的段。

  映射 用于实现内存文件的映射的段。

  实内存映射 用于从虚拟地址空间存取 IO 空间的段。

  A segment belongs to one of the five following types: persistent Segments used to manipulate files and directories working Segments used to implement the data areas of processes and shared memory segments client Segments used to implement some virtual file systems like Network File System (NFS)

 and the CD-ROM file system mapping Segments used to implement the mapping of files in memory real memory mapping Segments used to access the IO space from the virtual address space.

 段(segment)

 是一组页的合集, 每个段为 256M, 而每页为 4KB 字节的虚存, 每帧为 4KB 字节的实存, 每个段可同时被多个进程使用, 每个段属于以下五种类型其中的一种:

 persistent:

 存放 JFS 文件或目录 working:

 进程数据区域和共享内存段 client:

 用于实现虚拟文件系统如 NFS, CD-ROM 文件系统和 JFS2 mapping:

 用于实现文件和内存之间的映射关系 real memory mapping:

 用于对 I/O 空间的访问 注意, 在段的描述中, 如果 paging space 使用的节中如果有一横 (-),表明该段未使用交换区, work 段可能使用交换区, 但 persistent 段和 client 段不会使用交换区。

 vmtune -t 25 ;

 vmtune -p 10 ;

 vmtune -P 30 vmtune -t 157280 ;

 vmtune -p 52428 ;

 vmtune -P 157280 52427. 2 157281. 6

  vmtune -t 25 -p 10 -P 30

  挪用(页面帧)(steal(a page frame))

  (“虚拟内存管理器” 进行的)

 重新分配实内存页面帧的行为, 此帧包含正由当前的执行程序使用的虚拟内存页面。

 Vmtune -p minperm / maxperm – P -f minfree / maxfree – F One time command If pages on free list < minfree,

 then steal pages,

 until pages on free list >= maxfree If file pages in memory < minperm,

 then steal computational or file pages,

 equally If file pages in memory > maxperm,

 then steal file pages,

 only If file maxperm > pages in memory > minperm,

 then steal pages by repaging rates Between the two,

 the VMM normally steals only file pages,

 but if the repage rate for file pages is higher than the repage rate for computational pages,

 computational pages are stolen as well.

  缺页故障(page fault)

  (1)

 当活动页面引用不在内存中的页面时发生的程序中断。

  (2)

 当处理器试图访问不在实际内存中的虚拟内存页是发生的中断。

 页帧(page frame)

  (1)

 在实存储容量中, 有页面大小的存储位置。

  (2)

 主存储器的一个区域包含一个页面。

  (3)

 用来保留虚拟内存页的在实际内存中的连续的 4096 字节部分。

  页(page)

  (1)

 指令、 数据、 或两者的块。

  (2)

 可被放进窗口的行数。

  (3)

 在虚拟存储系统中, 为有虚拟地址的并被作为一个单元在实存储容量和辅助存储间传输的固定长度的块。

  (4)

 虚拟内存段的连续的 4096 字节部分。

 从段开始的每个页面的偏移量为完整的 4096 的倍数。

 另见 叶(leaf)。

  程序堆栈(program stack)

  调用堆栈(invocation stack)

 的同义词。

 调用堆栈(invocation stack)

  链接在一起的程序列表, 作为在相同的作业中程序调用其它程序的结果。

 与程序堆栈(program stack)

 同义。

 堆栈(stack)

  (1)

 存储器中的一个区域, 它存储临时的寄存器信息并返回子例程的地址。

  (2)

 一个构造后...

推荐访问: 学习性能调优一些笔记 性能 笔记 全文