随笔分类 -  工具

上一页 1 2

gdb调试命令
摘要:只执行当前线程 不切换线程set scheduler-locking on 附着到worker进程调试 以调试nginx为例gdb attach 12400打断点b src/event/modules/ngx_epoll_module.c:860 继续执行c客户端发起请求curl localhost 阅读全文

posted @ 2023-11-04 15:19 王景迁 阅读(35) 评论(0) 推荐(0)

验证2个节点udp和tcp可通性
摘要:nc-u表示udp,默认是tcp。-l表示作为server监听。-4表示只能使用IPv4地址。-6表示只能使用IPv6地址(老版本ipv6可能不支持指定地址)。 server:192.168.0.104上开启udp 123端口server发送11 client:连接192.168.0.104上udp 阅读全文

posted @ 2023-11-01 23:11 王景迁 阅读(87) 评论(0) 推荐(0)

vmware创建虚拟机后必备操作
摘要:时区设置成东八区 rm -f /etc/localtime ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 桥接模式联网 # VMWare Workstation -> 虚拟机 -> 设置 -> 网络适配器 -> 选择 “桥接模式” -> 阅读全文

posted @ 2023-10-01 11:09 王景迁 阅读(73) 评论(0) 推荐(0)

dlv分析GO高CPU应用
摘要:delve是golang推荐的go语言调试工具。 构造100% CPU应用 package main import ( "time" ) func add() { i := 0 for { i++ } } func main() { go add() time.Sleep(time.Hour) } 阅读全文

posted @ 2023-04-19 16:53 王景迁 阅读(214) 评论(0) 推荐(0)

stress模拟压力
摘要:安装 yum install -y epel-release yum install -y stress 耗尽1个CPU stress --cpu 1 --timeout 60 top 耗尽内存 stress --vm 1 --vm-bytes 2G --vm-keep free -h 耗尽磁盘IO 阅读全文

posted @ 2023-04-15 13:53 王景迁 阅读(46) 评论(0) 推荐(0)

Maven
摘要:安装Maven wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip unzip apache-maven-3.6.3-bin.zip -d /u 阅读全文

posted @ 2023-03-26 09:01 王景迁 阅读(35) 评论(0) 推荐(0)

高CPU Java应用分析
摘要:模拟CPU 40%左右 import java.util.concurrent.CountDownLatch; public class Main extends Thread { private CountDownLatch c; public Main(String name, CountDow 阅读全文

posted @ 2023-02-18 15:46 王景迁 阅读(44) 评论(0) 推荐(0)

execsnoop
摘要:作用 execsnoop通过ftrace实时监控进程的exec()行为,输出短时进程的信息,包括进程 PID、父进程 PID、命令行参数以及执行的结果。 安装execsnoop git clone --depth 1 https://github.com/brendangregg/perf-tool 阅读全文

posted @ 2023-02-16 07:48 王景迁 阅读(361) 评论(0) 推荐(0)

fio测试IOPS
摘要:安装fio yum install fio -y 选择磁盘/dev/sda 随机写每个线程写入512M文件,单个块大小为16K,5个线程运行5秒测试完成后不会保留写入的大文件 # 创建空文件 touch /root/test1 # filename指定空文件测试IOPS fio -filename= 阅读全文

posted @ 2023-02-12 15:04 王景迁 阅读(117) 评论(0) 推荐(0)

Linux上下文切换分析工具
摘要:命令介绍 每隔5秒输出系统总体上下文切换情况 vmstat 5 列名 含义 cs 每秒上下文切换的次数 in 每秒中断的次数 r 正在运行和等待CPU的进程数 b 不可中断睡眠状态的进程数 每隔5s输出进程上下文切换情况 pidstat -w 5 列名 含义 cswch 每秒自愿上下文切换(进程无法 阅读全文

posted @ 2023-02-11 16:23 王景迁 阅读(145) 评论(0) 推荐(0)

curl
摘要:打印curl总耗时 echo "time_total is %{time_total}s\n" > curl-format.txt curl -w "@curl-format.txt" -o /dev/null -s -L http://localhost:1000/test -w:从文件中读取打印 阅读全文

posted @ 2023-01-08 19:34 王景迁 阅读(85) 评论(0) 推荐(0)

tcpdump
摘要:安装tcpdump 通过yum命令来直接安装(推荐) yum install tcpdump -y 通过源码来安装tcpdump # 登录http://www.tcpdump.org/,下载源码包。 # 下载tcpdump-4.9.3.tar.gz和libpcap-1.9.1.tar.gz。 # 安 阅读全文

posted @ 2022-03-05 09:17 王景迁 阅读(3621) 评论(0) 推荐(0)

git
摘要:提交本地仓库 git init git remote add origin git@xxx.git git add . git commit -m "xxx" git push -u origin master 管理分支和tag # 查看本地git分支 git branch # 删除本地分支 git 阅读全文

posted @ 2022-01-23 22:06 王景迁 阅读(155) 评论(0) 推荐(0)

上一页 1 2

导航