Proc File system for Linux

Source: Internet
Author: User

The/proc file system in Linux is a virtual file system that is dynamically generated by the kernel at runtime. It provides configuration and status information for the kernel runtime. These files allow the user to obtain, or modify, the kernel information.
For proc, you can get detailed instructions through the man Proc.

Run the mount command to see the Mount information for the proc file system.

MOUNT-T proc Proc/proc

Files under the/proc directory

/PROC/CPUINIFO CPU Information (model, family, cache size, etc.)

/proc/meminfoPhysical memory, Swap space
/proc/mounts List of loaded file systems
/proc/devicesList of available devices
/proc/filesystemsSupported file systems
/proc/modulesModules that have been loaded
/proc/virsionKernel version
/proc/cmdlineKernel command-line arguments entered at system startup
/proc/xxxXXX refers to the number of directories, there are many such directories, each directory represents a process (that is, the thread group).
/proc/swapsTo learn about the use of swap space
/proc/uptimeGet the system uptime
/proc/fs/nfsd/exportsList file systems shared by NFS
/proc/kmsgThis file is used as the kernel log information source, it can be called as a system information interface using/proc/self--to the current process/proc directory of symbolic links, through this directory can get the current running process information.
/PROC/PCI-Devices hooked up on the PCI bus
/proc/tty/driver/serial--Serial port configuration, statistical information
/proc/version--System version information
/proc/sys/kernel/ostype
/proc/sys/kernel/osrelease
/proc/sys/kernel/version
/proc/sys/kernel/hostname--Host name
/proc/sys/kernel/domainname--Domain name
/proc/partitions--Hard disk device partition information
/proc/sys/dev/cdrom/info--CDROM information
/proc/locks--All file locks in the current system
/PROC/LOADAVG--System load information
/proc/uptime--run time after system startup

--------------------------------------------------------------------------------------------------------------- -------------------------------------------

command to view system memory information: Cat/proc/meminfo

Memtotal:3266180 KB
Memfree:17456kB
Buffers:111328kB
Cached:2664024kB
Swapcached:0kB
Active:467236kB
Inactive:2644928 KB
Hightotal:0kB
Highfree: 0kB
Lowtotal:3266180 KB
Lowfree:17456kB
Swaptotal:2048276kB
Swapfree:1968116 KB
Dirty:8kB
Writeback:0kB
Mapped:345360kB
Slab:112344kB
Committed_as:535292kB
Pagetables:2340 KB
vmalloctotal:536870911 KB
Vmallocused:272696kB
vmallocchunk:536598175 KB
Hugepages_total:0
Hugepages_free:0
Hugepagesize:2048kB

Analytical:

Memtotal: All available RAM sizes (that is, physical memory minus some reserved bits and the kernel's binary code size)
Memfree:lowfree and Highfree, the system keeps unused memory
buffers: Used to buffer the file
Cached: The size of the memory used by the cache memory (equal to DiskCache minus SwapCache).
Swapcached: Buffered cache memory (cache Memory) with the size of the swap space
           has been swapped out of the RAM, but is still stored in the swapfile. Used to quickly be replaced when needed without having to open the I/O port again.
Active: The size of the buffer or cache paging file in active use, unless it is necessary to be removed for use.
Inactive: The size of the paging file in the infrequently used buffer or cache memory may be used in other ways.
Hightotal:
Highfree: The zone is not mapped directly to the kernel space. The kernel must use this memory in a different manner.
Lowtotal:
Lowfree: Low can achieve the same effect as high memory, and it can be used by the kernel to record some of its own data structures. Among many
         other things, it's where everything from the Slab are
& nbsp;        allocated.  Bad things happen if you ' re out of Lowmem.

Swaptotal: Total size of swap space
Swapfree: Size of swap space not used
Dirty: The amount of memory waiting to be written back to disk.
Writeback: The amount of memory that is being written back to disk.
Anonpages: Memory size of unmapped pages
Mapped: Size of mappings such as devices and files.
Slab: The size of the kernel data structure cache can reduce the consumption of application and release memory.
Sreclaimable: recoverable slab size
Sunreclaim: Size of Slab not recoverable (Sunreclaim+sreclaimable=slab)
Pagetables: The size of the index table that manages the paging page of memory.
Nfs_unstable: The size of an unstable page table
Vmalloctotal: Can vmalloc virtual memory size
Vmallocused: The size of the virtual memory that has been used.
Vmallocchunk:largest contigious block of Vmalloc area which are free

------------------------------------------------------------------------------------------------------

Field resolution for the/proc/stat file:

UserSystemnice IdleIowaitIrqSoftirqcpu17906755 8637753312329 1322524322 29311124) 101704 1096939
Cpu0 46655642288313417357330376020720607199986297154
CPU1 4488897203521335197133074912872025820271926
CPU2 4434851226751330251833062214074551151718245786
CPU3 4317443204671324048333077703474473560 282073 Output Interpretation
Each parameter of the CPU and CPU0, CPU1, CPU2, CPU3 per line (in the first example) is:

Parameter interpretation
User (432661) accumulates from the start of the system to the current time, the CPU time (in jiffies), which does not include the nice value as a negative process. 1jiffies=0.01 sec
Nice (13295) accumulate from the start of the system to the current moment, the CPU time occupied by a process with a negative Nice value (unit: jiffies)
System (86656) accumulates at the current moment from the start of the boot, Core time (unit: jiffies)
Idle (422145968) accumulate from the start of the system to the current time, in addition to the hard disk IO wait time other than the Wait time (unit: jiffies)
Iowait (171474) accumulated from the start of the system to the current time, hard disk IO wait time (in jiffies),
IRQ (233) accumulates from the start of the system to the current moment, hard Interrupt time (unit: jiffies)
SOFTIRQ (5346) accumulated from the start of the system to the current moment, soft interrupt time (unit: jiffies)

CPU Time =USER+SYSTEM+NICE+IDLE+IOWAIT+IRQ+SOFTIRQ

The "Intr" line gives the interrupt information, the first is the number of interrupts that have occurred since the system started, and then each number corresponds to the number of times that a particular interrupt has occurred since the system started.
"Ctxt" gives the number of context exchanges that have occurred since the system started.
"Btime" gives the time, in seconds, from the start of the system to the present.
Processes (Total_forks) The number of tasks created since the system started.
"Procs_running": the number of tasks currently running the queue.
"Procs_blocked": the number of tasks that are currently blocked.

Then CPU utilization can use the following two methods. Take two sample points first, then calculate their difference:
CPU usage= (idle2-idle1)/(CPU2-CPU1) *100
CPU usage=[(user_2 +sys_2+nice_2)-(user_1 + sys_1+nice_1)]/(total_2-total_1) *100
The following is a CPU utilization calculation using Bash and Perl, respectively:
TOTAL_0USER[0]+NICE[0]+SYSTEM[0]+IDLE[0]+IOWAIT[0]+IRQ[0]+SOFTIRQ[0]
TOTAL_1=USER[1]+NICE[1]+SYSTEM[1]+IDLE[1]+IOWAIT[1]+IRQ[1]+SOFTIRQ[1]
CPU usage= (Idle[0]-idle[1])/(total_0-total_1) *

Proc File system for Linux

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.