vsftp processes crashes Ubuntu by using all of the available memory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vsftpd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
We've started using vsftpd on an Amazon EC2 instance like 2 months ago.
Server is getting very high concurrent ftp traffic.
But when the concurrency gets higher, vsftpd (standalone version) processes start to eat up more and more memory (totally all vsftpd processes together eat up all of the real avialable memory (30GB) of the instance and causes it to go out of service.
I may give you more details, but the most important vsftpd.conf settings are as follows:
vsftpd seems to limiting the # of clients (given by max_clients=1000) since I see "Connection refused: too many sessions." errors loged in the ftp log file.
There doesn't seem to be any other strange errors apart from lots of
[15684.883021] type=1326 audit(141994898
sig=31 syscall=37 compat=0 ip=0x7f531bf67757 code=0x0
erros in the kernel logs.
/etc/vsftpd.conf
listen=YES
anonymous_enable=NO
local_enable=YES
pasv_enable=YES
port_enable=YES
pasv_min_port=10000
pasv_max_port=20000
pasv_address=Publix IP of the Amazon instance
allow_writeable
userlist_enable=YES
userlist_deny=NO
max_clients=1000
max_per_ip=3
idle_session_
data_connection
seccomp_sandbox=NO
vsftpd version : 3.0.2-1ubuntu2.
OS: Ubuntu 14.04.1 LTS, 3.13.0-43-generic #72-Ubuntu, x86_64
I'm quite sure that vsftpd processes use all of the real memory by inspecting
the output of ps -C vsftpd -o user,rss,
i.e. total rss of the vsftpd processes add upto 30GB when the system is about to run OOM.
Sorry there are lots of
INFO: task vsftpd:31878 blocked for more than 120 seconds. errors in the kernel logs also:
Dec 30 12:09:06 localhost kernel: [ 841.204124] INFO: task vsftpd:31878 blocked for more than 120 seconds. kernel/ hung_task_ timeout_ secs" disables this message. 539>] schedule_ preempt_ disabled+ 0x29/0x70 3a5>] __mutex_ lock_slowpath+ 0x135/0x1b0 929>] ? __kmalloc+ 0x1e9/0x230 43f>] mutex_lock+ 0x1f/0x2f b61>] copy_net_ ns+0x71/ 0x130 899>] create_ new_namespaces+ 0xf9/0x180 993>] copy_namespaces +0x73/0xa0 b16>] copy_process. part.26+ 0x9a6/0x16b0 9f5>] do_fork+0xd5/0x340 ce6>] SyS_clone+0x16/0x20 a09>] stub_clone+ 0x69/0x90 6ad>] ? system_ call_fastpath+ 0x1a/0x1f kernel/ hung_task_ timeout_ secs" disables this message. 539>] schedule_ preempt_ disabled+ 0x29/0x70 3a5>] __mutex_lock_slo...
Dec 30 12:09:06 localhost kernel: [ 841.206412] Not tainted 3.13.0-43-generic #72-Ubuntu
Dec 30 12:09:06 localhost kernel: [ 841.208721] "echo 0 > /proc/sys/
Dec 30 12:09:06 localhost kernel: [ 841.211745] vsftpd D ffff88078fc33480 0 31878 878 0x00000000
Dec 30 12:09:06 localhost kernel: [ 841.211749] ffff8806d8dd9d40 0000000000000086 ffff880754cf4800 ffff8806d8dd9fd8
Dec 30 12:09:06 localhost kernel: [ 841.211753] 0000000000013480 0000000000013480 ffff880754cf4800 ffffffff81cdb7a0
Dec 30 12:09:06 localhost kernel: [ 841.211756] ffffffff81cdb7a4 ffff880754cf4800 00000000ffffffff ffffffff81cdb7a8
Dec 30 12:09:06 localhost kernel: [ 841.211760] Call Trace:
Dec 30 12:09:06 localhost kernel: [ 841.211769] [<ffffffff81725
Dec 30 12:09:06 localhost kernel: [ 841.211772] [<ffffffff81727
Dec 30 12:09:06 localhost kernel: [ 841.211777] [<ffffffff811a2
Dec 30 12:09:06 localhost kernel: [ 841.211779] [<ffffffff81727
Dec 30 12:09:06 localhost kernel: [ 841.211784] [<ffffffff8161d
Dec 30 12:09:06 localhost kernel: [ 841.211788] [<ffffffff8108f
Dec 30 12:09:06 localhost kernel: [ 841.211791] [<ffffffff8108f
Dec 30 12:09:06 localhost kernel: [ 841.211795] [<ffffffff81065
Dec 30 12:09:06 localhost kernel: [ 841.211797] [<ffffffff81066
Dec 30 12:09:06 localhost kernel: [ 841.211800] [<ffffffff81066
Dec 30 12:09:06 localhost kernel: [ 841.211804] [<ffffffff81731
Dec 30 12:09:06 localhost kernel: [ 841.211806] [<ffffffff81731
Dec 30 12:09:06 localhost kernel: [ 841.211809] INFO: task vsftpd:31886 blocked for more than 120 seconds.
Dec 30 12:09:06 localhost kernel: [ 841.214584] Not tainted 3.13.0-43-generic #72-Ubuntu
Dec 30 12:09:06 localhost kernel: [ 841.216778] "echo 0 > /proc/sys/
Dec 30 12:09:06 localhost kernel: [ 841.220142] vsftpd D ffff88078fc13480 0 31886 878 0x00000000
Dec 30 12:09:06 localhost kernel: [ 841.220146] ffff88069cff7d40 0000000000000082 ffff880662351800 ffff88069cff7fd8
Dec 30 12:09:06 localhost kernel: [ 841.220149] 0000000000013480 0000000000013480 ffff880662351800 ffffffff81cdb7a0
Dec 30 12:09:06 localhost kernel: [ 841.220152] ffffffff81cdb7a4 ffff880662351800 00000000ffffffff ffffffff81cdb7a8
Dec 30 12:09:06 localhost kernel: [ 841.220156] Call Trace:
Dec 30 12:09:06 localhost kernel: [ 841.220160] [<ffffffff81725
Dec 30 12:09:06 localhost kernel: [ 841.220163] [<ffffffff81727