pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Help me for "DBI->connect failed: Sorry, too many clients already."
4+ messages / 3 participants
[nested] [flat]

* Help me for "DBI->connect failed: Sorry, too many clients already."
@ 2000-12-19 18:56  Joseph <joseph@sitewarehouse.net>
  0 siblings, 2 replies; 4+ messages in thread

From: Joseph @ 2000-12-19 18:56 UTC (permalink / raw)
  To: pgsql-hackers@postgresql.org; pgsql-interfaces; joseph@sitewarehouse.net; +Cc: pgsql-admin@postgresql.org; pgsql-general@postgresql.org

my cgi program is test.cgi:
#######################
require "./connectdb.pl";
&connectdatabase();
$query="select count(*) from messages";
$sth=$dbh->prepare($query);
$sth->execute();
$count=$sth->fetchrow_array();
print "Content-type: text/html\n\n";
print <<"TAG";
<html>
<body>
<h2> The count is $count. </h2>
</body>
</html>
TAG
exit 0;
#############
my connectdb.pl :
sub connectdatabase {
#  my ($dbusername,$dbpassword)=@_;
  $dbusername="postgres";
  $dbpassword="lokicom";
  $dbname="mboardsony";
  use DBI;
  $dbh=DBI->connect("dbi:Pg:dbname=$dbname",$dbusername,$dbpassword) or die "can
not connect to $dbname\n";
}
1;
#######################
my os is Redhat 6.2,and perl 5.005,and  web server is Apache.
The problem is:when I run test.cgi,it can work properly.But when I press F5
to refresh the web page for sever minutes,the Apache will have error message:
"DBI->connect failed: Sorry, too many clients already."
  Who can help me?
  Thank you ahead.
  
  My email: joel_xue@hotmail.com

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Help me for "DBI->connect failed: Sorry, too many clients already."
@ 2000-12-19 20:02  Marc SCHAEFER <schaefer@alphanet.ch>
  parent: Joseph <joseph@sitewarehouse.net>
  1 sibling, 0 replies; 4+ messages in thread

From: Marc SCHAEFER @ 2000-12-19 20:02 UTC (permalink / raw)
  To: Joseph <joseph@sitewarehouse.net>; +Cc: pgsql-general@postgresql.org

On Tue, 19 Dec 2000, Joseph wrote:

>   $dbh=DBI->connect("dbi:Pg:dbname=$dbname",$dbusername,$dbpassword) or die "can

I would assume that if you never disconnect and are running under
mod_perl, you will have problems.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Help me for "DBI->connect failed: Sorry, too many clients already."
@ 2000-12-19 22:22  Jie Liang <jliang@jliang.ipinc.com>
  parent: Joseph <joseph@sitewarehouse.net>
  1 sibling, 1 reply; 4+ messages in thread

From: Jie Liang @ 2000-12-19 22:22 UTC (permalink / raw)
  To: Joseph <joseph@sitewarehouse.net>; +Cc: pgsql-hackers@postgresql.org; pgsql-interfaces; pgsql-admin@postgresql.org; pgsql-general@postgresql.org

Hi,there,

I hope it helps;

1. postgres by default allows 16 sessiones(if I don't remember wrong)
   at same time. You can change the setting according to the doccument.
   open too many sessiones at same time will more or less affect the
   performance.
2. I believe that using Pg module will be easier than DBI.


Jie LIANG

Internet Products Inc.

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang@ipinc.com
www.ipinc.com

On Tue, 19 Dec 2000, Joseph wrote:

> my cgi program is test.cgi:
> #######################
> require "./connectdb.pl";
> &connectdatabase();
> $query="select count(*) from messages";
> $sth=$dbh->prepare($query);
> $sth->execute();
> $count=$sth->fetchrow_array();
> print "Content-type: text/html\n\n";
> print <<"TAG";
> <html>
> <body>
> <h2> The count is $count. </h2>
> </body>
> </html>
> TAG
> exit 0;
> #############
> my connectdb.pl :
> sub connectdatabase {
> #  my ($dbusername,$dbpassword)=@_;
>   $dbusername="postgres";
>   $dbpassword="lokicom";
>   $dbname="mboardsony";
>   use DBI;
>   $dbh=DBI->connect("dbi:Pg:dbname=$dbname",$dbusername,$dbpassword) or die "can
> not connect to $dbname\n";
> }
> 1;
> #######################
> my os is Redhat 6.2,and perl 5.005,and  web server is Apache.
> The problem is:when I run test.cgi,it can work properly.But when I press F5
> to refresh the web page for sever minutes,the Apache will have error message:
> "DBI->connect failed: Sorry, too many clients already."
>   Who can help me?
>   Thank you ahead.
>   
>   My email: joel_xue@hotmail.com
> 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Re: [ADMIN] Help me for "DBI->connect failed: Sorry, too many clients already."
@ 2000-12-20 19:04  Marc SCHAEFER <schaefer@alphanet.ch>
  parent: Jie Liang <jliang@jliang.ipinc.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Marc SCHAEFER @ 2000-12-20 19:04 UTC (permalink / raw)
  To: Jie Liang <jliang@jliang.ipinc.com>; +Cc: Joseph <joseph@sitewarehouse.net>; pgsql-hackers@postgresql.org; pgsql-interfaces; pgsql-admin@postgresql.org; pgsql-general@postgresql.org

On Tue, 19 Dec 2000, Jie Liang wrote:

> 2. I believe that using Pg module will be easier than DBI.

DBD::Pg is used by DBI, and DBI is more generic (read: portable, better,
etc).




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2000-12-20 19:04 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-12-19 18:56 Help me for "DBI->connect failed: Sorry, too many clients already." Joseph <joseph@sitewarehouse.net>
2000-12-19 20:02 ` Marc SCHAEFER <schaefer@alphanet.ch>
2000-12-19 22:22 ` Jie Liang <jliang@jliang.ipinc.com>
2000-12-20 19:04   ` Marc SCHAEFER <schaefer@alphanet.ch>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox