Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Linux monitoring tools introduced series --smem     - Based Docker build stand-alone high-availability cluster Hadoop2.7.1 Spark1.7 (Server)

- JavaScript event handling Detailed (Programming)

- Oracle table space usage monitoring (Database)

- RabbitMQ user roles and access control (Linux)

- MySQL server after an unexpected power outage can not start (Database)

- The Java ThreadLocal (Programming)

- Install RAID 6 (Striping double distributed parity) (Linux)

- jdbc Oracle database connection string writing pluggable (Database)

- GAMIT10.5 install and update failed Solution (Linux)

- CentOS RedHat YUM Source Extensions Supplement (including 32-bit, 64-bit) (Linux)

- JITwatch installation under Linux (Linux)

- Increase ssh security service under Linux (Linux)

- Use HugePages optimize memory performance (Database)

- Learn about EditText little depth (Programming)

- ImageMagick Tutorial: How to cut images in Linux command line (Linux)

- MySQL 5.7 and 5.6 group by differences (Database)

- Seven kinds of NIC binding mode Detail (Linux)

- Shell scripts quickly deploy Tomcat project (Server)

- Linux operating system ARP Spoofing Defense (Linux)

- MongoDB3.0.6 wiredtiger MMAPv1 (Database)

 
         
  Linux monitoring tools introduced series --smem
     
  Add Date : 2018-11-21      
         
         
         
  Smem tool introduced

    smem is on a Linux system can generate a variety of command-line memory consumption reporting tool. With existing tools are not the same as the physical memory (PSS) smem can report actual use, which is a more meaningful indicators. You can measure virtual memory system libraries and applications the amount of memory.

Since most of the physical memory is usually shared among multiple applications, known as the actual physical memory (RSS) standard memory consumption this measure will greatly overestimate memory consumption patterns. This parameter measures the PSS but each application in each shared memory area "fair distribution", it gives a realistic measure.

smem has many features:

System Overview list

By process mapping and user lists

By user, user mapping or filtering

Configurable columns from multiple data sources

Configurable output units and percentage

And the sum of configurable title

Data from / proc read activity

Reads the data from the snapshot directory mirror or compressed packed files

Light capture tool for embedded systems

Built-in charting capabilities

smem System Requirements

System kernel 2.6.27 above

Python version must be 2.4 or above

Reliance matplotlib library generate charts (optional, automatic detection) dependent matplotlib, because smem addition to the general information of the text, can also generate smem strip or pie charts.

Corresponding English reads as follows:

smem is a tool that can give numerous reports on memory usage on Linux systems. Unlike existing tools, smem can report proportional set size (PSS), which is a more meaningful representation of the amount of memory used by libraries and applications in a virtual memory system.

Because large portions of physical memory are typically shared among multiple applications, the standard measure of memory usage known as resident set size (RSS) will significantly overestimate memory usage. PSS instead measures each application's "fair share" of each shared area to give a realistic measure.

smem has many features:

system overview listing

listings by process, mapping, user

filtering by process, mapping, or user

configurable columns from multiple data sources

configurable output units and percentages

configurable headers and totals

reading live data from / proc

reading data snapshots from directory mirrors or compressed tarballs

lightweight capture tool for embedded systems

built-in chart generation

smem has a few requirements:

a reasonably modern kernel (> 2.6.27 or so)

a reasonably recent version of Python (2.4 or so)

the matplotlib library for chart generation (optional, auto-detected)

Linux uses the virtual memory (virtual memory), so to accurately calculate the actual physical memory a process is not so simple. Only know the process virtual memory size is also not much use, because still can not get to the actual allocation of physical memory size.

RSS (Resident set size), use the top command to query is the most commonly used memory indicator represents the process of physical memory size. However, the RSS value of each process are added, often exceeds the entire system memory consumption, since RSS contains inter-process shared memory.

When PSS (Proportional set size) all programs using a shared library sharing the shared libraries occupy memory, each process memory. Obviously memory usage of all processes and the PSS is the system. It will be more accurate, it will be after the average size of shared memory, and then allocated to each process up.

USS (Unique set size) memory occupied by the process alone, it is in their own part of the PSS, only to calculate the size of the memory process alone, it does not contain any shared parts.

      VSS - Virtual Set Size of virtual memory consumption (including shared libraries occupy memory)

      RSS - Resident Set Size actual physical memory (including shared libraries occupy memory)

      PSS - Proportional Set Size of physical memory actually used (proportional distribution of shared libraries occupy memory)

      USS - Unique Set Size process independently of physical memory (does not include shared libraries occupy memory)

smem installation tool

  First, go to the official website to download the corresponding smem https://www.selenic.com/smem/ installation package, the latest version smem-1.4. The following installation is installed on RHEL 5.7, different versions of the system, and different installation methods there are some differences.

   1: [root @ DB-Server tmp] # tar -xzvf smem-1.4.tar.gz
   2: smem-1.4 / .hg_archival.txt
   3: smem-1.4 / .hgtags
   4: smem-1.4 / COPYING
   5: smem-1.4 / smem
   6: smem-1.4 / smem.8
   7: smem-1.4 / smemcap.c
   8: [root @ DB-Server tmp] # cd smem-1.4
   9: [root @ DB-Server smem-1.4] # ls
  10: COPYING smem smem.8 smemcap.c
  11: [root @ DB-Server smem-1.4] # cp /tmp/smem-1.4/smem / usr / bin
  12: [root @ DB-Server smem-1.4] # chmod + x / usr / bin / smem
smem tools

