MySQL Memory usage

Source: Internet
Author: User
Tags cpu usage

You can view the contents of the%mem directly after you use the top command. You can choose to view by process or by user, if you want to see the process memory usage of the Oracle user, you can use the following command:

(1) Top

The top command is a common performance analysis tool under Linux that shows the resource usage of individual processes in the system in real time, similar to the Task Manager for Windows

You can view the contents of the%mem directly after you use the top command. You can choose to view by process or by user, if you want to see the process memory usage of the Oracle user, you can use the following command:
$ top-u Oracle

Content Explanation:

PID: ID of the process
USER: Process Owner
PR: The priority level of the process, the smaller the higher the priority is executed
Ninice: Value
VIRT: Virtual memory consumed by the process
RES: The physical memory occupied by the process
SHR: Shared memory used by the process
S: The state of the process. s for hibernation, R for running, Z for Zombie, n for the process priority value is negative
%CPU: Process Consuming CPU utilization
%MEM: The percentage of physical memory and total memory used by the process
Time+: The total CPU time that is consumed after the process is started, which is the cumulative value of the CPU usage time.
Command: Process start name

Common commands:

P: Ranked by%CPU usage rate
T: Rank by mite+
M: Ranked by%mem

(2) Pmap

Depending on the process, you can view the memory used by the process-related information (the process number can be viewed by PS) as follows:
$ pmap-d 14596

(3) PS

As shown in the following example:
$ ps-e-O ' pid,comm,args,pcpu,rsz,vsz,stime,user,uid ' where Rsz is the actual memory
$ ps-e-o ' pid,comm,args,pcpu,rsz,vsz,stime,user,uid ' |  grep Oracle | Sort-nrk5
Where Rsz is the actual memory, the above example is implemented by memory sort, from large to small

View the top 5 processes that occupy memory

ps aux | sort -k4nr | head -n 5

See the 5 most CPU-intensive processes

ps aux | sort -k3nr | head -n 5

 

查看所有信息使用命令

ps aux

# PS aux |more
USER PID%cpu%MEM VSZ RSS TTY STAT START time COMMAND
Root 1 0.0 0.0 4772 564? S Sep22 0:03 init [3]
Root 2 0.0 0.0 0 0? S Sep22 0:03 [migration/0]
Root 3 0.0 0.0 0 0? SN Sep22 0:00 [ksoftirqd/0]
Root 4 0.0 0.0 0 0? S Sep22 0:02 [MIGRATION/1]
Root 5 0.0 0.0 0 0? SN Sep22 0:00 [KSOFTIRQD/1]
Root 6 0.0 0.0 0 0? ss+ Sep22 0:02 [MIGRATION/2]
Root 7 0.0 0.0 0 0? SN Sep22 0:00 [KSOFTIRQD/2]
Root 8 0.0 0.0 0 0? S Sep22 0:00 [MIGRATION/3]
Root 9 0.0 0.0 0 0? SN Sep22 0:00 [KSOFTIRQD/3]
Root 10 0.0 0.0 0 0? s< Sep22 0:00 [MIGRATION/4]

The above-mentioned linked fields are explained:

Owner of the USER process;
The ID of the PID process;
PPID parent process;
Percentage of CPU consumed by the%CPU process;
%MEM% of memory occupied;
The nice value of the NI process, which is large, means that it consumes less CPU time;
VSZ The amount of virtual memory used by the process (KB);
The fixed amount of memory (in kilobytes) that the RSS is taking up (the number of pages residing);
The TTY should be running on that end (the terminal position of the landing), if it is not relevant to the end, it is displayed (? )。 If the pts/0, it means that the network connects the host
Wchan If the previous process is in progress, if-that means it is in progress;
Start time the process is initiated;
The time that the process actually uses the CPU to run the line;
The name and parameters of the command commands;

Stat-state frequently-used state characters

D a dormant state (usually IO process) that cannot be interrupted;
R is running can be in the queue can be too line;
S is in a dormant state;
T stop or be traced;
W enters memory swap (invalid starting from kernel 2.6);
X dead process (basic rarely seen);
Z Zombie process;
< high-priority processes
N Low-priority processes
L Some pages are locked into memory;
Leader of the S-process (under it there are sub-processes);
L multi-process (using Clone_thread, similar to NPTL pthreads);
+ Process Group located in the background;

Top
3
Step
 

MySQL Memory usage

Related Article

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.