千家信息网

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

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,Main featuresHigh Performance: the load can be distributed on a cluster of client machinesMulti-prot
千家信息网最后更新 2026年11月01日Tsung:开源多协议分布式负载&压力测试工具

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 updatesudo 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]:1612)设置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 .13)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 snmpsnmpwalk -v 2c -c public [agent主机名或ip]

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

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

注意事项:

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

cenze@kylin:~/.tsung$ ls log20170115-2235cenze@kylin:~/.tsung$ cd log/20170115-2235cenze@kylin:~/.tsung/log/20170115-2235$ /usr/lib/tsung/bin/tsung_stats.plwarn, last interval (7) not equal to the first, use the first one (10)No data for BoshNo data for MatchNo data for EventNo data for AsyncNo data for Errorscenze@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.logdrwxrwxr-x 2 cenze cenze  4096 1月  15 22:51 gnuplot_scripts-rw-rw-r-- 1 cenze cenze  7333 1月  15 22:51 graph.htmldrwxrwxr-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

注意事项:

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


目录 监视 运行 配置 文档 文件 系统 生成 统计 事项 报告 注意事项 注释 目标 参考 可行 下有 主机 分支 命令 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 广州万易互联网科技有限公司 广州大一互联网络科技有限公司 互联网核心科技是什么 互联网巨头科技公司 互联网科技开发公司 米客互联网科技 一五八零互联网科技 重庆科技学院互联网 农村开互联网科技讲堂 福建科技产业互联网发展 互联网科技革命什么开始 互联网科技公司有风险吗 阿大互联网科技有限公司 杭州壁岐互联网科技有限公司 苏州铭阳互联网科技有限公司 四川互联网展示科技馆设计 福州德业互联网科技 科技互联网公司两年变化 河南商务圈互联网科技有限公司 青岛互联网科技园 互联网科技开发公司 深圳艾佳互联网科技 须眉科技是互联网公司吗 四川慕妮娅互联网科技有限公司 上海京穆互联网科技有限公司 山东子淼互联网科技有限公司 每天都有哪些好的互联网科技 黑云互联网科技有限公司 中国互联网公司的科技投入 科技互联网公司两年变化
0