Linux_ zombie Processes, mounts, block blocks, inode numbers

Source: Internet
Author: User
Tags cpu usage

Zombie Process:

Basic concepts:

Processes are divided into parent and child processes

Parent process a dead child process will die

The child process will also be killed when the main process is killed.

Zombie Process: The main process was killed, but the child process is still alive. The child process does not consume the CPU but still takes up memory resources

NI priority: The higher the NI value, the lower the priority level

Id:idle Idle CPU remaining CPU

Cpu (s): 46.8%us, 51.2%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.4%hi, 1.6%si, 0.0%st

If WA occupies a higher CPU, it represents the presence of IO operations

Hi Hard Interrupt

Si: Soft Interrupt

ST: The stolen resource proves that the virtual machine is running on the machine

mem:1004764k Total, 583968k used, 420796k free, 41064k buffers

swap:2031608k Total, 0k used, 2031608k free, 227248k cached

Swap in: If the used >0 indicates that the virtual memory is being used, the physical memory is not sufficient

Cache:cache is the cache: The CPU is used to avoid frequent de-fetching of data in memory, so the frequently called data is placed in the cache:

Buffer: Yes buffers: prevents memory from often trying to get data from the disk, and buffers the data used by the process into buffers

Both buffer and cache are memory spaces

Maximum CPU usage Sort: M

The most memory-occupied sort: p

Toggle Reference Path or app name: C

---------------------------------------the free command

user:584184 Total allocated memory regardless of whether you have been used

41304 227368 represents a buffer that has been allocated but has not been used, and the unused cache

The memory that has been allocated and is actually used is buffer and cache, which is 315512 actual use.

Total Allocated Memory:

[[email protected] ~]# echo $[41304+227368+315512]

584184

The remaining free memory:

[[email protected] ~]# echo $[227372+41360+420332]

689064

-----------------------------PS Command

PS means the process Seacher

[[Email protected] tmp]# PS aux | grep ' init ' | Grep-v ' grep '

Root 1 0.0 0.1 19364 1540? Ss 08:15 0:08/sbin/init

Grep-v indicates a reverse match with no grep results

Run the program after adding & on behalf of the background

Jobs view programs running in the background

FG%1 1 represents the work number so that the program running in the background can be transferred to the foreground.

Kill-9%1 using a work number can also kill programs with less

BG%1 runs directly in the background with less

Pstree | grep ' bash ' view process tree

SSHD---Bash---bash-+-grep

Pkill-9 ' Java ' kills by name process

More content than kill-9 killed.

--------------------------------------------------Disk and Mount

One sector 512 bytes

The file directory where the device is stored

Ls/dev | grep ' SD '

[Email protected] dev]# Ls/dev | grep ' SD '

Sda

Sda1

Sda2

Sda3

Description only a disk, SDA but was divided into 3 districts sda1 sda2 Sda3

Locate the device under the

Fdisk-l/DEV/SDA

disk/dev/sda:24.7 GB, 24696061952 bytes #磁盘大小

255 heads, Sectors/track, 3002 cylinders

#有多少个磁头heads How many sectors 63 have the number of cylinders cylinders

Units = Cylinders of 16065 * 8225280 bytes

Sector size (logical/physical): bytes/512 bytes #扇区 size 512 bytes

I/O size (minimum/optimal): bytes/512 bytes #硬盘输入输出的大小

Disk identifier:0x000ec92e

Operating system to write all data to the hard drive once read 512 bytes write into hard disk

But in the operating system, the data is stored as a block

A block is 8*512, which is a block equivalent to 8 sectors, which means that the operating system will perform similar batch processing.

A block is the size of 4Kb

Block storage: is equivalent to a hard disk

File storage: The file is stored in the form of a folder

Object storage: Baidu Network disk

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

Mount and disk relationships

Filesystem 1k-blocks used Available use% mounted on

/dev/sda2 21435260 7456472 12889920 37%/

Total number of file system blocks the total amount of blocks used to block the number of blocks to use the percentage hanging at the point

Df-h #用G为单位显示数据

Mount to view specific mount parameters

Du-s/local to view a directory size or file size

At this level of the operating system, the hard disk is considered a block of one

There are two parts of a block in a partition called the data block block and the other part called the Inode block.

Data BLOCK: Store the contents of the file, data

Inode: the permission to store a file metadata file belongs to the group main lamp information

Ls-i (view inode information for files)

525584 inode Number

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

The hard drive is full of two forms full

The first is that the content is full of a file, but the file has 1000T, resulting in the contents of the hard disk space is exhausted

This appears more

[Email protected] usr]# df-h

Filesystem Size used Avail use% mounted on

/dev/sda2 21G 7.2G 13G 37%/

Tmpfs 491M 100K 491M 1%/DEV/SHM

/DEV/SDA1 291M 33M 244M 12%/boot

Second full: A hard drive may have built 100 million empty files that do not occupy the data space but the inode number is not enough for the inode number.

This appears in the log file may be more

[Email protected] usr]# df-i

Filesystem inodes iused IFree iuse% mounted on

/dev/sda2 1362720 164001 1198719 13%/

TMPFS 125595 4 125591 1%/DEV/SHM

/DEV/SDA1 76912 76874 1%/boot

Test drive Read and write speed:

DD If=/dev/zero of=/sdb5/test BS 10G count=1

DD IF=/DEV/SDA1 of=/sdb5/test BS 10G

Reference:

Https://www.cnblogs.com/ddwapple/p/4593599.html

Http://www.ruanyifeng.com/blog/2011/12/inode.html

Linux_ zombie Processes, mounts, block blocks, inode numbers

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.