您好,登錄后才能下訂單哦!
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)監視系統運行
在目標系統上安裝snmpd: apt-get install snmpd
修改配置文檔/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是可行的方案
啟動snmpd:service snmpd start
監視端安裝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/
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
注意事項:
1)/usr/lib/tsung/bin/tsung_stats.pl:如果當前目錄下不存在tsung.log,則需通過選項--stats 指定統計日志文件,執行該腳本后將在當前目錄下生成相關統計報告目錄及文檔 2)以上為本機上執行的實際情況,點擊report.html在瀏覽器中打開將看到如下界面:
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。