Quote: http://www.kegel.com/dkftpbench/index.html
Need to stress out an ftp server, or measure how many users it can support? dkftpbench can do it.
下載點 http://www.kegel.com/dkftpbench/dkftpbench-0.45.tar.gz
在 http://www.kegel.com/dkftpbench/index.html 底下的 Example 有安裝說明及使用方式
在 http://www.kegel.com/dkftpbench/results.html 有一些 FTP 程式的比較結果
安裝 dkftpbench
./configure
make check
make
執行
./dkftpbench -h192.168.1.103 -utest -ptest123456 -n1 -t15 -v
Option values:
-h192.168.1.103 host name of ftp server
-P21 port number of ftp server
-n1 number of users
-c1 target number of simultaneous connection attempts
-k2 Start next connection when: 1=immediately, 2=after prev connect complete
-t15 length of run (in seconds)
-b3600 desired bandwidth (in bytes per second)
-B2700 min acceptable per-client bandwidth (in bytes per second)
-utest user name
-ptest123456 user password
-fusenet/rec.juggling/juggling.FAQ.Z file to fetch
-m1500 bytes per ‘packet’
-v1 verbosity
-sp selector (p=poll, s=select, d=/dev/poll, k=kqueue, r=rtsig, f=sig-per-fd)
-a0 use all local interfaces
Using poll()
1 users alive, 0 users dead; at least 15 seconds to end of test
ftp_client_pipe_t::notifyPollEvent_dfd: connect dfd 4 failed, errno 104
robouser0::ftpCmdDone: xerr 104, aborting
ftp_client_pipe_t::shutdown(): m_state 1, cfd 3, dfd 4, id 0
All users dead. Test failed.
但有紅色的 ERROR
從這裡 http://bbs.chinaunix.net/viewthread.php?tid=580383 找到靈光
你還要運行make data生成x10k.dat, x100k.dat, x1000k.dat這三個測試文件,並放在FTP服務器的根目錄.
另外需要運行下面三個命令,否則無法模擬超過500用戶.
ulimit -n 8192
echo 1024 32767 >; /proc/sys/net/ipv4/ip_local_port_range
echo 8192 >; /proc/sys/fs/file-max測試連一個用戶都dead通常是密碼不對或在服務器根目錄下沒有測試文件
下面的命令就是連接200.201.202.203的FTP服務器, 用戶名是anonymous(-uanonymous),密碼是test(-ptest), 模擬1000個用戶(-n1000),每個用戶帶寬是10K(-b10000),測試時間是600秒(-t600),測試文件是x1000k.dat(-fx1000k.dat)
dkftpbench -h200.201.202.203 -uanonymous -ptest -n1000 -b10000 -t600 -fx1000k.dat
用戶帶寬超過10K,dkftpbench 的結果就不准了,dkftpbench是n年前的,那時主要都是撥號用戶,沒有寬帶,它已經好多年沒有更新了。
這是因為沒有指定下載檔,可以自行指定檔案,
也可以在 source tarball 裡執行 make data 會產生x10k.dat、x100k.dat、x1000k.dat 這三個 10K、100K、1000K 大小的檔案,
再把這些檔丟至 FTP Server 上
再次執行時指定 -f 檔案
./dkftpbench -h192.168.1.103 -utest -ptest123456 -n1 -t15 -v -fx10k.dat
Option values:
-h192.168.1.103 host name of ftp server
-P21 port number of ftp server
-n1 number of users
-c1 target number of simultaneous connection attempts
-k2 Start next connection when: 1=immediately, 2=after prev connect complete
-t15 length of run (in seconds)
-b3600 desired bandwidth (in bytes per second)
-B2700 min acceptable per-client bandwidth (in bytes per second)
-utest user name
-ptest123456 user password
-fx10k.dat file to fetch
-m1500 bytes per ‘packet’
-v1 verbosity
-sp selector (p=poll, s=select, d=/dev/poll, k=kqueue, r=rtsig, f=sig-per-fd)
-a0 use all local interfaces
Using poll()
1 users alive, 0 users dead; at least 15 seconds to end of test
User0: fetching 10240 bytes took 2.853900 seconds, 3588 bytes per second
User0: fetching 10240 bytes took 2.857600 seconds, 3583 bytes per second
User0: fetching 10240 bytes took 2.852000 seconds, 3590 bytes per second
User0: fetching 10240 bytes took 2.854500 seconds, 3587 bytes per second
User0: fetching 10240 bytes took 2.854000 seconds, 3587 bytes per second
Test over. 1 users left standing.
這裡 http://www.xlightftpd.com/cn/performance.htm 有 圖文並茂的測試說明
留言