Hi, folks
I have a strange situations. I have a FreeBSD 8.1 stable server machine with only ftp, mysql as main servicies. There is an external application which connects via ftp username/password and for every connections that made creates one subdirectory (into base username home directory) where put 2 small files, an .xml and an .pdf file (both around 100-200K). FTP username home directory looks like this:
So at every time when extern application connects to BSD box it creates one subdirectory inside Dir1 and Dir2 where puts two small files. Problem is where in one of those Dir1 or Dir2 it reaches >28000 subdirs proftpd can not make any subdirecotry inside them, even manually with root from console I am not able to make any subdirectory.
I have been googling for some days for this issues and I found out that 99% it might be a inode issue (because if I move 5000-10000 subdirs from one of this dir's to somewhere else, let's say backup_march, everything is working once again).
I have understood that in order to estimate how many inodes I might need, as from my scenario, I should do a simple math like:
2 (dir1 and dir2) * 2 (files, .xml and .pdf) * ( 20000 (max number of subdirs i have estimated into a month) * 12 (for one year) ) = 960 000 inodes
My system has 2 160GB IDE harddisks in mirroring with gmirror
Now i have
and for inodes
One of dirs
(and when it reaches ~28000 I can not create subdir's anymore)
And structural schema is/will be
I also understood that I must combine block size and frag size along with inode size and for a system with much small files inode size must be smaller like:
My question is what parameters should I give when defining partitions like (/usr, /var) in order to assure that it won't be for one year an issue with running out of inodes?
Thank you very much for your patience and understanding.
Best regards.
I have a strange situations. I have a FreeBSD 8.1 stable server machine with only ftp, mysql as main servicies. There is an external application which connects via ftp username/password and for every connections that made creates one subdirectory (into base username home directory) where put 2 small files, an .xml and an .pdf file (both around 100-200K). FTP username home directory looks like this:
Code:
/usr/home/username
-------- Dir1
---- ~15000 monthly subdirs with 2 small files
-------- Dir2
---- ~17000 monthly subdirs with 2 small files
So at every time when extern application connects to BSD box it creates one subdirectory inside Dir1 and Dir2 where puts two small files. Problem is where in one of those Dir1 or Dir2 it reaches >28000 subdirs proftpd can not make any subdirecotry inside them, even manually with root from console I am not able to make any subdirectory.
I have been googling for some days for this issues and I found out that 99% it might be a inode issue (because if I move 5000-10000 subdirs from one of this dir's to somewhere else, let's say backup_march, everything is working once again).
I have understood that in order to estimate how many inodes I might need, as from my scenario, I should do a simple math like:
2 (dir1 and dir2) * 2 (files, .xml and .pdf) * ( 20000 (max number of subdirs i have estimated into a month) * 12 (for one year) ) = 960 000 inodes
My system has 2 160GB IDE harddisks in mirroring with gmirror
Now i have
Code:
gw# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/mirror/gm0s1a 496M 322M 135M 71% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/mirror/gm0s1e 496M 13M 443M 3% /tmp
/dev/mirror/gm0s1f 141G 60G 70G 46% /usr
/dev/mirror/gm0s1d 1.4G 528M 822M 39% /var
Code:
gw# df -i
Filesystem 1K-blocks Used Avail Capacity iused ifree %iused Mounted on
/dev/mirror/gm0s1a 507630 329264 137756 71% 3178 62612 5% /
devfs 1 1 0 100% 0 0 100% /dev
/dev/mirror/gm0s1e 507630 13572 453448 3% 127 65663 0% /tmp
/dev/mirror/gm0s1f 147865114 63015148 73020758 46% 857197 18267025 4% /usr
/dev/mirror/gm0s1d 1502094 540624 841304 39% 981 210985 0% /var
Code:
gw# ls -la /usr/home/username/dir2/ | wc -l
14403
And structural schema is/will be
Code:
/
/usr -> ftp user home + mysql DB
/var -> mysql install and logs
/tmp ->
I also understood that I must combine block size and frag size along with inode size and for a system with much small files inode size must be smaller like:
newfs -O2 -U -b 4096 -f 512 -i 2048 /dev/xxxx
My question is what parameters should I give when defining partitions like (/usr, /var) in order to assure that it won't be for one year an issue with running out of inodes?
Thank you very much for your patience and understanding.
Best regards.