⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.html

📁 实现了poll/epoll/devpoll等C++封装
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head><title>dkftpbench</title></head><body><h1>dkftpbench</h1>Need to stress out an ftp server, or measure how many usersit can support?  dkftpbench can do it.<p>Want to write your own highly efficient networking software,but annoyed by having to support very different code forLinux, FreeBSD, and Solaris?  libPoller can help.<h2>Sources</h2><ul><li><a href="dkftpbench-0.45.tar.gz">dkftpbench-0.45.tar.gz</a> - as a tarball<li><a href="dkftpbench-0.45/">dkftpbench-0.45/</a> - as individual files<li><a href="doc/index.html">Source code documentation</a> <li><a href="ChangeLog">ChangeLog</a></ul><h2>Support</h2>If you have a question about dkftpbench, join the<a href="http://groups.yahoo.com/group/ftpbench">ftpbench mailing list</a>and post it there.<h2>License</h2>dkftpbench is released under the <a href="http://www.fsf.org/copyleft">GPL (GNU Public License) v2</a>.<h2>Introduction</h2>dkftpbench is an FTP benchmark program inspired bySPECweb99.The result of the benchmark is a number-of-simultaneous-users rating;after running the benchmark properly, you have a good idea how manysimultaneous dialup clients a server can support.  The target bandwidth per client is set at 28.8 kilobits/second to modeldialup users; this is important for servers on the real Internet, whichoften serve thousands of clients on only 10 MBits/sec of bandwidth.<p>The final result of the benchmark is "the number of simultaneous28.8 kilobits/second dialup users".  To estimate this number,the benchmark starts up a new simulated user as soon as the last one hasfinished connecting.  It stops increasing the number of users when onefails to connect, fails to maintain the desired bandwidth, or the limitspecified by the -n option is reached.  It runs the simulatedusers until the amount of time specified by the -t option has elapsedsince the last simulated user birth or death; the final score is thenumber of users still alive at the end.<p>To help people tune up their systems in preparation for running the benchmark,the utility <a href="#tuning">dklimits</a> is provided.<h2>Results</h2><a href="results.html">Comparisons of various ftp daemons, and between poll and F_SETSIG,</a> using thistool are available.<p><a href="Poller_bench.html">Results of a microbenchmark comparing poll() and /dev/poll</a>are available.<h2>Competition</h2>I planned to hold a <a href="bakeoff.html">Linux FTP Server Performance Bakeoff</a>in March 2000 using this benchmark, but it looks like it might be more like March 2002 :-(<h2>FTP Client Library</h2>As part of this project, a multiplexing FTP clientlibrary has been developed.  This will let programs do <a href="nonblocking.html">nonblocking</a> FTP client stuff more or lessconveniently.  Potentially useful for FTP clients that want to fetchlots of files at once.  The library consists of all the source files inthe ftp benchmark except for bench.cc and robouser.{cc,h}.<p>Of particular interest is <a href="doc/Poller.html">Poller</a>, an OO wrapper around the various readinessnotification methods supported by various versions of Unix(vanilla Unix poll() and select(), FreeBSD's kqueue(), Linux and Solaris /dev/poll,O_ASYNC for Linux, and O_ONESIGFD for Linux).Regardless of whether the underlying notification mechanism isedge-triggered or level-triggered, Poller presents a level-triggeredinterface to the program.<p>The benchmark uses Poller, and you can even pick one of the six readinessnotification schemes at runtime using the -s option.<p>You can use Poller in your programs, too.  'make install' installslibPoller.a and the needed headers.<p>If you want to use nonblocking connects, read Stevens 'Unix NetworkProgramming vol 1', p. 410 and see the unit test testRejection() inPoller_test.cc for how to do it.<p>Warning: the 2.4 linux kernel's SIGIO support doesn't extend to pipes.If you're using the 2.4 linux kernel, you may need to apply<a href="http://www.cs.helsinki.fi/linux/linux-kernel/2002-13/0191.html">Jeremy Elson's patch</a>to your kernel if you want to use Poller_sigio.<h2>Status</h2>The following features are implemented:<ul><li>Compiles and runs on Linux, FreeBSD, and Solaris (or did, last I tried)<li>fetches many files in parallel<li>waits for each connect to finish (and then a bit) before starting next one;slows down to &lt; 1 connect/second when it reaches 75% of desired number of users.This spreads out user activity more evenly.<li>checks bandwidth continuously during each file fetch, stops adding users if any fetch too slow<li>throttles each fetch to use only the specified bandwidth<li>search for the max number of supported users<li>Displays verbose error message when any user fails<li>Aborts if it detects the client system running out of resources<li>Aborts if connecting to the server takes &gt; 5 seconds<li>Aborts if it takes longer than 5 seconds to get first packet of a file<li>Uses new Poller class for scalability; you can specify which Poller to use on the commandline<li>Supports slow datarates (before, it only handles rates above 80kbits/sec on some systems)<li>Lets you set how picky it is about datarates (before, its 'must be faster than'threshold was fixed at 3/4 the target bandwidth)<li>Supports alternative readiness notification methods like O_ASYNC and O_ONESIGFD<li>Provided both as a standalone executable, and as a Corba object.(Thanks to <a href="http://corbaconf.kiev.ua/">http://corbaconf.kiev.ua/</a>for the Corba autoconf macros.  See <a href="omni_scripts.tar.gz">omni_scripts.tar.gz</a> for how I compiled OmniOrb 3.)<li>Switches to BINARY mode after login.  (The client API lets you choose;edit robouser.cc to skip the START_TYPE state if you want to use ASCII.)</ul>The following features are not yet implemented:<ul><li>verify that each ftp command (other than GET) doesn't take too long<li>verify that GETs retrieve right number of bytes<li>verify that GETs retrieve right bytes<li>fetch random files<li>upload test files to server under test<li>support non-passive mode<li>optimization</ul>Issues:<ul><li>Doesn't support Solaris /dev/poll yet.  (It would be easy but I've been lame.)</ul><h2>Example</h2>After unpacking the sources, configure them for your system with the command<pre>./configure</pre>This will generate Makefile from Makefile.in.<p>To make sure the sources arrived intact and work properly on your system, type<pre>make check</pre>It will build all unit tests, and fail if any unit test fails.  You must be connected to the Internet, as this will try to download a file from ftp.uu.net.<p>To build the system tuning tool dklimits, type<pre>make dklimits</pre>Run it on both the client and the server machine; make sure that the number of files it can open is aboutthree times the desired number of users, andthat the number of ports it can bind is higher than the desired numberof users.  You should not be running X Windows or any other programson the client and server machines when running the benchmark.<p>To build the benchmark, type<pre>make</pre>This produces the executable 'dkftpbench', the tuning program 'dklimits', anda bunch of unit tests (executables with names ending in _test) that you canignore for now.<p>Here's a simple use of dkftpbench:<pre>./dkftpbench -n1 -hftp.uu.net -t15 -v</pre>This tells bench to simulate one user fetching thedefault file from ftp.uu.net repeatedly, and stop after fifteen seconds.The program produces this output:<pre>Option values: -hftp.uu.net host name of ftp server -P21 port number of ftp server -n1 number of users -t15 length of run (in seconds) -b3600 desired bandwidth (in bytes per second) -uanonymous user name -probouser@ user password -fusenet/rec.juggling/juggling.FAQ.Z file to fetch -m1500 bytes per 'packet' -v1 verbosity1 usersUser0: fetching 22708 bytes took 6.530000 seconds, 3477 bytes per secondUser0: fetching 22708 bytes took 6.530000 seconds, 3477 bytes per secondTest over.  1 users left standing.</pre><h2>Distributed Load Generation</h2>As of version 0.42, dkftpbench includes an experimental distributed version.To use it, follow these steps:<ol><li>Install a C++ corba library, preferably OmniOrb 3.(See omni_scripts.tar.gz for an example of how to build it.)<li>'make CorbaPlatoon_impl corbaftpbench'<li>Start a Corba name service somewhere.<li>Start a copy of CorbaPlatoon_impl on each load generation machine,being sure to configure Corba on each load machine to know about your name service.<li>Start a single copy of corbaftpbench (it's nearly the same as dkftpbench).This should start your own little distributed denial-of-service-attackagainst the ftp server of your choice.  Please don't bombard a public FTPserver -- run your own for the purpose!</ol><h2><a name="tuning">System Tuning</a></h2>On a Linux system, you may need to pay attention to the per-process limit on open filehandles (ulimit -n) as well as the system limit on open filehandles(/proc/sys/fs/file-max) and the available port range (/proc/sys/net/ipv4/ip_local_port_range).<p>The program <a href="dkftpbench-0.45/dklimits.c">dklimits.c</a> can help you check yoursystem's limits.  Generally, ftp daemons require at least two network sockets andone disk file descriptor per user.  Use dklimits to verify you have enoughsockets and descriptors for your expected number of users.  Same goes forsystems that will be used as ftp load generators, except that since theydon't usually store data on disk, they don't need the disk file descriptor.<p>On Linux, I run the following commands before starting the server or client:<pre>ulimit -n 4096echo 1024 32767 &gt; /proc/sys/net/ipv4/ip_local_port_rangeecho 4096 &gt; /proc/sys/fs/file-max</pre>and then check using dklimits to make sure these settings took effect.<h2>Reporting Guidelines</h2>I invite people to run this on their FTP servers and report the results by email.If you want to do this, use the following commandto generate test data files:<pre>make data</pre>This will generate x10k.dat, x100k.dat, and x1000k.dat.Run the commands<pre>time dkftpbench -h200.201.202.203 -utestuser -ptestpass -n500 -t600 -fx10k.dat</pre>and<pre>time dkftpbench -h200.201.202.203 -utestuser -ptestpass -n500 -t600 -fx1000k.dat</pre>on a different machine from the ftp server (substituting your server's IP address,username, and password), and send in the following data:<ul><li>Server hardware (CPU type, speed, L2 cache, RAM, network card)<li>Server OS (name, version, kernel version, output of dklimits immediately before starting server, other tuning parameters)<li>Client hardware (CPU type, speed, L2 cache, RAM, network card)<li>Client OS (name, version, kernel version, output of dklimits immediately before starting dkftpbench, other tuning parameters)<li>Number of users left and elapsed time for x10k.dat<li>Number of users left and elapsed time for x1000k.dat</ul>I will collect and post the results.<p>Eventually, a more sophisticated workload and set of reporting guidelines will be provided.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -