squid

一,squid清空某url缓存

sudo /usr/local/squid/bin/squidclient -h 127.0.0.1 -m PURGE http://xxx.com/s/i/main.css

 

二,重启squid

#!/bin/sh
# restart squid.
sq="`ps aux |grep 'squid' |grep -v 'grep'|awk '{print $2}'`"
for pid in ${sq}
do
    sudo kill -9 ${pid}
done
sleep 2
sudo /usr/local/squid/sbin/squid -s

 

三,模拟测试

echo -e "GET / HTTP/1.1\r\nHost:xxx.com\r\n\r\n"|nc 192.168.1.1 80 |iconv -f utf8 -tgbk

 

四,检查丢包

mtr ip   检查丢包

 

五,分析日志

cat /data/logs/1.log | awk '{print $1}'|sort|uniq -c |sort -n -r> xxx.out

 

六,查找过期文件并删除

find /data/ -type f -mtime +2 | xargs rm -rf

 

七, 查看命中率信息

sudo /usr/local/squid/bin/squidclient -h 127.0.0.1  mgr:info

 

你可能感兴趣的:(C++,c,css,F#,C#)