This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
To: modperl@apache.org From: Frank Sonnemans <frank.sonnemans@euronet.be> Subject: Modperl + DBI + Postgresql = Crash (file table full) Date: Sun, 31 Dec 2000 00:37:52 +0100 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? === To: Frank Sonnemans <frank.sonnemans@euronet.be> From: James <james@rf.net> Subject: Re: Modperl + DBI + Postgresql = Crash (file table full) Date: Sun, 31 Dec 2000 02:13:05 -0800 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 ... === To: Frank Sonnemans <frank.sonnemans@euronet.be> From: Andrew Ho <andrew@tellme.com> Subject: Re: Modperl + DBI + Postgresql = Crash (file table full) Date: Sun, 31 Dec 2000 02:38:21 -0800 (PST) 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... ===