系统网卡性能,丢包率与下载上传,ulimit设置
生活随笔
收集整理的這篇文章主要介紹了
系统网卡性能,丢包率与下载上传,ulimit设置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
參數查考請看
iperf3與ulimit文檔
Linux命令 iperf - 網絡性能測試工具_kali_yao的博客-CSDN博客?
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes)_kali_yao的博客-CSDN博客
?可測試多臺機器
#!/bin/bash read -p "server ip:" server #交互式輸入ip read -p "time:" t #設置測試時間 a=($server) #設置數組 P=0% #設置正常丟包率 # install package #安裝測試軟件包 for i in ${a[*]} dossh $i rpm -q epel-release-7-14.noarch iperf3-3.1.7-2.el7.x86_64 speedtest-cli-2.1.3-1.el7.noarch >> /dev/null if [ $? -ne 0 ];thenssh $i yum -y install iperf3 epel-release speedtest-cli fi done# server ceshi #壓測網卡丟包率,與性能 for i in ${a[*]} doecho $issh $i iperf3 -s -p 30000 >> /dev/null &sleep $tiperf3 -c $i -u -b 100m -t $t -p 30000 >> iperf3.log b=`grep % iperf3.log| awk -F "[()]" '{print $2}'`c=`grep host iperf3.log` rm -rf iperf3.log if [ $b > $P ];thenecho -e "\033[31m$c Packet loss rate is $b \033[0m" echo "$c Packet loss rate is $b" >> erorr.txtelseecho -e "\033[32m normal:$b\033[0m"fissh $i ps -auxf | grep iperf >> a.txt cat a.txt | awk '{print $2}' | xargs -i ssh $i kill {}rm -rf a.txt done# download and #測試下載與上傳 for i in ${a[*]} dossh $i speedtest-cli > iperf3.logd=`grep -E "Download|Upload" iperf3.log`echo -e "\033[32m $i Download and Upload is $d\033[0m"echo "$i Download and Upload is $d" >> erorr.txtrm -rf iperf3.log done # ulimit #查看ulimit值 for i in ${a[*]} dossh $i ulimit -n > iperf3.loge=`cat iperf3.log`echo -e "\033[32m $i ulimit is $e\033[0m"echo "$i ulimit is $e" >> erorr.txtrm -rf iperf3.log done # ulimit she zhi #設置ulimit值 for i in ${a[*]} doif [ `ulimit -n` -eq 1024 ];thenecho "* soft nofile 100001\n* hard nofile 100002\nroot soft nofile 100001\nroot hard nofile 100002" >> /etc/security/limits.conffi done總結
以上是生活随笔為你收集整理的系统网卡性能,丢包率与下载上传,ulimit设置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux命令 iperf - 网络性能
- 下一篇: ansible高级用法(压测脚本)