linux问题排查调试记录

一、本机地址网络出口

curl myip.ipip.net

[dev@-server-002 ~]$ curl myip.ipip.net
当前 IP:42.157.193.12  来自于:中国 广东 东莞  电信
[dev@-server-002 ~]$ 

二、全链路追踪

traceroute -n www.baidu.com

[dev@-server-002 ~]$  traceroute -n www.baidu.com
traceroute to www.baidu.com (14.215.177.39), 30 hops max, 60 byte packets
 1  172.16.16.254  1.754 ms  1.794 ms  1.958 ms
 2  * * *
 3  42.157.193.1  5.699 ms  6.282 ms  6.676 ms
 4  172.20.222.4  9.320 ms  9.295 ms  9.565 ms
 5  172.20.201.8  9.174 ms  9.112 ms  8.929 ms
 6  * * *
 7  119.147.132.225  4.733 ms * *
 8  121.14.130.89  5.762 ms 183.60.128.157  9.919 ms 183.60.171.181  10.185 ms
 9  * * *
10  113.96.4.174  8.486 ms 113.96.4.214  12.357 ms 113.96.5.50  31.809 ms
11  121.14.14.162  9.834 ms 219.135.96.86  10.521 ms  9.709 ms
12  14.29.121.182  11.617 ms 14.29.121.186  11.314 ms 14.29.121.190  14.460 ms
13  * * *
14  * * *
[dev@-server-002 ~]$ 

三、磁盘监控

iostat -xm 1

[dev@-server-002 ~]$ iostat -xm 1
Linux 3.10.0-1160.53.1.el7.x86_64 (idc-sz-a-bigdata-algo-dev-server-002) 	07/14/2022 	_x86_64_	(8 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          14.21    0.00    2.16    0.01    0.00   83.62

Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sdb               0.00     0.37    0.21   21.05     0.02     0.64    63.21     0.01    0.62    0.96    0.62   0.07   0.15
sda               0.00     0.07    0.18    3.26     0.01     0.06    40.70     0.00    0.42    0.99    0.39   0.09   0.03
dm-0              0.00     0.00    0.18    3.32     0.01     0.06    39.95     0.00    0.44    0.99    0.41   0.09   0.03
dm-1              0.00     0.00    0.00    0.00     0.00     0.00     8.25     0.00    0.67    0.17    0.68   0.20   0.00

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           1.38    0.00    1.13    0.00    0.00   97.48

Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sdb               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
sda               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
dm-0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
dm-1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00


四、压测

安装: yum install -y httpd-tools

ab -n 1000 -c 10 https://www.baidu.com

[dev@-server-002 ~]$ ab -n 1000 -c 10 https://abtest-tx-guangzhou-01.saas.xxxx.cn/api/v2/abtest/online/results
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking abtest-tx-guangzhou-01.saas.xxxx.cn (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        
Server Hostname:        abtest-tx-guangzhou-01.saas.xxxx.cn
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /api/v2/abtest/online/results
Document Length:        94 bytes

Concurrency Level:      10
Time taken for tests:   4.378 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      263000 bytes
HTML transferred:       94000 bytes
Requests per second:    228.44 [#/sec] (mean)
Time per request:       43.776 [ms] (mean)
Time per request:       4.378 [ms] (mean, across all concurrent requests)
Transfer rate:          58.67 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       22   29   5.2     29     104
Processing:    12   14   2.7     14      82
Waiting:       11   14   2.6     13      80
Total:         33   43   6.3     42     128

Percentage of the requests served within a certain time (ms)
  50%     42
  66%     44
  75%     45
  80%     46
  90%     47
  95%     49
  98%     54
  99%     60
 100%    128 (longest request)
[dev@-server-002 ~]$ 

post.json

{
    "anonymous_id":"EE971B6F-4B8A-4E93-942C-5F94D8250E33",
    "login_id":"EE971B6F-4B8A-4E93-942C-5F94D8250E33",
    "platform": "API",
    "properties":{}
}
[dev@-server-002 ~]$  ab -n 1000 -c 100 -k -T application/json -p post.json -k https://abtest-tx-guangzhou-01.saas.xxxx.cn/api/v2/abtest/online/results?project-key=yyyyy
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking abtest-tx-guangzhou-01.saas.xxxx.cn (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        
Server Hostname:        abtest-tx-guangzhou-01.saas.xxxx.cn
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /api/v2/abtest/online/results?project-key=yyyyy
Document Length:        685 bytes

Concurrency Level:      100
Time taken for tests:   0.953 seconds
Complete requests:      1000
Failed requests:        800
   (Connect: 0, Receive: 0, Length: 800, Exceptions: 0)
Write errors:           0
Non-2xx responses:      800
Keep-Alive requests:    0
Total transferred:      405000 bytes
Total body sent:        430000
HTML transferred:       205800 bytes
Requests per second:    1048.77 [#/sec] (mean)
Time per request:       95.350 [ms] (mean)
Time per request:       0.953 [ms] (mean, across all concurrent requests)
Transfer rate:          414.80 [Kbytes/sec] received
                        440.40 kb/s sent
                        855.20 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       27   57   9.8     57      89
Processing:    12   27  10.3     24      63
Waiting:       12   21   6.1     19      51
Total:         57   84  12.6     81     133

Percentage of the requests served within a certain time (ms)
  50%     81
  66%     88
  75%     92
  80%     94
  90%    102
  95%    108
  98%    114
  99%    117
 100%    133 (longest request)
[dev@-server-002 ~]$ 



五、抓包

tcpdump

抓包ens192网卡上的所有包,并写到文件

tcpdump -i ens192 -w /tmp/sensors-ab-all.cap

抓地址420.194.153.172的包

tcpdump host 420.194.153.172 -w /tmp/sensors-ab.cap

上面命令会抓默认网卡上的包,若是多个网卡需要指定网卡,可以通过ifconfig命令查看,选择网卡名称即可

抓ens192网卡上的地址420.194.153.172的包

tcpdump -i ens192 host 420.194.153.172 -w /tmp/sensors-ab-ip.cap

抓ens192网卡上的地址abtest-tx-guangzhou-01.saas.xxxx.cn的包

tcpdump -i ens192 host abtest-tx-guangzhou-01.saas.xxxx.cn -w /tmp/sensors-ab.cap
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值