IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> linux问题排查调试记录 -> 正文阅读

[系统运维]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
  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-07-17 17:01:55  更:2022-07-17 17:04:48 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/18 19:47:22-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码