Tsung:开源多协议分布式负载&压力测试工具
admin
2023-03-18 17:25:30
0

Main features

  • High Performance: the load can be distributed on a cluster of client machines

  • Multi-protocols using a plugin system: HTTP, WebDAV, SOAP, PostgreSQL, MySQL, LDAP , XMPP/Jabber, BOSH, MQTT and AMQP are currently supported. SSL is also supported.

  • Several IP addresses can be used on a single machine using the underlying OS IP Aliasing

  • OS monitoring (CPU, memory and network traffic) using SNMP, Munin or Erlang agents on remote servers.

  • XML configuration system; several sessions can be used to simulate different type of users. Dynamic sessions can be easily described in XML (this can be used to retrieve at runtime an ID from the server output and use it later in the session).

  • In order to generate a realistic traffic, user think-times and the arrival rate can be randomize using a probability distribution

  • HTML reports can be generated during the load to view response times measurement, server CPU, etc.

Tsung is developed in Erlang,运行Tsung,需要相关erlang依赖包支持。

 

一.安装Tsung

sudo apt-get update
sudo apt-get -y install tsung

或自行下载Tsung源码包安装:http://tsung.erlang-projects.org/

二.启用SNMP agent(snmpd)监视系统运行

  1. 在目标系统上安装snmpd: apt-get install snmpd

  2. 修改配置文档/etc/snmp/snmpd.conf:

    1)开启所有监视端访问:注释行agentAddress  udp:127.0.0.1:161,然后启用行agentAddress udp:161,udp6:[::1]:161
    2)设置snmp agent可监视(OID分支)范围:注释行view   systemonly  included   .1.3.6.1.2.1.1和view systemonly included .1.3.6.1.2.1.25.1,然后添加行view systemonly included .1
    3)rocommunity public  default    -V systemonly行和rocommunity public  default    -V systemonly行public为默认community,可更改自定义
    4)如果在docker中运行snmpd,修改配置文档/etc/snmp/snmpd.conf后,执行service snmpd [command],这对已启动的snmpd是无效的。因此本人通过重启snmpd所运行的容器(expose 161),然后再执行service snmpd start是可行的方案
  3. 启动snmpd:service snmpd start
  4. 监视端安装snmp来检测监视目标系统snmp agent

    sudo apt-get install snmp
    snmpwalk -v 2c -c public [agent主机名或ip]

三.试运行Tsung并生成统计报告

cd ~
mkdir .tsung
cp /usr/share/doc/tsung/examples/http_simple.xml .tsung/tsung.xml
tsung start

注意事项:

1)/usr/share/doc/tsung/examples:Tsung安装后,该目录下有多种配置文档样例可参考
2)~/.tsung/tsung.xml:默认配置文件。如果该文件不存在,则需添加-f选项,tsung -f myconfigfile.xml start
3)~/.tsung/log:运行命令tsung start后将生成该日志目录
4)本例中monitor type为snmp
5)关于tsung.xml的配置可参考:http://tsung.erlang-projects.org/user_manual/

 

Tsung:开源多协议分布式负载&压力测试工具

cenze@kylin:~/.tsung$ ls log20170115-2235cenze@kylin:~/.tsung$ cd log/20170115-2235cenze@kylin:~/.tsung/log/20170115-2235$ /usr/lib/tsung/bin/tsung_stats.pl
warn, last interval (7) not equal to the first, use the first one (10)
No data for Bosh
No data for Match
No data for Event
No data for Async
No data for Errors
cenze@kylin:~/.tsung/log/20170115-2235$ ls -l
总用量 92drwxrwxr-x 2 cenze cenze  4096 1月  15 22:51 data-rw-rw-r-- 1 cenze cenze  3344 1月  15 22:51 gnuplot.log
drwxrwxr-x 2 cenze cenze  4096 1月  15 22:51 gnuplot_scripts-rw-rw-r-- 1 cenze cenze  7333 1月  15 22:51 graph.html
drwxrwxr-x 2 cenze cenze  4096 1月  15 22:51 p_w_picpaths-rw-rw-r-- 1 cenze cenze    62 1月  15 22:35 match.log-rw-rw-r-- 1 cenze cenze  8151 1月  15 22:51 report.html-rw-rw-r-- 1 cenze cenze 10157 1月  15 22:45 tsung_controller@kylin.log-rw-rw-r-- 1 cenze cenze 36480 1月  15 22:45 tsung.log-rw-rw-r-- 1 cenze cenze   961 1月  15 22:35 tsung.xml

Tsung:开源多协议分布式负载&压力测试工具

注意事项:

1)/usr/lib/tsung/bin/tsung_stats.pl:如果当前目录下不存在tsung.log,则需通过选项--stats 指定统计日志文件,执行该脚本后将在当前目录下生成相关统计报告目录及文档
2)以上为本机上执行的实际情况,点击report.html在浏览器中打开将看到如下界面:

Tsung:开源多协议分布式负载&压力测试工具


相关内容

热门资讯

AI开源公开信签署企业增至50... IT之家 7 月 26 日消息,英伟达、微软、IBM、Meta 等 25 家美国科技企业本周(7 月...
南阳快手短视频代运营企业的服务... 在短视频平台快速发展的背景下,企业通过快手等渠道进行内容运营已成为常见的市场动作。对于希望借助短视频...
普通人该如何跟上科技发展的步伐 这个被称作科技的词汇, 听起来既有宏大之感, 又颇为遥远, 好似仅仅归属于在实验室里专心致志钻研的科...
原创 王... 菲尔兹奖名单一出,邓煜和王虹两位华人数学家共同获奖,本应是一件令人振奋的喜讯。然而,王虹那段仅3分1...
《万物》杂志首个阅读空间亮相正... 26日,由国内知名的青少年家庭科普期刊《万物》杂志与广州正佳自然科学探索中心联合打造的阅读互动空间—...
从康复机器人到脑机接口 智能康... 天津北方网讯:对脑卒中患者来说,重新抬起手臂、迈出一步,往往需要持续的康复训练,逐步恢复运动功能;对...
原创 苹... 当苹果、谷歌、斯坦福、麻省理工都无法留住一位年轻的中国AI天才时,究竟是什么力量吸引他毅然回国?为何...
为什么新能源车供应链要本地化? 当前汽车产业变革加速,电动化成为核心发展方向。车企为了在激烈市场中站稳脚跟,必须优化生产结构。其中,...
携程罚单的真正影响,不是酒店变... 文 | 听风译码 7月25日,市场监管总局对携程开出51.79亿元天价罚单。 全网叫好。 但如果你...
自己管理自己,我国成功发射两颗... 7月24日消息,力箭一号遥十五运载火箭今日在东风商业航天创新试验区成功发射,以“一箭5星”方式将5颗...