Linux Performance Query Common directives

Source: Internet
Author: User
Tags response code cpu usage disk usage

Category Monitoring instructions Describe Note

Memory

Bottleneck

Free View Memory usage

Cpu

Bottleneck

Top-hp See the process with the highest CPU usage
Vmstat 3 (interval time) 100 (number of monitors) View Swap in/out location performance bottlenecks Recommended Use
PS-LP Process Number CU To view the CPU consumption sort for a process

Cat/proc/cpuinfo

|grep ' Processor ' |wc-l

To view the number of CPU cores
Top

View CPU overall consumption,

Include sub-item consumption

such as User,system,idle,

Nice and other consumption

top

show Java threads,

then shift+m:

by memory

use to sort;

shift+p:

Span style= "font-family: Song body; Font-size:12px "> sort by CPU time;

shift+t:

cumulative by CPU

use time sort

multicore CPU,

Press "1" to enter top view

Internet

Bottleneck

Cat/var/log/messages Check the kernel log to see if the packet is dropped
Watch More/proc/net/dev

For locating drops, packet errors,

To see network bottlenecks

Focus on drop (packet discarded)

And the total amount of network packets delivered,

Do not exceed the network limit

Netstat-i viewing network errors
Ping IP Test Network performance

Disk

Bottleneck

Iostat-x-k-d 1 Disk IO read and write status

High,

Span style= "font-family: Song body; Font-size:12px "> The first thing to check is machine

Is there a lot of

Span style= "font-family: Song body; FONT-SIZE:12PX "> Use swap space,

Span style= "font-family: Song body; Font-size:12px "> is the CPU consumption is very large,

If large description disk

Iostat-x View the read and write status of each disk in the system

Focus on await

And Iowait's CPU share

Iotop See which process is reading IO in bulk

Generally first through Iostat

To see if there is an IO bottleneck,

Reposition which process is

Bulk Read IO

Df-hl View disk space remaining
Du-sh View the current disk usage space

Application

Bottleneck

Ps-ef|grep Java To view the ID number of a process
Ps-ef|grep java|wc-l View the number of specific processes
Netstat-tln|grep 8080 View Port Usage
lsof-i:8080 See which process the port belongs to

Cat ***.log | grep ***exception

| Wc-l

Statistics log file contains the specific number of exceptions
Jstack-l PID Used to see if a thread has a deadlock
Grep-v ' http/1.1″200′ Remove a URL that is not a 200 response code
PS-EFL | grep [PID] | Wc-l To view the number of threads created by a process
Find/type f-name "*.log" |xargs grep "ERROR"

Count all the log files,

Line containing the error character

This is troubleshooting.

More useful in the process

JSTAT-GC [PID] View GC Status
jstat-gcnew [PID]

Check out the memory usage of the young area,

including MTT (maximum number of interactions is

Is swapped to the old area),

TT is the number of times that has been exchanged now

Jstat-gcold Viewing memory usage in the old area

Jmap-j-d64-dump:format=b,

File=dump.bin PID

Dump out Memory Snapshot

-j-d64 prevent Jmap from causing

Virtual machine crash (Jdk6 bug)

Xx:+heapdumponoutofmemeryerror

When Java is started, add the

When a memory overflow occurs, the

Storage Memory Snapshots

Jmap-histo [PID] Sort by object memory size Note that it causes the full GC
  memory snapshot of export complete

usual and jmap-permstat

/opt/**/java Gcore.bin

Use the core dump

Convert to heap dump

 

- Xx:heapdumppath=/home/logs

-xloggc:/home/log/ Gc.log

-xx:+printgcdetails

-xx:+printgcdatestamps

print GC log

 

-server-xms4000m-xmx4000m

-xmn1500m-xss256k

-xx:permsize=340m-xx:maxpermsize=340m

-xx:+useconcmarksweepgc

Sizing the JVM Heap XSS is the stack size

Linux Performance Query Common directives

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.