|
From: Mike S. <m...@pe...> - 2007-11-09 19:44:29
|
On Fri, 9 Nov 2007, Jonathan Swartz wrote:
> My main worry is number of open file handles. Especially with
> mod_perl, since a lot of those handles will be opened individually in
> the child processes. At the same time, I don't want to have to open
> and close each handle every time. Any idea what kind of limits on
> number of open handles I can expect to hit on a reasonable Unix
> system?
Depends. The easiest way to find out is this one:
#!/usr/bin/perl -w
use strict;
my @handles;
my $count;
while(1) {
open my $fh, "</etc/passwd" or die "died at $count";
push @handles, $fh;
$count++;
}
prints
died at 1020 at ./t line 7.
so that's it :). I would suggest that you find a compromise between
good performance and not running out of file handles by having the
appender maintain a configurable pool of file handles that it keeps open.
-- Mike
Mike Schilli
m...@pe...
|