簡體   English   中英

Tsung分布式負載測試引發內部服務器錯誤

[英]Tsung distributed load testing throwing internal server error

我正在使用tsung為mqtt消息代理運行分布式負載測試。 我已經使用shh鍵配置了節點,並檢查了shh在節點之間是否正確進行,並且使用單個客戶端,測試是否成功運行,但是當我使用2個節點啟動tsung.xml文件時,遇到了內部服務器錯誤。

我檢查了兩個節點中安裝的erlang和tsung的版本和路徑。 它們甚至具有相同的版本和路徑。

<clients>
    <client host="1.2.3.4" cpu="1" maxusers="300"/>
    <client host="2.3.4.6" cpu="1" maxusers="100"/>
</clients>
<servers>
    <server host="1.2.3.4" port="1883" type="tcp" />
</servers>

當我在1.2.3.4:8091運行tsung進行報告時

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator unknown@unknown, and inform them of the time the error occurred and anything you might have done that may have caused the error.

tsung_controller@1.2.3.4.log說

ts_config_server:(0:<0.158.0>) Can't start newbeam on host '2.3.4.6' (reason: timeout) ! Aborting!

他們是這個問題的原因還是解決錯誤的方法?

您尚未編寫所使用的操作系統。 我假設您正在使用Linux。 我輕松地重現了該錯誤(我剛剛從另一個節點的〜/ .ssh / authorized_keys文件中刪除了ssh-key行)。

我描述我的經驗(Linux Debian):

  • 您需要在每個節點上正確安裝Tsung 我的意思是,您必須能夠從主目錄啟動Tsung。
  • 節點之間必須有有效的ssh-key連接 (當然沒有密碼)。 重要! 當您以root用戶使用Tsung時,您的節點將使用root用戶連接到另一個節點。
  • 我的節點僅使用注冊的主機名工作
  • Linux內核需要一些調整

我有一個Tsung 1.6Debian安裝腳本

wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
yes | sudo apt-get update
yes | sudo apt-get install elixir esl-erlang build-essential git gnuplot libtemplate-perl
wget http://tsung.erlang-projects.org/dist/tsung-1.6.0.tar.gz
tar -xvf tsung-1.6.0.tar.gz
cd tsung-1.6.0/
./configure
make
sudo make install
cd ..

ssh密鑰認證https : //debian-administration.org/article/530/SSH_with_authentication_key_instead_of_password

將這些行復制到每個節點上的/ etc / hosts文件的末尾。

1.2.3.4    n1
2.3.4.6    n2

您的配置應如下所示:

<clients>
    <client host="**n1**" cpu="1" maxusers="300"/>
    <client host="**n2**" cpu="1" maxusers="100"/>
</clients>
<servers>
    <server host="1.2.3.4" port="1883" type="tcp" />
</servers>

這就是我的開始

tsung -k -f tsung.xml start

我在Linux上使用以下調整腳本:

# Increase system file descriptor limit
sudo sysctl -w fs.file-max=300000

# Discourage Linux from swapping idle processes to disk (default = 60)
# vm.swappiness = 10

# Increase Linux autotuning TCP buffer limits
# Set max to 16MB for 1GE and 32M (33554432) or 54M (56623104) for 10GE
# Don't set tcp_mem itself! Let the kernel scale it based on RAM.
sudo sysctl -w net.core.rmem_max=16777216
sudo sysctl -w net.core.wmem_max=16777216
sudo sysctl -w net.core.rmem_default=16777216
sudo sysctl -w net.core.wmem_default=16777216
sudo sysctl -w net.core.optmem_max=40960
sudo sysctl -w net.ipv4.tcp_rmem='4096 87380 16777216'
sudo sysctl -w net.ipv4.tcp_wmem='4096 65536 16777216'

# Make room for more TIME_WAIT sockets due to more clients,
# and allow them to be reused if we run out of sockets
# Also increase the max packet backlog
sudo sysctl net.core.netdev_max_backlog=50000
sudo sysctl net.ipv4.tcp_max_syn_backlog=30000
sudo sysctl net.ipv4.tcp_max_tw_buckets=2000000
sudo sysctl net.ipv4.tcp_tw_reuse=1
sudo sysctl net.ipv4.tcp_fin_timeout=10

# Disable TCP slow start on idle connections
sudo sysctl net.ipv4.tcp_slow_start_after_idle=0

# Disable source routing and redirects
sudo sysctl net.ipv4.conf.all.send_redirects=0
sudo sysctl net.ipv4.conf.all.accept_redirects=0
sudo sysctl net.ipv4.conf.all.accept_source_route=0

# Log packets with impossible addresses for security
sudo sysctl net.ipv4.conf.all.log_martians=1

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM