lugdunum2k.free.fr website backup  


logo2 The lugdunum kit to build an eDonkey server
Building an efficient edonkey server on linux


eServer configuration file.

The donkey.ini file must be placed in the same directory of the binary.All the parameters are optional and can be changed in the donkey.ini file, and many of them can be changed dynamically, in the eserver console. Note : boolean values can be false, true, 1, or 0.


LOWIDenable (integer) (should be boolean in next version)
If 1, LOWID users can login. Default value : 1

LOWIDpercent (integer)
Maximum percentage of LOWID users. Warning : having too many LOWID logged in a server is a bad idea, since nobody can get sources. I suggest not having more than 33% of LOWID users. Default value : 20

autoservlist (pathname)
If set, the server can write a server.met file , with only working known servers, every 225 seconds (approx). Default value : none

auxportslist (list of ports values)
New in 16.45
The server can listen to auxiliary tcp ports. This is to help some users to avoid providers filters that block standard wellknown ports (4661,4242). Default value : none
Only updated clients may use aux ports, because we ask them not to spread aux ports values to other clients, because we dont want to receive additionnal UDP trafic.
This list may be modified dynamically.

bindUDPIP (IP address)
When a host has more than one IP, you can force the IP used by the UDP messages. This is usefull if the primary IP address of the machine is not the IP address of the server (thisIP).

blacktime (integer)
The number of seconds of blacktime : If a client IP is blacklisted (because of sending too many requests to the server), it stays in this blacklist for at least this time. Default value : 3600

blocsize (integer)
The number of bytes of the Unit of memory allocation. Dont change this value, as it is the size of a HugeTLB page (4 Mbytes). Default : 4194304.

bverbose (boolean)
If true, the eserver logs (to the console and/or logfile) the blacklisted IP and 'double connections'. Default value : false

connIP (IP address)
When a server has more than one IP, you can use a second IP to bind the outgoing sockets, that the server use to check the LOWID/HighID capability of new clients. Using a different IP can defeat some bad clients that give false informations (Hash Stealers)

console (boolean)
When the eserver prints a message, it is sent to the console if the console flag is 'true', and/or to the log file is logFile flag is 'true'. Default value : true

dcache_line (integer)
This controls the alignment of memory blocks that eserver users to store file descriptions. Trying to use the L1 cache size of the CPU helps the performance. The L1 cache size of PII & PIII is 32 bytes. For Athlons and P4, this is 64 bytes. Default value : system dependant.

defer_accept (integer)
The linux kernel has a TCP_DEFER_ACCEPT feature, that delay the accept() of a new TCP stream. The listening application is notified of a new connection only after some data were received on it. The defer_accept parameter is the max delay between the connection establishment and the first data. Default value : 10 seconds.

desc (string)
This is the description of the server. This string is sent to the clients. Default value : eserver

filter[] (filter expression)
Setup a filter that is applied to files published by clients. Please refer to the dserver documentation for details.
Example of filters :
filter[2]=(#FORMAT met)
filter[3]=(#FORMAT part)
filter[4]=(#FORMAT dll)|(#FORMAT sys)

fwcommand (pathname)
Introduced in 16.41, this parameter gives the name of a file. This file is updated when the eserver detects that a client loops on the login process.
When an IP is added to the 'bad list', a line like this one is added :
Wed Oct 8 16:07:06 2003 DENY
When the server thinks the client can be accepted again :
Wed Oct 8 16:07:06 2003 ACCEPT

You can use this file with a daemon that reads new records from this file, and issue some iptables/ipfw/whatever commands.

Example for iptables on linux :

At init time, (firewall setup) initialize the SYN chain and insert it in the INPUT chain, for SYN TCP packet only
iptables -N SYN
iptables -I INPUT -p tcp --dport 4661 --syn -j SYN

When the eserver or the daemon is restarted, flush the rules in SYN chain:
iptables -F SYN
Then, when a 'DENY' is emitted by eserver, add a rule in the chain :
iptables -I SYN -s the_IP -j DROP
When a 'ACCEPT' is emitted by eserver remove the rule :
iptables -D SYN -s theIP -j DROP
You may want to play with clever iptables module, like RECENT, that are faster when the number of IP is high (hashtable instead of list).

hardLimit (integer)
If a client tries to publish more than hardLimit files, the server disconnects him (before receiving the whole list). That is to save bandwidth, because some lazy people share all their files. Default value : 4000
See softLimit parameter description.

http_trace (boolean) (New in eserver 16.50)
When set to true, eserver logs HTTP requests to "loghttp" file. Default = false

hugefile (string)
(linux 2.6 only) : The path of a file located in a hugetlbfs file system. This allows eserver to try to allocate 4MB or 2MB Huge Pages instead of standard 4KB pages, to reduce hardware TLB misses. The normal page size on ia32 is 4Kbytes, which is way too small for a programm that has to use a huge amount of memory.
Dont bother with such advanced features for small servers.
Example of use :
Check your linux kernel config, you should have :
Then you can mount a hugetlbfs : (in a startup file, like /etc/rc.d/rc.local)
mkdir /huge
mount -t hugetlbfs none /huge
echo 100 >/proc/sys/vm/nr_hugepages

Then in donkey.ini add :

Note : On HPUX, Solaris, Windows2003, eserver tries to allocate big pages automatically.
On windows2003, the SE_LOCK_MEMORY priviledge should be granted to the user before starting eserver. If not, the server falls back to allocate normal memory (not 4MB big pages)

hugefile2 (string)
Since 16.45, the HugeTlb pages may be used for the heap storage too. (linux 2.6 only) : The path of a file located in a hugetlbfs file system.

listenIP (IP address)
The server can listen TCP connections to a specific address, instead of all IP of the host. Default value : Any address (

listen_backlog (integer)
The listen backlog. The eserver has a very high value, suitable for any servers, but you can change it. Default value : 1024
Note : On linux, you may want to check /proc/sys/net/ipv4/tcp_max_syn_backlog and /proc/sys/net/core/somaxconn : global system limits.

logFile (boolean)
If set to true, the server appends its message to the "log" file, located in the current directory. Default value : false

login_timeout (integer)
The value in seconds the server waits for the backdoor test to succeed. The backdoor test is a connection made by the server to the 4662 port of the client to check if it is a HighID or LOWID. Default value : 20

maxClients (integer)
The maximum number of clients for this server. Default value : 1000

max_clients_per_ip (integer)
Limits the number of clients sharing one IP. Default value : 12
This is to forbid some worms/virus/robots opening too many connections and fill the server.

max_frame_size (integer)
If a client send a frame with more than max_frame_size, the server disconnects it. Default value : 250000

max_slimit_nb_cell (integer)
This limits the maximum number of IP that slimit module can manage. Default value : 393216

max_string_size (integer)
This is the max size of a string. Some clients sends very long filenames. The server truncates too long strings. Default value = 140

maxSearchCount (integer)
This is the max number of answers given to a Search request (from a connected client) Default value = 200

maxSearchCountz (integer)
This is the max number of answers given to a Search request (from a connected zlib aware client) Default value = 300

maxUDPSearchCount (integer)
This is the max number of answers given to a Search request (from a not connected client) Default value = 20