-
查看tcp连接数:
netstat -natp |grep ES |grep nginx |wc -l -
Apache AB测试服务器tcp连接数命令:
ab -k -c 10000 -n 10000 http://10.1.1.1:8080/test.zip
K:keep alive
C:一次性发送多少请求;
N:总共发送多少请求;在Windows系统下,打开cmd命令行窗口,定位到apache安装目录的bin目录下
cd C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin
键入命令:
ab -n 800 -c 800 http://192.168.0.10/
(-n发出800个请求,-c模拟800并发,相当800人同时访问,后面是测试url)
ab -t 60 -c 100 http://192.168.0.10/
在60秒内发请求,一次100个请求。//如果需要在url中带参数,这样做
ab -t 60 -c 100 -T “text/plain” -p p.txt http://192.168.0.10/hello.html
p.txt 是和ab.exe在一个目录
p.txt 中可以写参数,如 p=wdp&fq=78 -
Linux 清除内存 cache
[root@Centos-65-64bit ~]# free -m
total used free shared buffers cached
Mem: 7872 7722 150 0 467 4876
-/+ buffers/cache: 2378 5493
Swap: 2015 515 1500
[root@Centos-65-64bit ~]# echo 3 > /proc/sys/vm/drop_caches
[root@Centos-65-64bit ~]#
[root@Centos-65-64bit ~]# free -m
total used free shared buffers cached
Mem: 7872 1968 5904 0 0 47
-/+ buffers/cache: 1919 5953
Swap: 2015 515 1500 -
查看服务器socket 连接数及建立状态
for i in {1…10000};do netstat -natlp|grep nginx |grep ES|wc -l ; sleep 1;echo line$i;donefor i in {1…10000};do netstat -natlp|grep nginx |grep -v ES ; sleep 1;echo line$i;done
for i in {1…10000};do netstat -natlp|grep 10.1.1.1 wc -l ; sleep 1;echo line$i;done
-
loadrunner log中记录每个参数的运行结果及时间,参数设置为
-
loadrunner 90% 设置
点击分析结果中的结果过滤器(Analysis Summary Filter),打开页面后看到Additional Settings- Transaction Percentil,默认是90,可以修改为任意值。
-
total Throughput(bytes)和点击量的概念
-
Loadrunner计时点
-
Cpu(s)表示的是cpu信息。各个值的意思是:
us: user cpu time (or) % CPU time spent in user space
sy: system cpu time (or) % CPU time spent in kernel space
ni: user nice cpu time (or) % CPU time spent on low priority processes
id: idle cpu time (or) % CPU time spent idle
wa: io wait cpu time (or) % CPU time spent in wait (on disk)
hi: hardware irq (or) % CPU time spent servicing/handling hardware interrupts
si: software irq (or) % CPU time spent servicing/handling software interrupts
st: steal time - - % CPU time in involuntary wait by virtual cpu while hypervisor is servicing another processor (or) % CPU time stolen from a virtual machine
翻译一下:
us:用户态使用的cpu时间比
sy:系统态使用的cpu时间比
ni:用做nice加权的进程分配的用户态cpu时间比
id:空闲的cpu时间比
wa:cpu等待磁盘写入完成时间
hi:硬中断消耗时间
si:软中断消耗时间
st:虚拟机偷取时间 -
Loadrunner 如何突破参数的百条限制
通过设置vugen.ini的MaxVisibleLines项数值可以调整LoadRunner参数显示数据的个数,Vugen.ini文件在LoadRunner 8.0中存放于Windows系统目录下,而LoadRunner 11.0版本则将该文件调整至LoadRunner下的"config"子目录,这里我将LoadRunner 11.0安装到了C盘默认路径,所以该文件存放于"C:\Program Files\HP\LoadRunner\config"。找到该文件后,用记事本或写字板打开该文件,您首先在文件中查找到"[ParamTable]",在下面有"MaxVisibleLines=100",它限制数据记录显示条目数,为了将全部数据显示出来,将"100"更改为"106",即"Max Visible Lines=106"。修改后再查看loginusername参数,则显示106条记录,如图7-3所示,这样就突破参数的百条显示限制。 -
测试过程中添加哪些主要的计数器。
总体来说,需要监控系统的CPU、内存、硬盘、数据库资源、网络资源等方面的计数器
对CPU系统资源监控:
Processor:%Processor Time CPU 使用率。
Processor Queue Length:是指处理列队中的线程数,小于2。处理器瓶颈会导致该值持续大于2。
Context Switches/sec:如果切换次数到5000CPU个数和10000CPU个数中,说明它忙于切换线程。
Interrupts/sec(Processor_Total) 指处理器每秒钟接收并维护的硬件中断的平均值。
Threads(Objects) 线程数在计算机上的时间的数据收集。请注意,这是一个瞬时计数,而不是平均的时间间隔。线程是基本可执行的实体,可以执行指令的处理器。
Private Bytes(Process_Total) 目前的字节数,该进程已经拨出,不能与其它进程。
对内存系统资源监控:
Available Mbytes:可用物理内存数。
page/sec: 表明由于硬件页面错误而从磁盘取出的页面数,或由于页面错误而写入磁盘以释放工作集空间的页面数。
page read/sec:页的硬故障,page/sec的子集,为了解析对内存的引用,必须读取页文件的次数。
对网络资源监控:
Network Interface:Bytes Total/sec 为发送和接收字节的速率,包括帧字符在内。
对硬盘系统资源监控:
Page Faults/sec:每秒软性页面失效的数目。
Physical Disk\ Avg.Disk Queue Length、Physical Disk\ % Disk Time
8、简述测试结果分析方法中的内存分析法。
(1)先通过添加LR提供的监控系统内存计数器,分析系统资源图是否正常;
(2)查看在测试系统过程中,系统的日记记录;
(3)对上两个步骤的数据统计并分析
主要分析如下:
Available Mbytes (可用内存率不少于15%)
CommittedBYtes (内存泄漏监控)
pages/sec 正常值<20 从磁盘读取或写入的页面数
pages Read/sec<5 越低越好,此值过大表明是磁盘读而不是缓存读
pages Faults/sec、 页面错误,表明数据不能再内存中立即使用
Cacge Bytes<50% 可用物理内存 -
空口抓包网卡驱动程序安装:
-
空口抓包步骤
与ssid信道保持一致
-
ARP攻击防护测试:
-
Apache 环境安装:
580 yum install httpd
581 vim /etc/httpd/conf/httpd.conf --修改端口和ServerName
582 service httpd start
583 vim /etc/httpd/conf/httpd.conf
584 service httpd restart
585 nestat -ntlp |grep httpd
586 netstat -ntlp |grep httpd
587 cd /var/www/html/
588 ls
589 mkdir -pv /var/www/html/cloudwifi/upgrade/feixun/fap-022wp -
物理资源监控,脚本每秒中执行一次:
定时任务:每分钟执行一次脚本
[root@localhost ~]# crontab -l
*/1 * * * * /usr/local/etc/zabbix_agentd.conf.d/iostat.sh执行脚本:每次没秒运行60次
[root@localhost zabbix_agentd.conf.d]# cat iostat.sh
#!/bin/bash
for((i=1;i<60;i++))
do
date >>/tmp/iostat_output
iostat -k -d -x >>/tmp/iostat_output
sleep 1
done监控cpu,没5秒取一次数据
[root@localhost lxlsh]# cat resource.sh
#!/bin/bash
#for((i=1;i<12;i++))
#do
date >>/tmp/resource
echo “---------------------------------memory info-----------------------------------------------” >>/tmp/resource
free -m >>/tmp/resource
echo “---------------------------------cpu info-----------------------------------------------” >>/tmp/resource
top -b -n 2 | grep Cpu >>/tmp/resource
echo “--------------------------------iostat info------------------------------------------” >>/tmp/resource
iostat -k -d -x >>/tmp/resource
#sleep 5
#done
You have new mail in /var/spool/mail/root[root@localhost lxlsh]# crontab -l
*/1 * * * * /root/lxlsh/resource.sh
*/1 * * * * sleep 5; /root/lxlsh/resource.sh
*/1 * * * * sleep 10; /root/lxlsh/resource.sh
*/1 * * * * sleep 15; /root/lxlsh/resource.sh
*/1 * * * * sleep 20; /root/lxlsh/resource.sh
*/1 * * * * sleep 25; /root/lxlsh/resource.sh
*/1 * * * * sleep 30; /root/lxlsh/resource.sh
*/1 * * * * sleep 35; /root/lxlsh/resource.sh
*/1 * * * * sleep 40; /root/lxlsh/resource.sh
*/1 * * * * sleep 45; /root/lxlsh/resource.sh
*/1 * * * * sleep 50; /root/lxlsh/resource.sh
*/1 * * * * sleep 55; /root/lxlsh/resource.sh -
Zabbix 安装指导
http://www.360doc.com/content/14/0529/21/8085797_382121204.shtml
注意:
其中的数据库请使用rpm包安装;
SELINUX="" 为 disabled
访问zabbix时请关闭防火墙
Zabbix 登录 默认用户名密码:admin zabbix
zabbix server is not running解决办法:
http://my.oschina.net/u/1590519/blog/330357
解决zabbix安装出现php databases support off,报错
使用yum解决依赖关系
yum install -y php-mysql.x86_64
重启apche服务和sql服务
如果不重启的话下一步连接sql会报错,即使你的帐号密码都是对的
systemctl restart mariadb.service
service httpd restart
然后网页重试一下客户端安装:
./configure -sysconfdir=/etc/zabbix -enable-agent
./configure --prefix=/usr/local/zabbix --enable-agent
./configure --prefix=/etc/zabbix --enable-agent
yum -y install httpd mysql mysql-server php php-mysql php-common php-mbstring php-gd php-odbc php-pear curl curl-devel net-snmp net-snmp-devel perl-DBI php-xml ntpdate php-bcmath
etc/zabbix/zabbix_agentd.conf.d/
Agent端1、安装开发软件包
yum -y groupinstall “Development Tools”
yum -y install ntpdate
2、同步客户端时间,防止跟服务器端不一致,导致检测到不可用的监控数据
ntpdate pool.ntp.org
3、创建zabbix运行所需要的用户跟组
groupadd -g 201 zabbix
useradd -g zabbix -u 201 -m zabbix
4、解压安装zabbixagent端
cd /usr/src/
tar xf zabbix-2.2.2.tar.gz
cd zabbix-2.2.2
./configure -sysconfdir=/etc/zabbix -enable-agent
make && make install
5、copy agent端运行所需要的脚本
cp misc/init.d/tru64/zabbix_agentd /etc/init.d/
chmod +x /etc/init.d/zabbix_agentd
6、配置agent端配置文件
vim /etc/zabbix/zabbix_agentd.conf #此处千万别写成了zabbix_agent.conf,否则配置了不生效
Server=192.168.239.130 #填写Server的IP地址
ServerActive=192.168.239.130 #修改为Server的IP地址
Hostname=Centos-03 #填写本机的HostName,注意Server端要能解析
UnsafeUserParameters=1 #是否允许自定义的key,1为允许,0为不允许
Include= etc/zabbix/zabbix_agentd.conf.d/#自定义的agentd配置文件(key)可以在这里面写;
7、启动zabbix agent端
/etc/init.d/zabbix_agentd start
[root@localhost init.d]# /etc/init.d/zabbix_agentd start
Usage: /usr/local/sbin/zabbix_agentd start|stop|restart
Zabbix agent started.
检验客户端是否安装成功:
[root@localhost local]# /usr/local/bin/zabbix_get -s10.6.61.91 -p10050 -k"system.uptime"
354083Zabbix 监控磁盘io:
http://www.linuxidc.com/Linux/2015-11/125208.htmZabbix windows客户端
Zabbxi 监控windows 物理资源配置文件;