ProFTPD module mod_xfer



The mod_xfer module handles most of the FTP commands related to file transfers.

Directives


TransferPriority

Syntax: TransferPriority cmd-list "low"|"medium"|"high"|number
Default: None
Context: server config, <VirtualHost>, <Global>, <Anonymous>
Module: mod_xfer
Compatibility: 1.3.2rc1 and later

The TransferPriority directive is used to tweak the process priority (a la nice(1)) of the session during data transfers. For example, large (or anonymous) data transfers can be configured to have lower priorities, so as to get lower priority than other applications from the kernel.

The priority parameter can one of the convenient "high", "medium", or "low" keywords, or it can be an explicit number. As per the nice(1) man page, the higher the number, the lower the priority; the highest priority is -20, and the lower priority is 19.

Examples:

  # All data transfers get a low priority
  TransferPriority APPE,RETR,STOR low
Or maybe only downloads should have lower priorities, but uploads should be fine:
  TransferPriority RETR low


TransferRate

Syntax: TransferRate cmd-list kbytes-per-sec[:free-bytes]
Default: None
Context: server config, <VirtualHost>, <Global>, <Anonymous>, <Directory>, .ftpaccess
Module: mod_xfer
Compatibility: 1.2.8rc1 and later

The TransferRate directive is used to set transfer rate limits on the transfer of data. This directive allows for transfer rates to be set in a wide variety of contexts, on a per-command basis, and for certain subsets of users (via mod_ifsession). Note that these limits only apply to an individual session, and do not apply to the overall transfer rate of the entire daemon.

The cmd-list parameter may be an comma-separated list of any of the following commands: APPE, RETR, STOR, and STOU.

The kbytes-per-sec parameter is the actual transfer rate to be applied.

The free-bytes parameter, if configured, allows that number of bytes to be transferred before the rate limit is applied. This allows for clients transferring small files to be unthrottled, but for larger files, such as MP3s and ISO images, to be throttled.

Here are some examples:

  # Limit downloads for everyone
  TransferRate RETR 1.5

  # Limit uploads (and appends!) to the prolific users in the
  # lotsofuploadfiles.net domain. This presumes that a Class has been defined
  # for that domain, and that that Class has been named "uploaders". Let them
  # upload small files without throttling, though.

  <IfClass uploaders>
    TransferRate APPE,STOR 8.0:1024
  </IfClass>


UseSendfile

Syntax: UseSendfile on|off|len units|percentage
Default: None
Context: server config, <VirtualHost>, <Global>, <Anonymous>, <Directory>, .ftpaccess
Module: mod_xfer
Compatibility: 1.3.0rc1 and later

The UseSendfile directive controls use of sendfile(2) functionality, which is an optimization for sending files to clients. Use of sendfile(2) functionality avoids separate read and send kernel operations, and buffer allocations. Read this howto for more details.


Installation

The mod_xfermodule is always installed.



Author: $Author: castaglia $
Last Updated: $Date: 2011/02/21 03:08:33 $


© Copyright 2000-2011 The ProFTPD Project
All Rights Reserved