3 [Insert insanely cool ASCII logo here yourself -- I'd rather spend my time
8 This is NOT a stable version of BetaFTPD. The latest stable, tried and tested
9 version is 0.0.7. Use this version at your own risk. That being said, this
10 version is rather stable now, actually _more_ stable than 0.0.7, which contains
11 quite a few lethal bugs, and is almost a year old.
15 BetaFTPD is a _single_-threaded FTP daemon (server). This makes it _faster_
16 than most other FTP daemons (in most situations), contrary to popular belief.
17 BetaFTPD is, as the name implies, work in progress. Please don't expect it to
20 2. How do you build it?
21 -----------------------
22 BetaFTPD uses GNU autoconf. Just type:
27 And see what happens. (Run the resulting file called `betaftpd', of course...)
28 There are some flags that you can (and probably want to) give to `configure':
30 --enable-xferlog Makes the server output some logging information
31 to /var/log/xferlog (or /usr/adm/xferlog if that fails).
32 --enable-fullscreen Makes the server start in fullscreen mode, where you
33 can see what the users are doing, their transfer
34 speed etc. (There is other no way of turning on or off
35 fullscreen mode -- this switch is the only way.)
36 --enable-upload Enable STOR (uploading) and APPE commands, and all necessary
38 --enable-stat Enable STAT command (server statistics). Note that I see
39 very little use for such a command, and you shouldn't enable
40 it unless you have a very good reason. Such commands are
41 one of the best weapons in a cracker's arsenal. It is only
42 included for RFC1123 compliance, and disabled by default.
43 In addition, it tries to give as little `cracker-help' data
45 --enable-shadow Enable support for shadow passwords.
46 --enable-fork Makes the server fork into the background, so you
47 can logout etc. without `disturbing' it.
48 --enable-nonroot Enable running without root privilegies. Please read
49 README.nonroot _first_, it will save you a lot of
51 --enable-ascii Enable ASCII mode transfers (ASCII translation on-the-fly).
52 --enable-dcache Enable directory listing caches, for faster directory
53 listings (the listings are only generated the first time
54 they are needed). Note that this still quite experimental
55 code, and the cache is only invalidated when it expires
56 (ie. if nobody uses the entry in 15 minutes), or when
57 files are added or deleted in the cached directory.
58 (In other words, if a file is changed, the directory
59 cache entry is _not_ updated. Do a `touch' on the directory
60 to force invalidation of the dcache entry.)
61 --enable-message Enable welcome.msg/.message files and README notes, like
62 `normal' ftpds do. Note that this is relatively crude
63 (and probably will stay so) -- for instance, README notes
64 and .message files are printed every time the user enters
65 the directory, even if he/she has been there before.
67 To get the smallest executable possible, _first_ check everything in
68 `strip-exec' (it's unsupported -- don't complain to me if it doesn't work, fix
69 it yourself! :-) ), and type:
73 3. Some things to note
74 ----------------------
75 a) BetaFTPD now listen on port 21 by default (it used to run on port 121). To
76 change it, change FTP_PORT in ftpd.h to whatever you'd like it to listen on.
77 b) BetaFTPD must definitely be run as root (unless you use --enable-nonroot as
79 c) Some commands and features are missing, but probably not many that you'd
80 really miss. See the KNOWN-BUGS and RFC-COMPLIANCE files.
81 d) BetaFTPD can _not_ be run from inetd. This is a design decision.
85 BetaFTPD was originally designed to be a single-threaded FTP server, nothing
86 else. After a while, work was done to reduce the executable size, and from
87 then, design was more and more concentrated around a `minimalistic' server
88 (after all, the fewer lines of code there are to execute, the faster will
89 things go, and the fewer bugs are possible).
91 However, as GNU autoconf support was added, it was realized that features could
92 be added and selected by users without hurting overall speed or size for the
93 others. Therefore, more and more features are (and will be) implemented in
96 There are intendedly no command line switches it BetaFTPD. Such switches are
97 generally there to make for quick change of options without recompiling the
98 program. This is ideal for most command-line utilities, but is rather pointless
99 for an FTP server. FTP servers are designed to be online 24 hours a day, 7 days
100 a week, and serve users with files. Rapid confiuration changes (in the form of
101 command line switches, configuration files et al) are usually not important,
102 and has thus been omitted from BetaFTPD.
104 There is no (and will never be a) ratio function in BetaFTPD, as such features
105 are only used for warez/MP3/porn servers, and are quite stupid even then.
107 5. Eek! `top' says BetaFTPD uses tons of memory!
108 ------------------------------------------------
109 Yes, but top really is wrong :-) Well, actually, I don't think it could do
110 better -- every file BetaFTPD mmap()s is counted towards the total number. So
111 if you were serving the same 128MB file 10 times, top would claim you used over
112 a gigabyte of memory, still only a couple of megabytes would be used at most,
113 as cache. If you ran out of memory, this could actually shrink to zero. It's
114 just that the kernel tries to be more effective (and it succeeds) by reducing
115 the number of reads, and instead reading larger chunks at once.
117 If sendfile() support is enabled, and the circumstances allow it (binary mode
118 downloading), BetaFTPD will not mmap() at all, bringing the memory total down
119 to a more realistic value.
123 On my Intel system, every user needs 1104 bytes (`struct conn'). When a user
124 has a file transfer, an additional 324 bytes (`struct ftran') would be needed,
125 or 1428 bytes per user in total. In addition, you have some `startup costs', of
126 course. `ps' (again on my system) reports a startup memory usage of 432 kB
127 (RSS, I don't know enough about memory to know if this is a realistic number
128 ;-) ), compared to 484 kB for a single wu-ftpd session (again RSS). To be
129 honest, I don't think BetaFTPD uses much memory. [Note that this information is
130 a bit old -- I haven't tested it lately; expect 2-300 bytes extra per user.]
132 Oh, while we're at it: A 486 running BetaFTPD will easily be able to saturate a
133 T1 line, with room to spare. The bottleneck will most likely lie somewhere else
134 (like the bandwidth, or how fast the disk can deliver data). Unless you've got
135 a 386 running gigabit, of course... (I must admit, I've never really tried it
136 with more than 100Mbit/sec, but the problem then was clearly on the client
137 machine ;-) BetaFTPD has later shown itself to be more than able of saturating
138 a 10mbit link in real- world tests, with about 3% CPU utilization (PII/450MHz,
139 IDE disks all the way, about 2GB of files in all, 7-8 users at once).)
141 Recent load tests (see http://www.kegel.com/dkftpbench/results.html) show that
142 a P90 is able to serve about 250 clients (each at 28.800-speeds) on a 10Mbit
147 Have fun -- after all, it's about 5% the size of wu-ftpd (about 20k compiled!)
148 and provides (IMHO) about 98% of the needed, everyday functionality -- in fact,
149 if you don't need the _really_ exotic commands, it's faster (=better?) and uses
150 *much* less memory (especially when you have many users logged in at once) than
151 the majority of the FTP servers out there... (6 line sentence.)
153 This program is GPLed, version 2 (see the file COPYING), not any later or
154 earlier version (later versions will probably `upgrade' to new GPLs as they
155 become available, I just want to be able to choose what license I put my code
156 under). For more info on the GPL, visit http://www.gnu.org/ .
158 7. Where to get new versions, contact me etc.
159 ---------------------------------------------
160 E-mail: sgunderson@bigfoot.com (all spam/flame go
161 to antispam@bigfoot.com or /dev/null)
162 Homepage, new versions: http://betaftpd.sourceforge.net/
163 Mirror site: ftp://metalab.unc.edu/pub/Linux/system/network/daemons/
164 (Note that Metalab will always lag behind a few days, and
165 doesn't carry beta versions.)
167 There are more mirror sites at the homepage.