Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Overview of svmon

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Overview of svmon

The svmon command is used to display information about the current memory status, which can be obtained through the

# lslpp bos.perf.tools

Check to see if there is an installation. Because the svmon command runs at the user level where interrupts are enabled, the information displayed does not constitute a true memory snapshot. In a very busy system, there is a gap between the data collected by svmon and the real data, and the VMM (Virtual memory Manager) may have changed during the collection process of the svmon process.

Because svmon uses all the data in VMM, and VMM's view of memory is based on memory segments, to understand the output of svmon, you must first understand the concept of segments.

Segment

A segment is a collection of pages used to report the basic objects of memory consumption. Therefore, the statistics reported by svmon are expressed as pages. Each segment is 256m, while each page is virtual memory of 4KB bytes, and each frame is real memory of 4KB bytes. Each segment can be used by multiple processes at the same time, and each segment belongs to one of the following five types:

Persistent: store JFS files or directories

Working: process data areas and shared memory segments

Client: used to implement virtual file systems such as NFS,CD-ROM file system and JFS2

Mapping: used to implement the mapping between files and memory

Real memory mapping: used for access to the iCandle O space

Detailed explanation of svmon parameters

-aSupClassName

Limit the scope to subclasses of the SupClassName class parameters (in the layer report-T). The parameter is the superclass name. Class lists are not supported.

-b

Displays the status of references and modification bits of all display frames (detailed report-D). When displayed, reset the reference bit of the frame. When the-I flag is used, frames accessed between each interval are detected.

Note:

Because this flag affects performance, use it with caution.

-c

Indicates that only customer segments are included in the statistics. All segments are analyzed by default.

-CCommand1...CommandN

Displays memory usage statistics for processes running the command name Commandnm1...CommandnmN. Commandnm is a string. It is the exact base name of the executable file.

-d

For a given entity, displays memory statistics for processes belonging to that entity (user name or command name).

-DSID1...SIDN

Displays memory usage statistics for segment SID1...SIDN and detailed status of all frames for each segment. The specified segment identifier must be related to the main segment.

-e

Displays memory usage statistics for a subclass of the Class parameter (this parameter is in workload class report-W and tier report-T). The-W or-a class parameter needs to be a superclass name.

-f

Indicates that only persistent segments (files) are included in the statistics. All segments are analyzed by default.

-F [Frame1...FrameN]

Displays the frame Frame1...FrameN status, including the segment to which it belongs. If no frame list is provided, the percentage of memory used is displayed.

-g

Indicates that the information to be displayed is sorted in descending order of the total number of pages reserved or used in the paging space. This flag, combined with the segment report, changes the non-working segment at the end of the sorted list.

-G

Displays the global report.

-iInterval [NumIntervals]

Instructs the svmon command to display statistics repeatedly. Statistics are collected and printed per Interval second. NumIntervals is the number of repeats; if not specified, svmon runs until the user interrupts with Ctrl-C.

Note:

Because it takes a few seconds to collect statistics for some options, the observed interval may be larger than the specified interval.

-j

Displays the file path referenced by each persistent segment.

Note:

Because this flag has a potential impact on performance (especially svmon-S), use it with caution.

-l

Each displayed segment displays a list of process identifiers that use the segment, and displays the entity name (login, command, layer, or class) to which the process belongs based on the report type. For a particular segment, a label is displayed instead of a list of process identifiers.

System segment

Displays the label of the segment marked system.

Unused segment

This label displays segments that are not used by all existing processes. For example, persistent segments associated with files are no longer used.

Shared library text

Displays the label of the segment that contains the shared library text, which may be used by most processes (for example, libc.a). This prevents a long list of processes from being displayed.

-m

When a segment maps a source segment, information about the source segment is displayed and the segment is mapped. The default value is to display only information about the mapping segment.

-n

Indicates that the statistics contain only non-system segments. All segments are analyzed by default.

-p

Indicates that the information to be displayed is sorted in descending order by the total number of pages with fixed memory.

-P [PID1... PIDN]

Displays memory usage statistics for the process PID1...PIDN. PID is a decimal value. If there is no provisioned process identifier (PID) list, memory usage statistics for all active processes are displayed.

-Q

Filter the results based on whether they deal with large pages. In addition, it displays large page metrics.

-r

