Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize Linux system performance testing and Monitoring

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to achieve Linux system performance testing and monitoring. I think it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.

Performance testing ([Unixbench])

[root@localhost] $. / Run calculation to view the current CPU load (uptime)

[root@localhost] $uptime test single cpu computing power (bc)

[root@localhost] $time echo "scale=5000;4*a (1)" | memory usage of bc-l-Q processes (pmap)

[root@localhost] $pmap-d 35713 View the memory consumption of process 35713

Disk IO Test (dd)

Test the IO write speed of the disk

IO read speed of time dd if=/dev/zero of=test.dbf bs=8k count=300000 oflag=direct test disk

Dd if=test.dbf bs=8k count=300000 of=/dev/null means writing / reading 8k of data each time, executing 300000 times.

View the io (iostat) of each disk in real time

[root@localhost] $yum install sysstat [root@localhost] $iostat-x 1 100 Test of disk iops (fio)

Install fio

[root@localhost] $yum install fioioengine: load engine. We usually use libaio to initiate asynchronous IO requests.

Bs: IO siz

Direct: write directly, bypass the operating system Cache. Because we are testing the hard drive, not the Cache of the operating system, it is set to 1.

Rw: read-write mode, including sequential write write, sequential read read, random write randwrite, random read randread, etc.

Size: addressing space, IO will fall on the hard disk space in the range of [0, size). This is a parameter that can affect IOPS. It is generally set to the size of the hard disk.

Filename: test object

Iodepth: queue depth, which only makes sense when using libaio. This is a parameter that can affect IOPS.

Runtime: test duration

4K random write test

[root@localhost] $fio-ioengine=libaio-bs=4k-direct=1-thread-rw=randwrite-size=100G-filename=/dev/vdb-name= "EBS 4KB randwrite test"-iodepth=32-runtime=604K Random read Test

[root@localhost] $fio-ioengine=libaio-bs=4k-direct=1-thread-rw=randread-size=100G-filename=/dev/vdb-name= "EBS 4KB randread test"-iodepth=8-runtime=60512KB sequential write test

[root@localhost] $fio-ioengine=libaio-bs=512k-direct=1-thread-rw=write-size=100G-filename=/dev/vdb-name= "EBS 512KB seqwrite test"-iodepth=64-runtime=60 process read and write to disk (iotop)

Install iotop

[root@localhost] $yum install iotop run iotop to see how the process reads and writes to the disk

[root@localhost] $iotop # View disk reads and writes of all processes [root@localhost] $iotop-o # View current process reads and writes to disks in real time (recommended) [root@localhost] $iotop-p 34323 # View process number 34323 pairs of disk read and write monitoring alarms you can use the following command to obtain io data

[root@localhost] $iotop-botqqq-- iter=3 Network Test (iperf)

Start the server

[root@localhost] $yum install iperf3-y [root@localhost] $iperf3-s client to test

[root@localhost] $yum install iperf3-y [root@localhost] $iperf3-c 10.2.2.2-P 5 and above defaults to TCP testing. If you want to UDP testing, you need to add-u to both server startup and client testing.

# # iperf3-s-u 123 # # client ```clike iperf3-c 10.2.2.2-P 5-u Network Test (qperf)

Start the server

[root@localhost] $yum install qperf-y [root@localhost] $qperf client to test network delay

[root@localhost] $yum install qperf-y [root@localhost] $qperf 10.2.2.2-t 100-oo msg_size:8:256K:*2 tcp_bw client to test network bandwidth

[root@localhost] $yum install qperf-y [root@localhost] $qperf 10.2.2.2-t 100-oo msg_size:8:256K:*2 tcp_bw delay and bandwidth can be tested together

[root@localhost] $qperf 10.2.2.2-t 100-oo msg_size:8:256K:*2 tcp_bw tcp_lat Network Card Traffic Monitoring (nload)

Install nload

[root@localhost] $yum install nload monitors the input and output of network card traffic

[root@localhost] $nload eth0 eth2DNS Service stress testing tool (queryperf)

Queryperf [- d datafile] [- s server_addr] [- p port] [- Q num_queries]-d: followed by a file, the content of the file is the user's request for DNS, and one line is a request, so in order to test, we can write tens of thousands of entries in it.

-s: DNS server address

-p: DNS server port

-Q: how many times have you requested

Use the vim command to create a request file: vim querytest.txt

Www.example.com An example.com NS tftp.example.com CNAME blog.example.com A.... # 6 million Line execute Test Command

[root@localhost] $queryperf-d querytest.txt-s above 192.168.0.6 is how to achieve Linux system performance testing and monitoring. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report