Tsung: A open-source, multi-protocol, distributed load testing tool

As we said earlier, we will be concentrating on load testers, stress testers, etc. continuing with the same trend. Tsung is an open-source multi-protocol distributed load testing tool which has been programmed in Erlang. Erlang is an open-source language made by Ericsson for building robust fault-tolerant distributed applications.

Tsung can simulate many users in order to test the scalability and performance of IP based client/server applications. You can use it to do load and stress testing of your servers or even web application firewalls. This tool is completely protocol independent. You can use Tsung to test the following protocols:

  • HTTP
  • WebDAV
  • SOAP
  • PostgreSQL
  • MySQL
  • LDAP
  • Jabber/XMPP

Main features of Tsung:

  • High Performance: Tsung can simulate a huge number of simultaneous users per physical computer. It can simulates thousands of users on a single CPU!
  • Distributed: The load can be distributed on a cluster of client machines! Truly a first when it comes to stress testing!
  • Multi-Protocols using a plug-in system: HTTP (both standard web traffic and SOAP), WebDAV, Jabber/XMPP and PostgreSQL are currently supported. Experimental LDAP and MySQL plugins are included in the 1.3.0 release.
  • SSL support
  • Several IP addresses can be used on a single machine using the underlying OS IP Aliasing
  • OS monitoring (CPU, memory and network traffic) using Erlang agents on remote servers or SNMP
  • XML configuration system: complex user’s scenarios are written in XML. Scenarios can be written with a simple browser using the Tsung recorder (HTTP and PostgreSQL only).
  • Dynamic scenarios: You can get dynamic data from the server under load (without writing any code) and re-inject it in subsequent requests. You can also loop, restart or stop a session when a string (or regexp) matches the server response.
  • Mixed behaviours: several sessions can be used to simulate different type of users during the same benchmark. You can define the proportion of the various behaviours in the benchmark scenario.
  • Stochastic processes: in order to generate a realistic traffic, user thinktimes and the arrival rate can be randomize using a probability distribution (currently exponential)

The best of all, Tsung is OPEN SOURCE and this tool has been in active programming since 2001! Also, it is cross platform – can work on Linux, Solaris, *BSD, Win32 and MacOS-X!

It does have some pro-requisites though which are not found on normal servers. But well, with an application like this, we are no doubt you will get the necessary softwares installed!

Download the latest version of Tsung 1.3.1 here.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Tsung支持多种协议和场景的测试,包括HTTP、SOAP、JDBC、SMTP、XMPP等,同时也支持TCP和UDP协议的测试。下面介绍一下如何使用Tsung进行TCP请求的接口压测: 1. 安装Tsung 首先需要安装Tsung,可以通过官网下载源代码进行安装,也可以通过包管理工具进行安装。 2. 编写测试脚本 Tsung的测试脚本采用XML格式编写,可以使用任何文本编辑器进行编辑。以下是一个简单的Tcp请求测试脚本: ``` <?xml version="1.0"?> <!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd"> <tsung loglevel="notice" version="1.0"> <clients> <client host="localhost" use_controller_vm="true"/> </clients> <servers> <server host="127.0.0.1" port="8080" type="tcp"/> </servers> <load> <arrivalphase phase="1" duration="10" unit="minute"> <users interarrival="2" unit="second"/> </arrivalphase> </load> <sessions> <session probability="100" name="tcp_request"> <request> <tcp type="init"/> <tcp type="user"> <![CDATA[ test data ]]> </tcp> </request> </session> </sessions> </tsung> ``` 这个脚本定义了一个Tcp请求的测试场景,其中指定了客户端和服务器的IP地址和端口号,定义了负载模型,指定了请求的格式和内容。 3. 启动测试 保存测试脚本,并使用以下命令启动测试: ``` tsung -f <test-script.xml> start ``` 其中`<test-script.xml>`是测试脚本的路径,可以是绝对路径或相对路径。 4. 查看测试结果 测试运行完毕后,可以查看测试结果。Tsung提供了多种方式查看测试结果,包括控制台输出、日志文件、图形化界面等。 以上是使用Tsung进行TCP请求接口压测的基本流程,具体的测试脚本和参数需要根据具体的测试需求进行调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值