Displays the range within the assigned segment page. Because pages can be assigned by starting at both ends and then moving to the middle, work segments may have two ranges.

S

Indicates that only system segments are included in the statistics. All segments are analyzed by default.

-S [SID1...SIDN]

Displays memory usage statistics for segment SID1...SIDN. SID is a hexadecimal value. The specified segment identifier must be related to the main segment. If there is no supply segment identifier (SID) list, memory usage statistics for all defined segments are displayed.

-tCount

Displays memory usage statistics for the highest Count object to print

-T [Tier1...TierN]

Displays memory usage statistics for all classes with layer number Tier1...TierN. If there is no list of supply layers, memory usage statistics for all defined layers are displayed.

-u

Indicates that the information to be displayed is sorted in descending order by the total number of pages in real memory. If the following flags do not appear, this is the default sorting criteria:-p,-g, and-v.

-U [LogName1...LogNameN]

Displays memory usage statistics for the login name LogName1...LogNameN. Logname is a string that is the exact login name. If no list of login identifiers is provided, memory usage statistics for all defined login identifiers are displayed.

-v

Indicates that the information to be displayed is sorted in descending order according to the total number of pages in the virtual space. This flag, combined with the segment report, changes the non-working segment at the end of the sorted list.

-w

Indicates that only work segments are included in the statistics. All segments are analyzed by default.

-W [Clnm1...ClnmN]

Displays memory usage statistics for the workload management class Clnm1...ClnmN. Clnm is a string. It is the exact name of a class. For a subclass, the name should have the format of superclassname.subclassname. If no list of class names is provided, memory usage statistics for all defined class names are displayed.

-x

Display layer report-T memory usage statistics for each class segment of a layer.

-z

Displays the maximum amount of memory dynamically allocated during svmon execution.

Specific examples of use

1. Global statistics

# svmon-G

Size inuse free pin virtual mmode

Memory 3932160 2729499 1202661 818627 1616925 Ded

Pg space 8388608 8595

Work pers clnt other

Pin 675474 0 2801 140352

In use 1616925 0 1112574

PageSize PoolSize inuse pgsp pin virtual

S 4 KB-1966891 8595 209571 854317

M 64 KB-47663 0 38066 47663

Among them

Used by inuse-

Free- is idle

