We are currently running a Ubuntu 16.04.3 Server

  • CPU : Intel Xeon E3-1270v6 - 4c/8t - 3,8GHz /4,2GHz
  • RAM : 64Go DDR4 ECC 2400 MHz
  • HDD : 2 x 1.2To SoftRaid nvme

It's a dedicated server, and we have full access with SSH, etc..

We have some directories that contains lots of files (more than 50000). We want them to be accessible by FTP. When we try to update the LimitRecursion (default values "2000 8") to "50000 8", we have an error while browsing those directories via FTP client (Filezilla or WinSCP, same problem) :

  • 421 - Out of memory

I don't understand how pure-FTPd is managing memory, and in the readme file I didn't see any option to adjust so that i can display all files.
Displaying all files of those folders is not facultative.

Any help or advises would be greatly appreciated.


I have faced the same problem in my pure-ftpd installation and after some debugging I found the problem. There is a linux limit ( The maximum size of a process's data segment ) which is 16k by default. You can change this limit in /etc/security/limits.conf and set a higher value, or running ulimit -d unlimited before running the pure-ftpd daemon script.

Unfortunately, this does not solve the problem.

pure-ftpd runs as a daemon, and the main process may have an unlimited max size of process data segment. However, pure-ftpd creates child processes with the uid specified for each ftp user. This child processes do not inherit the max size limit from it's parent. The child processes run with a 16kb limit and pure-ftpd returns error 421 out of memory.

I have tried to change the /etc/security/limits.conf file adding the users configured in pure-ftpd, and still not working. I have also tried to add a line for all users (*) and it does not work either.

I find a workaround to ignore these limits although it is not the best solution.

There is a kernel parameter (ignore_rlimit_data) which disables these limits. You can set this as at boot option by modifiying grub.cfg (depends on linux versions). This solution needs a system reboot. You can also change this option on a running Linux by running:

#echo "Y" > /sys/module/kernel/parameters/ignore_rlimit_data

This solved the problem, but I would like to know how to make pure child processes inherit ulimit values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.