See smem command help information

   1: [root @ DB-Server tmp] # smem -h
   2: usage: smem [options]
   3:
   4: options:
   5: -h, --help show this help message and exit
   6: -H, --no-header disable header line
   7: -c COLUMNS, --columns = COLUMNS
   8: columns to show
   9: -t, --totals show totals
  10: -R REALMEM, --realmem = REALMEM
  11: amount of physical RAM
  12: -K KERNEL, --kernel = KERNEL
  13: path to kernel image
  14: -m, --mappings show mappings
  15: -u, --users show users
  16: -w, --system show whole system
  17: -P PROCESSFILTER, --processfilter = PROCESSFILTER
  18: process filter regex
  19: -M MAPFILTER, --mapfilter = MAPFILTER
  20: map filter regex
  21: -U USERFILTER, --userfilter = USERFILTER
  22: user filter regex
  23: -n, --numeric numeric output
  24: -s SORT, --sort = SORT field to sort on
  25: -r, --reverse reverse sort
  26: -p, --percent show percentage
  27: -k, --abbreviate show unit suffixes
  28: --pie = PIE show pie graph
  29: --bar = BAR show bar graph
  30: -S SOURCE, --source = SOURCE
  31: / proc data source
1: Displays the memory usage of all processes without parameters

2: Parameter -u displays the total amount of memory consumed by each user

smem -u

3: Parameter -p see the percentage of memory consumption situations.

smem -p

4: Parameter -w view the system memory usage

   1: [root @ DB-Server01 ~] # smem -w
   2: Area Used Cache Noncache
   3: firmware / hardware 0 0 0
   4: kernel image 0 0 0
   5: kernel dynamic memory 22021892 21721584 300308
   6: userspace memory 1899296 122424 1776872
   7: free memory 686340 686340 0
   8: [root @ DB-Server01 ~] # smem -w -p
   9: Area Used Cache Noncache
  10: firmware / hardware 0.00% 0.00% 0.00%
  11: kernel image 0.00% 0.00% 0.00%
  12: kernel dynamic memory 89.49% 88.27% 1.22%
  13: userspace memory 7.73% 0.50% 7.23%
  14: free memory 2.78% 2.78% 0.00%
5: Parameter -R REALMEM, REALMEM This value refers to the amount of physical memory. This parameter allows smem found throughout the system (-w) The output of the firmware / hardware amount of memory consumed (comparison can be found up and down, pay attention to firmware / hardware)

   1: [root @ DB-Server01 ~] # smem -R 24G -w
   2: Area Used Cache Noncache
   3: firmware / hardware 558296 0 558296
   4: kernel image 0 0 0
   5: kernel dynamic memory 22024108 21722972 301136
   6: userspace memory 1907676 122436 1785240
   7: free memory 675744 675744 0
6: Parameter -c to display the required columns show.

   1: [root @ DB-Server01 ~] # smem -c "name user pss"
   2: Name User PSS
   3: mingetty root 18
   4: mingetty root 18
   5: mingetty root 18
   6: mingetty root 18
   7: mingetty root 18
   8: bash root 911
   9: sftp-server root 939
  10: cupsd root 1208
  11: rsyslogd root 1403
  12: smbd tibco 1474
  13: hald haldaemon 1477
  14: pickup postfix 1487
  15: vmtoolsd root 2309
  16: sshd root 2521
  17: python root 5464
  18: beremote root 7585
  19: java weblogic 18454
  20: java weblogic 31431
  21: java weblogic 69389
  22: java tomcat 339977
  23: java tomcat 355037
  24: java tomcat 421133
  25: java weblogic 640531
7: Parameter -s according to a column (such as rss) ordered.

8: Parameter -r parameter is generally used in combination with -s, it represents reverse order (from ascending to descending)

9: -M filter parameters related processes. Show processes filtered by mapping

   1: [root @ DB-Server tmp] # smem -M mysql
   2: PID User Command Swap USS PSS RSS
   3: 4172 mysql / usr / sbin / mysqld --basedir = 0 3924 3924 3924
   4: [root @ DB-Server tmp] # smem -M mysql -p
   5: PID User Command Swap USS PSS RSS
   6: 4172 mysql / usr / sbin / mysqld --basedir = 0.00% 0.38% 0.38% 0.38%
   7: [root @ DB-Server tmp] #

10: -U parameter filtering information according to user

Other parameters of how to display a bar graph or pie chart function, personal feeling usefulness of these parameters is not, first of all servers are generally not installed desktop systems, are command interface maintenance and management. Unable to generate relevant graphics. Secondly, the server has a desktop system, but also need to install the dependent packages, very troublesome. Unless it is required to generate the report.

    Read data from capture tarball smem --source capture.tar.gz

    Show a bar chart labeled by pid smem --bar pid -c "pss uss"

    Show a pie chart of RSS labeled by name smem --pie name -s rss
     
         
         
         
  More:      
 
- General Linux interface server parameter tuning (Server)
- OpenSSL Introduction and compilation steps on Windows, Linux, Mac systems (Linux)
- 4 lvcreate example commonly used commands (Linux)
- Mac OS X 10.10 Yosemite compiling OpenJDK 9 (Linux)
- The Objects in JavaScript (Programming)
- Talk about Java in the collection (Programming)
- Java implementation chain store binary tree (Programming)
- Use libcurl library download url image (Programming)
- MNIST presentation and database conversion (Database)
- To use slay kill user processes (Linux)
- Use of the storage-level replication technology will quickly clone a ASM database to the target environment (Database)
- Django how to generate content in non-HTML formats (Programming)
- CentOS 6.6 running level (Linux)
- Nodejs complete installation instructions for Express (Linux)
- Oracle data files deleted recover after physical (Database)
- Linux centralized log server rsyslog (Server)
- Installation JDK 1.8 under CentOS7 (Linux)
- Ubuntu and derivative system users how to install Pinta 1.5 (Linux)
- How to install Linux Go Language (Linux)
- Using Python multithreaded mistakes summary (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.