couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: all_dbs_active - what should an app do when it gets this?
Date Wed, 25 Nov 2009 19:23:20 GMT
> #!/usr/bin/perl
>
> use FindBin qw($Bin);
> use lib ("$Bin/lib","$Bin/cpan-lib");
>
> use Net::CouchDB;
>
> my $host=shift;
> my $secs=shift;
>
> my $couch=Net::CouchDB->new($host);
>
> my @docs=map{ { '_id' => $_, 'lang' => 'erlang' } } (1...500);
>
> foreach (1...200) {
>        my $dbh=$couch->create_db("event-$_");
>        print "Created database $_\n";
>        $dbh->insert(@docs);
>        sleep($secs);
> }

IANAPM, but if $dbh is holding an open connection you could very well
trigger this quite easily. Can you try replacing the sleep($secs) with
something like $dbh->close()? Any easy way to check this is to watch
`netstat -tap tcp` and see if the number of sockets on either machine
is growing monotonically.

HTH,
Paul Davis

Mime
View raw message