The meaning of the PgSp field in topas

Source: Internet
Author: User

 

$ Topas-P
Topas Monitor for host: jhhost Interval: 2 Thu Aug 26 16:23:57 2010

DATA TEXT PAGE PGFAULTS
User pid ppid pri ni res space time cpu % I/O OTH COMMAND
Oracle 324076 1 102 20 1293 4827 1293 0 0 oracle
Patrol 307496 1 80 30 5072 619 11840: 39 2465 0 0.3 PatrolAgent
Patrol 241988 1 60 20 685 6 835: 53 438 0 0 snmpmagt
Oracle 463258 508290 60 20 441 49 441 0.0 0 0 topas
Root 172464 156076 60 20 67 0 345: 40 510 0 0 dtgreet
Oracle 467318 1 60 20 1014 4827 0 0 0 oracle
Oracle 327748 1 60 20 256 4827 1084 0 0 oracle
Patrol 299382 307496 60 20 187 954 539 39: 58 0.0 0 0 sqlplus
Oracle 311356 1 60 20 134 4827 1396 0 0 oracle
Oracle 303164 1 60 20 131 4827 2167 0.0 0 0 oracle
Root 278788 205276 60 20 40 61 306 47: 43 0.0 0 0 i4llmd
Root 28972 0 37 41 24 0 29 75: 29 0.0 0 0 gil
Root 61592 160160 60 20 64 26 651 0.0 0 0 X
Root 4384 0 16 41 11 0 12 37: 30 0.0 0 0 swapper
Oracle 307258 1 60 20 469 4827 1873 0.0 0 0 oracle
Root 221672 1 60 20 257 31 1600 0.0 0 0 ltid
Root 282672 1 60 20 296 19 6578 0.0 0 0 vmd
Root 225300 1 60 20 177 308 716 0 0 naviagen
Root 204816 1 60 20 45 0 47 0.0 0 0 rpc. lock
Root 192708 0 60 20 11 0 12 0.0 0 0 n4bg

$ Topas
Topas Monitor for host: jhhost EVENTS/queues file/TTY
Thu Aug 26 16:24:56 2010 Interval: 2 Cswitch 346 Readch 88771
Syscall 2742 Writech 23220
Kernel 0.5 | # | Reads 141 Rawin 0
User 42.3 |############# | Writes 124 Ttyout 259
Wait 0.1 | # | Forks 0 Igets 0
Idle 57.1 | ################# | Execs 0 Namei 78
Runqueue 0.0 Dirblk 0
Network kbps I-Pack O-Pack KB-In KB-Out Waitqueue 0.0
En0 69.2 112.5 118.5 45.7
Lo0 2.0 3.5 3.5 1.0 PAGING MEMORY
En1 0.7 8.5 0.0 0.7 Faults 54 Real, MB 0.0
Steals 0% Comp 87.7
Disk Busy % kbps tps kb-Read KB-Writ PgspIn 0% Noncomp 8.5
Hdisk46 0.0 39.2 0.5 0.0 PgspOut 39.2 Client 0%
Skpower7 0.0 39.2 0.5 0.0 39.2 PageIn 0
Hdisk1 1.0 8.0 2.0 0.0 8.0 PageOut 0 PAGING SPACE
Sios 0 Size, MB 16384
Name pid cpu % PgSp Owner % Used 15.1
Oracle 410020 24.9 5.0 oracle NFS (CILS/sec) % Free 84.8
Oracle 324076 23.4 5.1 oracle ServerV2 0
PatrolAgent 307496 0.1 46.2 patrol ClientV2 0 Press:
Topas 389584 0.1 1.8 oracle ServerV3 0 "h" for help
Dtgreet 172464 0.1 1.3 root ClientV3 0 "q" to quit

The above is the two top as outputs in the AIX 5.3 system. The first one is only the output process (with the-P option ), the second part is to include CPU, memory, swap space, I/O, and multiple process resource indicators in the topas standard output on the same interface. PgSp is an indicator describing a process. It is abbreviated as Page Space. It refers to the Page Space used by the process. In the two outputs, the Page Space displayed by topas-P is in the unit of Page (1 Page equals 4 kb), and PgSp is in MB in the standard output of topas.

Comparing fields similar to PgSp in top output on HP-UX, Linux, and AIX (size on HP-UX, VIRT on Linux), PgSp is really a bad name, too easy to confuse with Paging Space, note that one is the term Page, and the other is the verb Paging. Paging Space is used interchangeably with Swap Space in AIX, and Paging Space is the Page feed Space and the Swap area. PgSp is a Virtual Space, not a page feed or swap Space. The man topas manual Page describes Page Space as follows:

Virtual working set size used by process (4KB pages). Note: The true paging space allocations per process are not available usingTopasCommand. Refer toSvmonCommand for more detailed.

PgSp only includes private DATA segments of processes and virtual space of stack segments, excluding execution images, shared libraries, and shared memory. The PgSp value must be greater than or equal to data res (see the previous topas-P output) because PgSp includes private data segments that are not active in the memory or those that have been exchanged to the page feed space. What is an inactive Data Segment? For example, an application has applied for 1 MB of memory space by calling the malloc system, the system does not immediately allocate so much space to the physical memory. If you do not need this memory (for example, I/O operations ), this space only exists in the virtual space. In the previous topas-P output, we can see that an oracle process whose process number is 324076 has the same PgSp as Data RES and is on page 1293. An oracle process whose process number is 327748 has, its PgSp is a 1084 page, and its Data RES is a 256 page; its PgSp is a 307496 PatrolAgent process, and its Data RES is a 11840 page. In general, when the memory is abundant, PgSp and Data RES are the same, unless your program is not compiled well, you do not need to apply for a large memory. In the previous topas standard output, my computing memory (% Comp) accounts for 88% of the total memory, and paging space uses 15%. This is not a very memory-intensive system.

You may have a question: How do I know which processes occupy the paging space? The previous sections are clearly explained in English. topas cannot tell you this. You can use the svmon command to see how the process uses the paging space.

In addition, the ps command also contains fields similar to PgSp. Take the PatrolAgent process (pid 307496) as an example and execute the following command:

$ Ps avx | head-1; ps avx | grep 307496
Pid tty stat time pgin size rss lim tsiz trs % CPU % MEM COMMAND
307496-A 2478: 25 309661 47360 21900 32768 3632 2332 0.1 PatrolAgent

The SIZE field and PgSp. In ps output, the Unit related to memory/virtual memory is KB. The SIZE is 47360KB (46.2 MB), that is, 11840 pages, which is exactly the same as PgSp in top.

As mentioned earlier, we want to know how a process in AIX uses the paging space. The regular method is to use the svmon command, but you can also use the ps command to make a rough conversion. Let's look at the ps output of the PatrolAgent process, SIZE-(RSS-TRS) = 47360-(21900-2332) = 27792KB, this PatrolAgent process uses about 26 MB of paging space, hey, the 26 MB space may also be unused.

You can use the following shell script to estimate the page space occupied by all processes in your system (remind you to estimate only ):

$ Ps avx | sed-e "1d" | awk 'in in {total = 0} {total + = ($6-($7-$10 ))} END {print "total =", total }'

Note that the SIZE field and rss field in the ps output of AIX do not include the shared memory (shared memory) part. This is different from Linux. Note this difference when using ps. Generally, the shared memory segments of the database server are resident in the memory and do not use paging space. If the occupied page swap space calculated by the shell script is significantly less than the page swap space displayed by the lsps-s command, it is possible that a large shared memory segment is swapped out. This is a very bad situation. We need to report it and expand the memory.

Related Article

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.