Functions of several processes in Linux

Source: Internet
Author: User

Author: skate
Time: 2011/08/10

 

Functions of several processes in Linux

 

1. kswapd0

 

Linux uses kswapd for virtual memory management such that pages that have been recently accessed
Are kept in memory and less active pages are paged out to disk.
(What is a page ?)... Linux uses manages memory in units called pages.
So, the kswapd Process regularly decreases the ages of unreferenced pages... And at the end they are
Paged out (moved out) to disk

The system will wake up kswapd every time and check whether the memory is tight. If not, sleep. In kswapd, there are two valves.
Value: pages_hige and pages_low. When the number of idle memory pages is less than pages_low, The kswapd process scans the memory and
32 free pages are released each time until the number of free pages reaches pages_high.

 

In Linux, when the load is large (the memory is very tight), we usually see the two processes kswapd0 and kswapd1. If this process occupies
There are a lot of system resources, especially in the RAC environment, which will cause system downtime. If this process occupies a very high level of resources, you should consider optimizing the system, or
Add hardware resources.

2. kjournald

This is the log process of the ext3 file system and has three modes:

Journal:
Logs all filesystem data and metadata changes. The slowest of the three ext3

Journaling modes, this journaling mode minimizes the chance of losing the changes
You have made to any file in an ext3 filesystem. (record metadata changes on all file systems, the slowest mode ,)

Ordered:
Only logs changes to filesystem metadata, but flushes file data updates to disk
Before making changes to associated filesystem metadata. This is the default ext3
Journaling mode. (the default mode is used. Only metadata changed by the file system is recorded, and logs are recorded before the change)

Writeback:
Only logs changes to filesystem metadata but relies on the standard filesystem

Write process to Write File data changes to disk. This is the fastest ext3
Journaling mode. (The fastest mode, which records only modified metadata and writes data to the hard disk based on the standard file system write process)

Modify the working mode of ext3, for example

VI/etc/fstab
/Dev/hda5/OPT ext3 DATA = writeback 1 0

 

3. pdflush

Pdflush is used to synchronize the content in the memory with the file system. For example, when a file is modified in the memory
, Pdflush is responsible for writing it back to the hard disk. When the memory's junk page (dirty page) exceeds 10%, pdflush
The page will be backed up back to the hard disk. This ratio is adjustable, through the/etc/sysctl. conf
The default value of VM. dirty_background_ratio is 10.

 

You can also query it as follows:
CAT/proc/sys/Vm/dirty_background_ratio

 

4. ACPI

Is the abbreviation of Advanced Configuration and Power interface. d In acpid represents daemon. acpid is a service process in a user space. It acts as an interface for communications between the Linux kernel and applications,
Forwards the power management events in the kernel to the application. Common Operations supported are: "Power Switch",
"Battery monitoring", "laptop lid switch", "laptop display brightness", "Sleep", "hanging up", and so on.

Communication between acpid and kernel: acpid is mounted to the/proc/ACPI/Event file by using the poll function. The kernel
Drivers/ACPI/event. c implements the interface for this file. Once the bus event list (acpi_bus_event_list)
When a power management event occurs, the kernel will wake up the acpid mounted on/proc/ACPI/event, and then acpid.
Read the corresponding event from/proc/ACPI/event.

 

There are two communication methods between acpid and the application. One is through the local socket, the file name is/var/run/acpid. socket,
The application can receive power management events forwarded by acpid as long as it is connected to this socket without sending any command.

The second is through the configuration file. When acpid receives a power management event from the kernel, it executes the specified command according to the rules in the configuration file.
The configuration file is in the/etc/ACPI/events/directory. The following is an example:

 

[Root @ rac2 ~] # More/etc/ACPI/events/power. conf
# Acpid config to power down machine if powerbutton is pressed, but only if
# No gnome-power-manager is running

Event = button/power .*
Action =/bin/PS awwux |/bin/grep gnome-power-manager |/bin/grep-QV grep |/sbin/shutdown-H now
[Root @ etl-dbrac2 ~] #

 

There are records in the corresponding log file:

[Root @ rac2 ~] # Tail-20/var/log/acpid | more
[Fri Jul 29 01:28:56 2011] received event "button/power pwrf 00000080 00000001"
[Fri Jul 29 01:28:56 2011] policying client 6775 [68: 68]
[Fri Jul 29 01:28:56 2011] policying client 7739 [0: 0]
[Fri Jul 29 01:28:56 2011] Executing action "/bin/PS awwux |/bin/grep gnome-power-manager |/bin/grep-QV grep |/sbin/shutdown- h
Now"
[Fri Jul 29 01:28:56 2011] Begin handler messages
[Fri Jul 29 01:28:57 2011] End handler messages
[Fri Jul 29 01:28:57 2011] Action exited with status 0
[Fri Jul 29 01:28:57 2011] completed event "button/power pwrf 00000080 00000001"
[Fri Jul 29 01:33:18 2011] Starting up
[Fri Jul 29 01:33:18 2011] 1 rule loaded
[Fri Jul 29 01:33:23 2011] Client Connected from 6789 [68: 68]
[Fri Jul 29 01:33:23 2011] 1 client rule loaded
[Fri Jul 29 01:33:31 2011] Client Connected from 7792 [0: 0]
[Fri Jul 29 01:33:31 2011] 1 client rule loaded
[Sat Aug 6 03:16:37 2011] Starting up
[Sat Aug 6 03:16:37 2011] 1 rule loaded
[Sat Aug 6 03:16:45 2011] Client Connected from 6761 [68: 68]
[Sat Aug 6 03:16:45 2011] 1 client rule loaded
[Sat Aug 6 03:16:54 2011] Client Connected from 7723 [0: 0]
[Sat Aug 6 03:16:54 2011] 1 client rule loaded

 

5. gnome-power-Manager

 

Is an application that directly faces the end user and is also an intermediate layer. As the middle layer, acpid is too low for common applications,
However, gnome-power-manager provides higher-level service interfaces for other applications.

 

6. NetworkManager

Is a background process that automatically switches network connections. Many laptop users need to enable this function, which enables you to switch between a wireless network and a wired network. Most desktop users should disable the service. Some DHCP users may need to enable it.

 

 

 

---------- END ----------

 

 

 

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.