Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
opcache committed Jun 6, 2020
1 parent da3f2f7 commit fe9217c
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
44 changes: 44 additions & 0 deletions harbor/harbor.api.diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh
## harbor API获取镜像地址,对比两个仓库差异
## 有问题可以反馈 https://aq2.cn/
##


> hub.aaa.all.2020xxxx.log
> hub.bbb.all.2020xxxx.log
for Project in `cat ccc.txt`; do
bash pp1.sh $Project >> hub.aaa.all.2020xxxx.log
done

sleep 10

for Project in `cat ccc.txt`; do
bash tt1.sh $Project >> hub.bbb.all.2020xxxx.log
done

> aa.aaa.xxxxa.log
> aa.aaa.xxxxb.log
for Project in `cat hub.aaa.all.2020xxxx.log`; do
echo "$Project" > a2.log
aaa=$(cat a2.log | awk -F ':' '{print $2}')
if [[ "${#aaa}" -ge "39" ]];then
echo "$Project" >> aa.aaa.xxxxa.log
else
echo "$Project" >> aa.aaa.xxxxb.log
fi
done

> bb.bbb.xxxxa.log
> bb.bbb.xxxxb.log

for Project in `cat hub.bbb.all.2020xxxx.log`; do
echo "$Project" > a3.log
aaa=$(cat a3.log | awk -F ':' '{print $2}')
if [[ "${#aaa}" -ge "39" ]];then
echo "$Project" >> bb.bbb.xxxxa.log
else
echo "$Project" >> bb.bbb.xxxxb.log
fi
done

diff aa.aaa.xxxxb.log bb.bbb.xxxxb.log |grep hub
38 changes: 38 additions & 0 deletions shell/mem.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
## 内存排查命令
## http://www.aqzt.com
## 有问题可以反馈 https://aq2.cn/
## centos 6和centos 7

# 查内存占用情况
ps -e -o 'pid,comm,args,pcpu,rsz,vsz,stime,user,uid'
# 其中rsz是是实际内存
ps -e -o 'pid,comm,args,pcpu,rsz,vsz,stime,user,uid' | grep java | sort -nrk5
# 其中rsz为实际内存,上例实现按内存排序,由大到小

# 查内存占用情况
ps -aux | sort -k4nr | head -n 10

# 使用指令查看占用的物理内存,
ps aux|awk '{sum+=$6} END {print sum/1024}'

# 使用指令,核实进程的最大使用内存量
ps -eo pid,rss,pmem,pcpu,vsz,args --sort=rss

# 查内存命令
ps p 916 -L -o pcpu,pmem,pid,tid,time,tname,cmd

# 排查高CPU占用介绍的PS命令
ps -mp 9004 -o THREAD,tid,time,rss,size,%mem

# 分析具体的对象数目和占用内存大小
jmap -histo:live [pid]

# 利用MAT工具分析是否存在内存泄漏等等。
jmap -dump:live,format=b,file=xxx.xxx [pid]

# 可以根据进程查看进程相关信息占用的内存情况:
pmap -d 14596

# 常用
free -m

0 comments on commit fe9217c

Please sign in to comment.