Have you tried to use lsof to see which files are open?
I wrote a little script that runs as cronjob and uses lsof to count all open files owned by the cyrus user:
#!/bin/sh PATH="/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin" time=`date +"%Y-%m-%d %H:%M:%S"` num=`lsof -b 2>/dev/null |awk '($3 ~ /cyrus/){print $NF}' |wc -l` numu=`lsof -b 2>/dev/null |awk '($3 ~ /cyrus/){print $NF}' |sort -u |wc -l` echo "$time\t$num\t$numu" >>/var/log/cyrus_lsof.log
The first column is the number of all open files (with duplicates) and the second is the number of unique files.
2005-02-21 11:00:00 15218 872 2005-02-21 12:00:00 14076 856 2005-02-21 13:00:00 13968 844 2005-02-21 14:00:00 14659 897 2005-02-21 15:00:00 14005 849 2005-02-21 16:00:00 15200 903 2005-02-21 17:00:01 14857 920 2005-02-21 18:00:00 14477 886 2005-02-21 19:00:00 12984 789 2005-02-21 20:00:00 11976 590 2005-02-21 21:00:00 11944 635 2005-02-21 22:00:01 11766 638 2005-02-21 23:00:01 11798 619 2005-02-22 00:00:00 11562 625 2005-02-22 01:00:00 11726 631 2005-02-22 02:00:00 11831 636 2005-02-22 03:00:00 11771 647 2005-02-22 04:00:00 11688 648 2005-02-22 05:00:00 11527 643 2005-02-22 06:00:00 11664 650 2005-02-22 07:00:00 11300 638 2005-02-22 08:00:00 12239 697 2005-02-22 09:00:00 13860 805 2005-02-22 10:00:00 14870 878 2005-02-22 11:00:00 15528 931 2005-02-22 12:00:00 16705 972 2005-02-22 13:00:00 13883 828 2005-02-22 14:00:00 6414 467 2005-02-22 15:00:01 14122 1015 2005-02-22 16:00:00 14164 710 2005-02-22 17:00:00 13840 785 2005-02-22 18:00:01 13869 838 2005-02-22 19:00:00 12477 747 2005-02-22 20:00:01 11836 607 2005-02-22 21:00:00 11217 607 2005-02-22 22:00:00 11480 638 2005-02-22 23:00:00 11254 616 2005-02-23 00:00:00 11074 609 2005-02-23 01:00:00 11070 609 2005-02-23 02:00:00 11062 618 2005-02-23 03:00:00 11062 621 2005-02-23 04:00:00 11132 631 2005-02-23 05:00:00 10784 619 2005-02-23 06:00:00 10859 622 2005-02-23 07:00:00 11209 630 2005-02-23 08:00:00 11959 669 2005-02-23 09:00:00 13560 770 2005-02-23 10:00:00 15097 843 2005-02-23 11:00:00 15658 927 2005-02-23 12:00:00 14674 890 2005-02-23 13:00:00 13262 824 2005-02-23 14:00:00 14485 872 2005-02-23 15:00:00 13718 841 2005-02-23 16:00:00 13639 803 2005-02-23 17:00:00 13939 819 2005-02-23 18:00:00 13458 841 2005-02-23 19:00:00 11805 743 2005-02-23 20:00:00 11488 594 2005-02-23 21:00:00 11770 659 2005-02-23 22:00:00 11527 674 2005-02-23 23:00:00 11625 672 2005-02-24 00:00:01 11085 649 2005-02-24 01:00:01 10931 635 2005-02-24 02:00:00 10964 637 2005-02-24 03:00:00 10962 635 2005-02-24 04:00:00 10947 646 2005-02-24 05:00:00 11075 654 2005-02-24 06:00:00 11013 658 2005-02-24 07:00:00 9661 687 2005-02-24 08:00:00 10424 712 2005-02-24 09:00:01 12472 849 2005-02-24 10:00:00 13810 978 2005-02-24 11:00:01 14703 1060
I'm waiting until Cyrus begins to complain about too many open files. The process that complains is lmtpunix but the core files are from imapd.
Regards, Bernd
--- Cyrus Home Page: http://asg.web.cmu.edu/cyrus Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html