Pin- "nails" the memory segment in memory (I don't think this is a fixed memory segment)

Virtual- virtual memory segment

Work- working memory segment

Pers- fixed memory segment

Other-mapping and real mapping memory

PageSize- statistics of different memory page sizes: s is a regular page, with a size of 4kMagne m and a large page size of 64k.

Usage of pgsp- paging space

Note that in the description of the paragraph, if there is a horizontal (-) in the section used by paging space, indicating that the segment does not use a swap, the work segment may use a swap, but the persistent and client segments will not.

2. To print the global statistics per minute for 1 stroke for 2 hours, please enter:

# svmon-G-I 60 30

3. To print out the memory usage statistics of users root and steve who only consider work segments, enter:

# svmon-U root oracle-w

=

User Inuse Pin Pgsp Virtual

Oracle 558293 16880 0 558293

PageSize Inuse Pin Pgsp Virtual

S 4 KB 515157 80 0 515157

M 64 KB 2696 1050 0 2696

.

SYSTEM segments Inuse Pin Pgsp Virtual

13129 8552 0 13129

PageSize Inuse Pin Pgsp Virtual

S 4 KB 3785 72 0 3785

M 64 KB 584 530 0 584

Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual

20002 0 work kernel segment m 584 530 0 584

The above omits part of the output.

The segments used by processes that users are running are divided into three categories:

Systems: segments shared by all processes

Mutex: segments used by process sets that belong to oracle

Sharing: a segment shared by several users.

Among them

Vsid: represents the virtual segment identifier. Represents the only segment in the virtual memory manager.

Esid: represents a valid segment identifier. Esid is valid only if the segment belongs to the address space of the process. When provided, it indicates how the process uses segments. If the vsid segment is mapped by several processes but has different esid values, the field contains "-". In that case, the exact esid value can be obtained by applying the-P flag to each process identifier that uses the segment. Because the segments used to manage open files or multithreaded structures are not part of the process's user address space, "-" is also displayed for these segments.

3. The three processes that use the most memory can be marked

# svmon-uP-t 3 | grep-p Pid | grep'^. * [0-9]'

5428 X 4681 1584 2656 9156 N N

16274 bin 4594 1588 2273 8824 N Y

6458 dtgreet 4660 1580 2144 8712 N N

The format order of the output is Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd

It can be calculated that the real memory used by the X program is 4681 × 4096mm 18763776, which is about 18MB.

4. The three processes that use the exchange most can be marked.

# svmon-gP-t 3 | grep-p Pid | grep'^. * [0-9]'

5428 X 4681 1584 2656 9156 N N

16274 bin 4594 1588 2273 8824 N Y

6458 dtgreet 4660 1580 2144 8712 N N

The swap area used by the first program X is about 2566 × 4096 = 10510336 bytes, which is about 10MB space.

5. Show the most used segments every three seconds

# svmon-S-t 3-I 3

Vsid Esid Type Description Inuse Pin Pgsp Virtual

4f08-clnt 37505 0-

11e1-clnt 33623 0-

8811-work kernel pinned heap 12637 6547 8091 19397

It can be seen that the segments whose Vsid is 4f08 are most used.

6. See the fixed memory used by the process with a PID of 22674.

# svmon-pP 22674

7. To print out memory usage statistics for segment 700e 8811 and bed7, enter:

# svmon-S 700e 8811 bed7 1cf8e

8. To print out the memory usage statistics of the command login,ksh, including the address range, enter:

# svmon-C login ksh-r

9. To print out memory usage statistics for all processes that only consider non-system work segments, and sort the process according to the number of virtual pages, enter:

# svmon-P-n-w-v

10. Sort the system segments according to the number of pages in real memory, and print out the top 10 system segments in the result list. Enter:

# svmon-S-s-u-t 10

11. Print only large page segments, please enter:

# svmon-S-Q

Analysis of common problems

The sum result of inuse in svmon-S is smaller than that of inuse in svmon-G.

The following script can be used to count the sum of inuse in svmon-S:

=

#! / usr/bin/ksh

Svmon-S | cut-c54-62 | awk'/ ^ [- sLm] / {if ($1 ~ / L /)

{COUNT1 = ($2*4096+COUNT1)}

Else if ($1 ~ / m /)

{COUNT2 = ($2*16+COUNT2)}

Else {COUNT3 = $2+COUNT3}}

END {printf "The result is as following with 4k as unit size\ n16m page count=%d\ n64k page count=%d\ n4k page count=%d\ nTatal page count=%d\ n", COUNT1,COUNT2,COUNT3,'COUNT1+COUNT2+COUNT3'}'

=

So what is the reason for this difference? The explanation is as follows:

Svmon-S is used to display memory usage information for all memory segments (segment) in the system. There are only three memory segments on AIX, which are work,client and persistent. Therefore, the sum of inuse in svmon-S is the sum of the above three memory segments that will be used. However, this statistics does not include all the used memory pages on the system. There are some memory pages (mapping and real mapping memory) that have not been managed by VMM in the system. These pages have been used, but do not belong to the above three memory segments, so they are not reflected in svmon-S. Svmon-G contains these unmanaged pages.

The memory that is not managed by VMM is mainly used by hardware to make some settings for physical memory. In AIX 5L, you can view the unmanaged memory by executing vmstat in kdb, with the following output:

VMM Memory Limits:

Total available memory (4K frames): 00100000 4.0GB

Total unmanaged mem (wlm_hw_pages): 0000D639 214.3MB

4K number of frames: 000F29C7 3.8GB

4K frames pinned: 00009FEE 160.0MB

4K system pinnable frames remaining: 000B817E 2.9GB

4K user pinnable frames remaining: 000BC0BC 3.0GB

Free paging space (in 4K blocks): 0001FD00 509.0MB

Paging space SIGDANGER level: 00001000 16.0MB

Paging space SIGKILL level: 00000400 4.0MB

"unmanaged mem" represents this kind of memory page that is not managed by VMM.

Reference to: http://www.eygle.com/digest/2009/07/ibm_aix_svmon.html

Http://www.kuqin.com/aixcmds/aixcmds5/svmon.htm#c013820260joy

Http://www-900.ibm.com/cn/support/viewdoc/detail?DocId=2811998D15000

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report