kern/77680: Too many files in a single directory slowing and then
crashing the system
dyw at wyk69.org
Fri Feb 18 15:00:20 GMT 2005
>Synopsis: Too many files in a single directory slowing and then crashing the system
>Arrival-Date: Fri Feb 18 15:00:19 GMT 2005
>Originator: David WU
>Release: FreeBSD 5.3-RELEASE #0
I have a mail server running mainly sendmail with amavisd-new and clamav and spamassasin. The size of the quarantine directory /var/virusmails can grow fairly quickly due to the large number of files created. I suspect when the size get to be larger than 8M (from the output of ls -l /var) the system will start to slow down considerably and if nothing is done will crash eventually, and will not be able to reboot without manually intervention, as fsck will fail no matter how many times the problematic file system is checked. I had to remove manually all the files under /var/virusmails and perhaps even the directory itself before fsck can be used to make the file system clean enough for a reboot.
I do not really want to repeat the problem as I have no idea how long it takes the system to crash from the time it slows down as it is a production machine handling email. Sorry about that.
Since the directory is under usage, the workaround is to use a script to rename the old directory and then created a new one using the same name. of course this has to be done before the system crashes.
More information about the freebsd-bugs