[gamin] Problems with many directories



Hello,

I would like to monitor a file system with multi million files on it with gamin, to which I am completely new.

I've found a convenient interface to it, namely Sys::Gamin (http://search.cpan.org/~garnacho/Sys-Gamin-0.1/lib/Sys/Gamin.pm, author CC-ed). The target OS is FreeBSD (7-CURRENT) and gamin is at gamin-0.1.7_2 (FreeBSD port version).

For testing, I thought monitoring /usr/ports would be enough. It has some directories:
find /usr/ports -type d  | wc -l
   26438

I use this list to feed the sample program:

------------------------------------
use Sys::Gamin;
my $fm=new Sys::Gamin;
my $i=0;

open(FP,"-");
while($line = <FP>) {
        chop($line);
        print($i++, "\n");
        $fm->monitor("$line");
}
close(FP);
<event processing loop skipped>
------------------------------------

The problem is that when I issue:
find /usr/ports -type d  | ./gamin.pl

the processing stops at 257 (sometimes at 256, and at other times very different values, I think I could do 260 at once):
[...]
FAMMonitorDirectory2(/usr/ports/astro/gpsd/files, 255)
Allocated request 255
Wrote 37 bytes to socket 3
gamin_send_request 255 for socket 3
255
FAMMonitorDirectory2(/usr/ports/astro/gpsdrive, 256)
Allocated request 256
Wrote 35 bytes to socket 3
gamin_send_request 256 for socket 3
256
FAMMonitorDirectory2(/usr/ports/astro/gpsdrive/files, 257)
Allocated request 257
^C

ulimit -n has 270000, so opening many FDs should not be a problem.

Any ideas about what do I do wrong?

Thanks,
--
Attila Nagy                                   e-mail: Attila Nagy fsn hu
Free Software Network (FSN.HU)                 phone: +3630 306 6758
http://www.fsn.hu/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]