Windows下的電驢伺服器器架設

 

目前最通用的電驢伺服器軟件是lugdunum,針對不同的操作系統都有不同的版本。

 

值得說明的是,在Windows下跑eserver效率肯定是不如Linux或BSD的,但在一般配置的伺服器上,支持個幾萬人在線還是沒問題的。鑒於目前eMule伺服器短缺,能把閒置得Windows伺服器利用起來跑eserver還是有意義的。

首先是軟件下載 http://lugdunum2k.free.fr/files/eserver-17.10.i686-win32.exe
這個是17.10版本,比較老,但也比較穩定,除了不支持模糊協議外沒什麼不好。官網上最新的那個下了會誰連都是lowid。

把這個exe保存到某個目錄下,比如e:\eserver\
在同一目錄下建一個 donkey.ini 文件,用來寫配置。給大家VC的配置簡單參考一下

代碼
[server] desc = 伺服器介紹
name = 伺服器名字
maxClients=70000#windows伺服器7W差不多了,多了容易死機,量力而行
softLimit=4000
hardLimit=4000
thisIP=本機IP#伺服器有多個IP的時候才需要這個配置
port=4661#端口
LOWIDpercent=100
nickcommunity=[hk]#名字帶[HK]的才能連,資源有限暫不考慮外國兄弟了,注意一定要都小寫
maxstrangers=10000#最多允許多少個名字不帶[HK]的
maxnozlib=0
seedIP=本機IP#這個選項是把自己的伺服器信息告訴給別的伺服器,這樣用戶其他伺服器的時候就會更新到你的信息了
seedPort=4661
filter[0]=(#FORMAT met)
filter[1]=(#FORMAT part)

這樣直接運行剛才那個exe,伺服器就啟動了。

為了保證伺服器穩定運行,可以寫個bat啟動(今天自己寫得,沒想到dos還能用上……)
建一個runeserver.bat,內容如下,裡面的路徑記得自己替換掉,日誌記錄在eserver.log

代碼@echo off
cls
del E:\eserver\eserver.log
:start
echo eServer 伺服器正在運行,請不要關閉本窗口
E:\eserver\eserver-17.10.i686-win32.exe >> E:\eserver\eserver.log
echo ——————-%date% %time%————————- >> E:\eserver\eserver.log
echo 伺服器於%date% %time%重啟
echo ———————————————————
goto start

這樣就算OK了,算是很簡單吧。一般規模的eserver對伺服器硬件要求不高,希望有更多穩定的國內伺服器出現。到時候我們會考慮加入到eMule的默認伺服器列表中的。

PS: Linux系統的話也很簡單,http://lugdunum2k.free.fr/kiten.html 上有詳細介紹。
donkey.ini配置和windows是一樣的。
對於eserver配置方面的問題,歡迎與我們交流。

————————-

如何創建一台ED2K伺服器

眾所周知,ED2K伺服器在EMULE整個運行過程中有著非常重要的作用,尤其是在找源與搜索方面,ED2K伺服器暫時無法被KAD完全取 代;ED2K伺服器可以鑒別虛假與惡意文件,維繫EMULE與其他不支持KAD協議的ED2K兼容客戶端之間的聯繫。有了ED2K伺服器,EMULE才能 更好的運行。

最早編寫ED2K伺服器軟件的是創立ED2K協議的MetaMachine(EDONKEY2000.COM),稱為DSERVER,版本一直發展 到16,然後轉交給法國的LUGDUNUM維護,現在發展到最新的17.15. LUGDUNUM也稱ESERVER.目前已知的所有知名ED2K伺服器,包括DONKER SERVER,BIG BANG,BYTE DEVILS全部基於LUGDUNUM運作。

由於考慮到位於北美大陸的惡意與虛假伺服器對ED2K網絡的威脅,LUGDUNUM是免費但不開源軟件,伺服器版本是否最新是判斷一個伺服器好壞的重要特徵。

LUGDUNUM主要設計用於LINUX平台運作,支持多核心與64位運行,但也有面向WIN32,solaris與FREEBSD平台的版本。

LUGDUNUM的英文版主頁,可以下載到對應不同CPU與架構平台的LUGDUNUM程序。

下載與你的系統和CPU對應的LUGDUNUM,然後解壓到任意文件夾中,再去下載ip-to-country.csv與ipfilter.dat,把他們放在LUGDUNUM存放的位置,這時就可以編寫LUGDUNUM的配置文件----donkey.ini。

這是核心部分:ED2K伺服器的每一個變量都被寫在這個文件裡。eserver開始運行時會讀這個文件。非常重要:伺服器軟件沒法接受語法錯誤(書 寫時的錯誤)。伺服器不能明白某個命令,它就不會工作,或者它會忽略寫得不對的命令(以及後面的任何東西)。大小寫也是非常重要的。所有單獨條目均不能有 註釋。

[server]

這個命令啟動控制進程。它必須被寫在方括號裡。在最後的那個方括號後面沒有空格,這一點非常重要。否則的話這將使伺服器無法理解 ——也許它沒法工作了。接下來的條目只是例子而已!

name=eserver 17.10

伺服器的名字,就像你在客戶端看見的那個。你可以用任何你想用的的文字數字組合。

desc=eserver 17.10

伺服器描述信息,跟「name=」格式是一樣的。可以用任何文字。

thisIP=10.10.0.1

請注意大小寫!(IP「61.152.93.254 」只是個例子而已)。這將告訴伺服器你自己的,公開的公網IP。程序開始時,伺服器會把它工作的IP發送到其他的伺服器。請注意程序開始時所顯示的IP, 它是你當前真正的,公開的IP,用戶會通過你提供的這個IP連接到你的伺服器。

port=4661

在這裡你要指定可以跟伺服器建立聯繫的端口。一般情況下這個端口是TCP:4661,如果你想用4661,那麼這個條目可以空著。如果由於某些技術 原因該端口不可用的話,你可以用其他的端口。當然如果是這樣的話你就得給出這個條目了——如果可能的話,盡量不使用4661,因為某些無良ISP封鎖了 4661與4662。 端口缺省是TCP:4661

seedIP=10.10.0.1

注意大小寫!(IP地址「62.241.53.2」只是個例子而已)
這一項,就像名字示意的那樣,是指伺服器從哪裡連接到網絡其他部分,它代表一個正在運行的ED2K伺服器,這樣你的伺服器才能夠找到它 ——它是你的伺服器首先建立連上的那個伺服器。 首先,你的伺服器發送自身的IP地址和端口號——然後他就會獲得種子伺服器所知道的所有的IP地址。

seedPort=4661

注意大小寫! (端口「4242」只是個例子而已)
如果「種子伺服器(Seed-Server)」的端口號不同於缺省的TCP:4661,就必須有這個條目。許多伺服器使用4661端口「seedPort」的缺省設置是4661。

logFile=true/false
注意大小寫!
你可以把日誌寫到硬盤裡,而不是把它們顯示出來——這也就是說把顯示輸出關閉掉——這樣的話伺服器不會在屏幕上顯示任何輸出! 「true」表示「激活該功能」,「false」表示「關閉該功能」。如果你不想顯示輸出而想用日誌文件的話的話——寫true,否則寫false——請 不要寫both(兩者都要),否則你的伺服器會發癲的,或者將引起你的電腦爆炸!! 「logFile」的缺省設置是「false」——關閉……

verbose=true/false

如果你想看所有的系統顯示的注意信息,你應該把「verbose」激活(把它設成「true」)——一般來講如果所有的東西你都看看的話是很煩人 的,因為「普通的」信息顯示得太快了。不要感到驚訝:即使是「verbose=false」,伺服器仍然會打出「ERROR: unknown type MetaTag::MakeTag() 72」或者類似的信息 ——別管它,伺服器會工作的。為什麼會顯示這個信息呢?我不知道!總之別理它就行了…… 「Verbose」缺省是設成false——關閉……

public=true/false

這個條目決定了你的伺服器是否把自己的IP發送到其他伺服器去。把這個條目設置為「true」對網絡來講是非常重要的,因為一般你要運行的都是公開伺服器,只有設置為「public=true」你的伺服器才能夠登陸到網絡上去!
注意:「public」缺省是設成「false」的,把它更改為true.

threads=10 (integer)

這個條目定義能夠同時處理的任務的數目。多任務操作系統,比如Linux,Windows 2000/XP/2003可以安排交互的不同的任務以及資源,比如內存和處理器時間。這個工作進行得很快,看起來好像任務都是同時進行的一樣。就像所有的 「諾曼機器」的情形一樣,因為PC處理命令都是串行的,所以這個同時處理實際上只是看起來像而已,因為速度很快所以感覺不出來。由於工作的交互進行性,「 老」任務的數據必須被寫到緩衝區去,新線程的數據必須從緩衝區(或者更糟糕,從主內存中讀)中讀出來,每次任務交互都需要時間。
這個條目在新版的ESERVER中已經更改,從前DSERVER的定義為每5線程支持100客戶,目前LUGDUNUM網頁上推薦設定為10。
線程數目太高的話會帶來不利。每個線程,即使它並不工作,也需要佔用CPU時間以及一定內存,所以不要將threads的值設的過高。

r)

注意大小寫!
這裡的table就是包含了文件名和客戶的數據庫。這一定是一個素數。其技術背景(快速搜索次序)就不深入探討了。這個值的 大小看起來並沒有什麼太大區別。在默認的ini文件裡這個值是「3089」——這實際就是一個素數。設為其他素數也沒有任何影響。如果不去設定,伺服器會 自動生成一個素數取代。

maxClients=100000

注意大小寫!
這裡是多少客戶可以同時連接到伺服器的數目。如果「maxClient(最大客戶數目)」——達到了峰值時,客戶端在嘗試連接到該伺服器的的時候會出現「Can′t connect to…(無法連接到……)」這樣的信息。
你必須試試才能知道你的伺服器的最佳值,LUGDUNUM支持運行中更改可容納客戶端數目,更改後也無需重新啟動程序。

type=key/substring (key 或者 substring)

注意大小寫!
「type」缺省被設置成「key」,也就是快速模式;「substring」是老式方法,速度慢。

console=true/false

這個值決定伺服器是否工作在控制台(命令行提示符)狀態下。當伺服器自動開始運行並且你不想使用「屏幕」命令的時候,這樣做還是有用的。
如 果「console=true」的話,你就必須在控制台下運行伺服器,如果「console=false」則不必非要如此,但這時就不能用鍵盤給出任何命 令了,並且不能顯示任何東西。嗯,其實這兩樣都不是必需的,但是我喜歡時不時察看一下它在幹什麼並加以控制,以及看看它知道多少可用的伺服器(敲 「vs」)。 「console」缺省是設置成「true」

minVersion=57

注意大小寫!
這定義低於v.57的版本不能連接到伺服器。當有客戶端軟件的更新版本出現時,改改這個值是有用的,但請注意當時的形勢,比 如說,由於一個安全方面的bug,新版本v.61沒法支持ed2k-links,因此沒有很多用戶升級到它,還有linux的版本可能比windows版 本老很多……
如果沒有設置「minVersion」值的話,所有版本的客戶端都會被伺服器接受。

maxVersion=9999

注意大小寫!
這定義了伺服器可接受的最大版本號。測試版的客戶端程序往往有一個很高的值(比如1060)——因此這個值應該留為空白,否則的話你得常常更新這個值並且很容易忘記——正在測試新客戶端的用戶就被請出去了……:-( 設為9999就保險了。
如果「maxVersion」沒有被設置的話,任何高於「minVersion」的版本均會被接受。

welcome[0]=Welcome to TheDonkeyNetwork
welcome[1]=share your Files and your upload Bandwith

這是歡迎信息,在登陸到伺服器時被顯示出來。設定時你要注意,[]裡面的數字是變化的,每行的不一樣。歡迎信息不應該太長,否則的話它們將需要許多帶寬——每個字母1字節!當出現1000客戶時,平均每分鐘會有5-50個連接……

一個完整的可以使用的donkey.ini文件看起來像這樣:

[server] name=eserver 17.10
desc=eserver 17.10
thisIP=10.10.0.1
port=4661
seedIP=62.241.53.16
seedPort=4242
verbose=false
public=true
threads=10
type=key
tableSize=3089
maxClients=100000
minVersion=57
maxVersion=9999
logFile=false
welcome[0]=這是測試伺服器
welcome[1]=
welcome[2]=This is a test server.

下面介紹一下一些其他的設置選項

LOWIDenable (integer)
如果為 1, LOWID 用戶可以登錄。缺省值為 1

LOWIDpercent (integer)
最大的 LOWID 用戶比率。建議不要超過33%,缺省值為20

autoservlist (pathname)
如果設置了,伺服器會每225秒將已知的其他伺服器列表寫入server。缺省值為none

auxportslist (list of ports values)
輔助監聽端口列表,16.45版的新特性
例子:auxportslist=80,443,25,21

blacktime (integer)
黑名單時限。即將客戶端ip列入黑名單保留的時限.缺省值為3600

bverbose (boolean)
如果為真,eserver會記錄下黑名單ip。缺省值為false

connIP (IP address)
當伺服器有多ip時,指定輔助監聽的ip。和ftpd的virtual host不同,這裡還有防止Hash Stealers的功能

filter[] (filter expression)
濾鏡,防止共享某些不合法或不完整文件,有需要的話我會另外一個帖子介紹一下詳細用法
例子:
filter[0]=(.part.met)
filter[1]=(.part.stats)
filter[2]=(#FORMAT met)
filter[3]=(#FORMAT part)
filter[4]=(#FORMAT dll)|(#FORMAT sys)

hardLimit (integer)
共享文件數目硬性限制,為避免某些用戶共享過度的文件數浪費帶寬而設置,擁有超過此數目共享文件的用戶將被踢出伺服器,默認值為4000

login_timeout (integer)
登陸時限,在時限內檢驗客戶端獲取 HighID 或 LOWID。默認值為20

max_clients_per_ip (integer)
限制同一IP連出的客戶端數量,默認值為12。
可以防止某些蠕蟲/病毒/機器人發起太多連接以填滿伺服器的資源,但是容易使國內一些寬帶的用戶進入黑名單。

maxSearchCount (integer)
從以連接客戶中搜索返回結果最大數,默認值為200

maxUDPSearchCount (integer)
從非連接客戶中搜索返回結果最大數,默認值為20

maxservers (integer)
伺服器被加入伺服器list的最大值,避免拒絕服務攻擊。缺省值為4096

maxstrangers (integer)
最大陌生用戶的數目,缺省為1000000

minEVersion (integer)
可登入伺服器的Emule的最小版本,缺省值為0x26
註:EMULE的版本數字為16進制,範圍從00到FF

minkeylength (integer)
搜索時關鍵字的最小長度,缺省為3

nbuserIP (IP address)
如果使用了nbuser來監聽,在這裡設置監聽機器的ip,缺省為127.0.0.1

nbuserport (integer)
nbuser監聽的端口,默認為5656里

ncpus (integer)
設定主機可用的CPU的數目。

nickcommunity (string)
非陌生客戶認證的標誌,也就是登錄伺服器需要的TAG,比如POPGO伺服器需要的EDTOON,缺省值為空

noudpslowsearches (boolean)
拒絕複雜搜索,即拒絕關鍵字搜索,缺省值為false

ping_delay (integer)
ping延遲時間,伺服器會在一定的間隔獲取用戶總數和每一個用戶共享的文件,這個過程叫做ping。缺省值為400

softLimit (integer)
共享文件數目軟性限制,為避免某些用戶共享過度的文件數浪費帶寬而設置,用戶超過此數目的共享文件將被伺服器忽略,默認值為1000

tcpthreads (integer)
用於接受客戶端請求的TCP請求的線程數目,默認值為當前主機的可用CPU數目

trackbademule (integer)
拒絕虛假版本EMULE的登入,要與minEVersion配合使用,默認值為30

trackemule (integer)
此項如果被激活(設為1),伺服器程序將跟蹤EMULE的版本,默認值為1

udpsearchers (integer)
為UDP搜索動作準備的線程數目,在單CPU機器上請設為1,多CPU機器上請設為2

warnfakes (integer)
惡意文件提示,當用戶持有或正在下載fakes.txt中已知的虛假或惡意文件時,伺服器發給該用戶的警告信息的數目,默認值為0(不發送)
附:fakes.txt 的格式
純文本格式,每行只寫入一個虛假或惡意文件,以該文件的32位MD4 HASH值開頭,後面是對於該文件情況的描述。

伺服器命令
vc
查看當前伺服器中用戶登錄情況

vs
查看種子伺服器的運行情況

vo
查看當前伺服器的一些選項的值,比如IP,端口,軟硬限制等

name=valve
更改選項的值,比如鍵入 maxClients=30000 就是將最大客戶端數目設為30000

print name
顯示該選項的當前值,比如建入 print maxClients,伺服器就會顯示 maxClients=30000

g | stats
顯示伺服器當前的用戶情況,搜索狀況,端口信息,連接情況。

wel
顯示伺服器的歡迎信息

filters
設置伺服器中的文件名過濾

slab
顯示當前的內存使用情況

debug
顯示伺服器的調試信息

reload
重新載入配置文件

m message
向客戶端廣播信息,message指代廣播內容。

在LINUX下的一些設置

對於大型伺服器,修改/etc/sysctl.conf中的fs.file-max將其值改為 16384
官網推薦使用腳本啟動伺服器,腳本內容如下:
# script.sh file
ulimit -n 100000
while :
do
./eserver
sleep 1
done

——————————————————————————–

英文原始資料

donkey.ini documentation :

You can list all the available parameters and their current values by issuing this eserver command :
print
All these params 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.
Example
auxportslist=80,443,25,21

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[0]=(.part.met)
filter[1]=(.part.stats)
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 172.16.0.156
When the server thinks the client can be accepted again :
Wed Oct 8 16:07:06 2003 ACCEPT 172.16.0.156

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 :
CONFIG_HUGETLB_PAGE=y
CONFIG_HUGETLBFS=y
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 :
hugefile=/huge/eserver
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.

jigleIP (IP address)
The IP address of jigle, to avoid blacklisting www.jigle.com. Default value : 62.2.249.5

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

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 : 1024

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

maxVersion (integer)
A client software has a version number. Clients having a version greater than maxVersion are not allowed to login. Default value = 2000

maxnozlib (integer)
New in version 16.44. When the current number of users exceeds the maxnozlib value, only zlib aware clients are alowed to login. Default value = 250000

maxservers (integer)
Limits the maximal number of servers that this server can add in its list. To protect against some Denial Of Service attacks. Default value = 4096

maxstrangers (integer)
Used with the nickcommunity parameter. No more than ‘maxstrangers’ users not belonging to the community are allowed to login. Default value = 1000000

minEVersion (integer)
Used with the trackemule feature. Gives the minimum Emule version that this server allows. Emule version is a hexadecimal number between 00 and FF. Default value = 0x26

minVersion (integer)
A client software has a version number. Clients having a version lower than minVersion are not allowed to login. Default value = 59

minkeylength (integer)
Default value 3. This is the minimum length of a keyword. The server builds indexes on the keywords contained in the filenames, to be able to perform fast searches.
As indexes use a lot of ram, 16.44 server can ignore short words.

mmap_hint (integer)
A hint for the eserver to place its 4Mo pages in virtual memory space. Default value = 0 (no hint)
On ia32 linux, one can use mmap_hint=0x80000000
razorback uses 0x74000000

msgrandomport (boolean)
Some providers (ISP) are filtering 4662 port. To help users, it may be a good thing to ask them to change the 4662 value for something else.
If msgrandomport is true, the server automatically sends a warning message to users that uses the default port.
The MsgRandomport default value is : WARNING : Please try to use a random port instead of 4662, because a lot of ISP have filters on 4662 port. Any number between 80 and 65530 should be OK. Thanks

name (string)
The name of your server, as sent to clients. Default = eserver 16.44

nbuserIP (IP address)
The server has a special TCP listener on a port that allows nbuser to gather information. By default, the port is binded on 127.0.0.1 (localhost) so that only a local nbuser can connect to eserver. You may want to allow extern access. Default value = 127.0.0.1

nbuserport (integer)
The port of the nbuser listener. See above. Default value = 5656

ncpus (integer)
This value is filled by eserver at startup, and gives the number of cpus of the host. Not really used by the programm. See udpsearchers. Default value = number of cpus of the host.

nickcommunity (string)
The tag that should be present in the nickname of users to be able to log in the server. Used with maxstrangers.
Note : You MUST enter a string in lowercase. (The clients can use upper/lower case). Default value : no value (public server)

nickname (string)
When performing a backdoor test to the 4662 port of client, the eserver impersonnate a user. This param is the nickname of the faked user. Default value = eserver

noepoll (boolean)
(linux only) If set to true, eserver doesnt try to use epoll feature. I strongly advise not doing that, but your linux version may have a bug on this function. Default value = false
For linux-2.4.21 or linux-2.4.22, you can try the patch from Davide Libenzi to add epoll feature.

opIP (IP address)
If the server operator wants to use a ed2k client and connect to his own server, he may have a problem because of a private IP. The opIP parameter asks the server to replace the client’IP by the listenIP/thisIP of the server. That way, when other client want to contact the operator, their incoming connections can be NATed to the operator.

noudpslowsearches (boolean)
You can deny to handle complex searches sent by remote users (clients of other servers). Complex searches are searches that must scan the whole file list, instead of using a keyword index. Default value = false

ping_delay (integer)
The server periodically sends a frame called a ‘ping’, containing the number of users and files he has, to each of its client. This is to verify each TCP socket is alive (Users may have switch off their computer). ping_delay is the maximal delay between such pings. Default value = 300 (was 400 before 16.49)

port (integer)
This is the TCP port that this server listens on. Default value = 4661
See also auxportslist

public (boolean)
If set to true, the server advertizes himself as a public server to other servers. This parameter had a role in the past, but is useless today because clients can automatically add servers to their list, when a client connects to them. Default value = false.

quickack (boolean)
If set to true, the server uses the setsockopt(TCP_QUICKACK) to ask the linux kernel to delay the TCP ACK packets, instead of enter in the quickack mode. This should reduce the bandwitdh. Default value = true.

search_trace (boolean)
If set to true, the server dumps to the logsearches file the searches requests handled. Default value = false

seedIP (IP address)
The IP address of another server. This is used by the eserver if no "serverList.met" file is present (or if it’s empty), to gather a server list. Default value : none

seedPort (integer)
The port of the seed server. Default value = 4661

slimit_tableSize (integer)
The size of the hash table used in slimit module. Each slot uses 4 bytes of memory. Default value : 10007

softLimit (integer)
If a client tries to publish more than softLimit files, the server sends him a WARNING message and ignores files in excess. Default value : 1000
See hardLimit parameter description.

tableSize (integer)
The size of the hash table used to store file descriptions. You should not set it, since eserver dynamically increase it as needed.

tcpthreads (integer)
The number of worker threads to handle tcp requests (connected clients). See ncpus. May be dynamically changed in eserver console. Default value = number of cpus of the host.

tcp_rbuffersize (integer)
The TCP/IP stack of your machine allocates for each socket a maximum size to store incoming messages. You may want to change this default size.
Default value = 0 (system default)
(on linux check /proc/sys/net/ipv4/tcp_rmem)

tcp_xbuffersize (integer)
The TCP/IP stack of your machine allocates for each socket a maximum size to store outgoing messages. You may want to change this default size.
Default value = 0 (system default)
(on linux check /proc/sys/net/ipv4/tcp_wmem)

thisIP (IP address)
This is the IP of this Server. Note : eserver cannot find it automatically. You MUST set it correctly if your server is public.

threads (integer)
Obsolete parameter. The number of threads in eserver is fixed:
One thread receives UDP request.
One or two threads handle UDP searches. (See udpsearchers)
One thread accepts new incoming connections.
One thread handles the login phase of clients.
One thread handles the console dialog. (This is the ‘main’ thread)
One thread handles all the TCP traffic (requests from connected clients)
One thread handles the ‘nbuser’ requests.
One thread handles incoming connections to auxports.

trackbademule (integer)
A bitmask of flags. See minEVersion parameter. Default value = 30

trackemule (integer)
If set to 1, eserver tracks the emule version. Check also minEVersion parameter. Default value = 1

type (string)
Two values are possible :
key (default) : The server builds indexes based on keywords found on file names. Searches are fast.
substring : The server doesnt uses indexes. Searches are slower.

udp_rbuffersize (integer)
The UDP/IP stack of your machine allocates for each socket a maximum size to store incoming messages. You may want to change this default size. Default value = 0 (system default)

udp_xbuffersize (integer)
The UDP/IP stack of your machine allocates for each socket a maximum size to store outgoing messages. You may want to change this default size. Default value = 0 (system default)

udpsearchers (integer)
The number of threads dedicated to UDP searches. Default value : 1 on Uniprocessor machine, 2 on SMP machine.

verbose (boolean)
If set to true, the server logs some messages (clients login/lougout for example). Default value = false

warnfakes (integer) (New in 16.50)
Each time a client publishes a file that is present in fakes.txt, the server sends a warning message giving the name of offending file to the user. This parameter controls the max number of such messages. Default 0.

welcome[#] (string)
This is a series of messages that each client that logs on to the server will be sent.
New in 16.50 : If ip-to-country.csv file is used, the server checks if a file welcome.xx (where xx = country code of the incoming client) exists. If yes, the content of file is sent instead of the welcome[] from donkey.ini

zlib_complevel (integer)
level of compression done by this server. An integer between 0 (no compression) and 9 (max compression) . Default value = 9

zlib_enable (boolean)
Allows server to negociate zlib compression with incoming clients. Default : true

Format of fakes.txt file

This file is a text file, containing one fake description per line. Each line should start with a 32 hexadecimal digits (16 bytes) md4 hash of the file, followed by some comments and a line feed.

See also warnfakes parameter.

Linux Kernel tuning :

For big servers, dont forget to increase /proc/sys/fs/file-max. (default value 8192).
You can add (or modify if already present) this line to /etc/sysctl.conf :
fs.file-max=16384
You can also do : echo 16384 > /proc/sys/fs/file-max (but value is lost after a reboot)

On linux 2.2 machines, dont forget to change /proc/sys/net/ipv4/route/max_size, because a too low value can explain some problems.
echo 32768 > /proc/sys/net/ipv4/route/max_size
You may also change the linux 2.2 VM settings :
echo "1024 2048 4096" > /proc/sys/vm/freepages
Linux 2.2 has a limit on the poll() system call : Because it uses the kmalloc(nbhandles*8) kernel service, it has a limit of 16384 file handles. So a eserver running on a linux 2.2 machine can not have more than 16300 users.

Last advice : we suggest to launch the program with a script script.sh : It uses ulimit -n 8192 to change the maximum number of files a process can open. If you plan a 10000 users server, change this to 16384 !

For users wanting to run eserver as an ordinary user (not root), you may change /etc/security/limits.conf and add this lines :
* soft nofile 32768
* hard nofile 32768

Notes about other OS:

Tru64 Unix 5.1 : limit of 65536 file descriptor per process : A server can not handle more than 64k users.

HPUX 11 : maxfiles (see sysdef command) limit is 60000 : No more than 60.000 users.

FreeBSD : check the limits with sysctl command.
# sysctl kern.maxfiles
kern.maxfiles: 5000
# sysctl kern.maxfiles=65000
kern.maxfiles: 5000 -> 65000
# sysctl kern.maxfilesperproc
kern.maxfilesperproc: 4200
# sysctl kern.maxfilesperproc=65000
kern.maxfilesperproc: 4200 -> 65000
 
 

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料