You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Frank Sonnemans <fr...@euronet.be> on 2000/12/31 00:37:52 UTC

Modperl + DBI + Postgresql = Crash (file table full)

I am currently building an intranet site which uses a Postgresql database 
backend. Unfortunately the database server is opening more files for every 
SQL request from the web site. This quickly leads to a crash after the 
kernels file table has filled up.

As of today I have no idea about the cause of the problem. Initially I 
blamed Apache::DBI and therefore I disabled it, adding $dbh->disconnect 
statements to my code. However this has not solved the problem.

My server runs the following software:

FreeBSD 4.0 or FreeBSD 4.2 stable
Apache 1.3
ModPerl
Apache::DBI (disabling this doesn't change anything)
HTML::Mason

Any ideas on the cause of the problems. Any similar experiences?

Thanks in advance for your reply.


Frank Sonnemans



Re: Modperl + DBI + Postgresql = Crash (file table full)

Posted by James <ja...@rf.net>.
usually a default OS install does not have enough
available file handles for use as a webserver.

Consider using ulimit -n, and ndd or sysctl settings
for file descriptors.

On a busy site you may need to increase the hard limit
by also modifying the kernel FDMAX #define and rebuilding.

Or you might just be having leaky code ...

Frank Sonnemans wrote:
> 
> I am currently building an intranet site which uses a Postgresql database
> backend. Unfortunately the database server is opening more files for every
> SQL request from the web site. This quickly leads to a crash after the
> kernels file table has filled up.
> 
> As of today I have no idea about the cause of the problem. Initially I
> blamed Apache::DBI and therefore I disabled it, adding $dbh->disconnect
> statements to my code. However this has not solved the problem.
> 
> My server runs the following software:
> 
> FreeBSD 4.0 or FreeBSD 4.2 stable
> Apache 1.3
> ModPerl
> Apache::DBI (disabling this doesn't change anything)
> HTML::Mason
> 
> Any ideas on the cause of the problems. Any similar experiences?
> 
> Thanks in advance for your reply.
> 
> Frank Sonnemans

--
ActiveMessage - Targeted Email Marketing
Ask me for a free outbound email trial account!
http://ActiveMessage.com

Re: Modperl + DBI + Postgresql = Crash (file table full)

Posted by Andrew Ho <an...@tellme.com>.
Hello,


FS>I am currently building an intranet site which uses a Postgresql database 
FS>backend. Unfortunately the database server is opening more files for every 
FS>SQL request from the web site. This quickly leads to a crash after the 
FS>kernels file table has filled up.

I've run mod_perl with a PostgreSQL database before under moderate traffic
and did not encounter the problem you describe. The file descriptor limit
mentioned earlier is a general issue with running Apache, and should not
be related to mod_perl or PostgreSQL per se. Adding "ulimit -n x" to the
apachectl script (where x is some large number, I use 4096) makes this
easy and unforgettable.

Does the file descriptor problem occur when you run as a regular CGI?


FS>As of today I have no idea about the cause of the problem. Initially I 
FS>blamed Apache::DBI and therefore I disabled it, adding $dbh->disconnect 
FS>statements to my code. However this has not solved the problem.

You should add $dbh->disconnect statements regardless; Apache::DBI will
render those statements harmless, and leaving them in is good practice,
and leaves your script usable out of an Apache::DBI environment.


FS>Apache 1.3
FS>ModPerl
FS>Apache::DBI (disabling this doesn't change anything)

What versions of this stuff, and of PostgreSQL are you using? I assume by
"Apache 1.3" you really mean 1.3.x, where x is something recent...


Humbly,

Andrew

----------------------------------------------------------------------
Andrew Ho               http://www.tellme.com/       andrew@tellme.com
Engineer                   info@tellme.com          Voice 650-930-9062
Tellme Networks, Inc.       1-800-555-TELL            Fax 650-930-9101
----------------------------------------------------------------------