Linux operating system-command-netstat

Source: Internet
Author: User

# There have been 3 Linux commands related to the performance test, which are free,top,vmstat

# The next 2 commands also need to be written down:netstat and iostat

Recently carefully read 1 articles on "Positioning performance Bottlenecks" (http://techblog.youdao.com/?p=961), so the performance of this matter still have to step by, knowledge accumulated to a certain extent, in the process of using the formation of experience. So what can we do with free, top, vmstat, Netstat and Iostat mentioned earlier? In fact, in that article has already mentioned: can get to the following types of situations, to help us analyze performance.

    • High CPU consumption
    • Less physical Memory headroom
    • High disk IO consumption
    • Change in, swap out too much
    • Excessive number of network links

So, at least these 5 Linux commands are still more important, you have to clear the command "show", and then gradually further to the higher technology forward.

# It's a lot of crap and it doesn't waste electricity

# in that article, there are a few tools mentioned:

    • Jstat -Viewing the Java heap occupancy rate
    • Jstack -
      • Dead lock
      • Dead loop
      • Data structure Exceptions
      • Centrally waiting for responses from external services
    • Jmap -/
    • Mat -Analyze what objects in memory reference a large number of objects

# It's a lot of crap and it doesn't waste electricity

# Top Extension usage

    • SHIFT + P: Sort processes by CPU usage from highest to lowest for easy troubleshooting
    • SHIFT + M: View memory usage
    • Shift + H: Observe thread-level CPU usage distributions

-------------------------the above content reference and excerpt from http://techblog.youdao.com/?p=961, see, Command and tools add up to less than 10-------------------------

# Here's the introduction of netstat.

# Critical Reference: http://www.cnblogs.com/ggjucheng/archive/2012/01/08/2316661.html

Concept

Netstat, print network connections, routing tables, interface states, spoofing connections, multicast members, and other networking-related information.

1 usage within Linux

Netstat

Parameters that can be used

#提示: The status of listen and listening can only be seen with-a or-l

-A (All) displays all options and does not show listen related by default
-T (TCP) displays only TCP-related options
-U (UDP) displays only UDP-related options
-N refuses to display aliases, showing all numbers converted to numbers.
-l list only service status in Listen (listening)
-P Displays the program name that establishes the associated link
-R display routing information, routing table
-e display extended information, such as UID, etc.
-S statistics according to each protocol
-C executes the netstat command every other fixed time.

Introduction to the fields in the output list

Active Internet Connections

Note

Proto

Show the protocols used by the connection

Recv-q

Receive Queue

Send-q

Send Queue

Local Address

Foreign Address

State

Active UNIX domain sockets

Note

Proto

Show the protocols used by the connection

Refcnt

Connection to the process number on this set of interfaces

Flags

Type

Types of socket interfaces

State

Current state of the socket interface

I-node

Path

Path name used by other processes connected to the socket interface

Linux operating system-command-netstat

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.