Linux performance monitoring and network commands

Source: Internet
Author: User

Recent need to collate commands for device performance monitoring (Linux)


1. Uptime

Eg:22:59:10 up, 23:05, 3 users, load average:0.29, 0.43, 0.94


One minute, five minutes, 15 minute load respectively

Represents the average number of processes waiting in the CPU wait queue per unit time


2. free [-B | -k| -m] Specifies the output unit

eg

Total used free shared buffers Cached

mem:8041612 3954464 4087148 644068 382832 1644220

-/+ buffers/cache:1927412 6114200

swap:10740732 157868 10582864


Total = used + Free

(-buffers/cache) Used memory: (refers to the first part of the Mem line in the used–buffers–cached)
(+buffers/cache) Free Memory: (refers to the first part of the Mem line of Free + buffers + cached)


3. DF [-H|-I|-T]-t display file system type

Df-ht

/dev/sda6 ext4 184G 67G 108G 39%/

None Tmpfs 4.0K 0 4.0K 0%/sys/fs/cgroup

Udev Devtmpfs 3.9G 4.0K 3.9G 1%/dev

Tmpfs tmpfs 786M 1.6M 784M 1%/run

None Tmpfs 5.0M 0 5.0M 0%/run/lock

None Tmpfs 3.9G 250M 3.6G 7%/RUN/SHM

None Tmpfs 100M 40K 100M 1%/run/user


Monitoring network:

Netstat

Options:

-S displays various protocol data statistics

-N Use digital form of IP, port number, user ID instead of host, protocol, user and other name information

-P Displays the process name and the corresponding process ID number

-L displays only the socket interface information being monitored

-U View UDP connection Information

-T View TCP


Netstat-lnp
TCP 0 0 127.0.1.1:53 0.0.0.0:* LISTEN


Top [-d|-p] Refresh interval view PID process information

Input m can be used according to memory usage, n can select output color according to process number, Z


Top-d 1-p


Route View routing Information

Route Add destination network GW gateway address

Route del Target Network


Route add default GW 192.168.1.1 Add the specified gateway as the Defaults gateway

Route add-net 172.16.9.0/24 GW 192.168.0.12 add gateway for specified network

Route add-net 192.168.18.0 netmask 255.255.255.0 dev eth0 Add routing records that specify data to be transferred to the Eth0 network segment via the 192.168.18.0 NIC

Route del default GW 192.168.18.1 Delete the Defaults gateway

Route Del-net 192.168.18.0/24 Delete a gateway record for a specified network segment


Traceroute-i using ICMP encapsulation

Traceroute-i www.google.com


Nslookup www.google.com

Server:127.0.1.1

Address:127.0.1.1#53


Non-authoritative Answer:

Name:www.google.com

address:78.16.49.15


Dig www.baidu.com


modifying kernel parameters

    1. Turn on route forwarding

      echo "1" >/proc/sys/net/ipv4/ip_forward

    2. Disable ICMP packets (ping-forbidden)

      echo "1" >/proc/sys/net/ipv4/icmp_echo_ignore_all

    3. Adjustment process can open the total amount of files

      echo "108248" >/proc/sys/fs/file-max

This article is from the Linux Learning Notes blog, so be sure to keep this source http://rockycai.blog.51cto.com/8871643/1879449

Linux performance monitoring and network commands

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.