Aaron2932

导航

检查一个容器的进程绑核情况

获取容器id

#!/bin/bash

now=$(date +%s)

dockerids=$(docker ps | grep xx-pod | grep yy-container | awk '{print $1}')

for item in ${dockerids[@]}; do
	echo "dockerid: ${item}"
	echo "dockerid: ${item}" >>> ${now}_result.txt
	docker exec ${item} bash -c "ps -elL | grep zzz-proc | awk '{print \$6}' | xargs -I {} taskset -pc {} " >>> ${now}_result.txt
done


posted on 2022-08-28 16:35  Aaron2932  阅读(28)  评论(0编辑  收藏  举报