Received: from mylex.ssi.cl (unknown [200.73.31.3]) by postgresql.org (Postfix) with ESMTP id 033C54759B5 for ; Tue, 23 Apr 2002 19:12:06 -0400 (EDT) Received: (from www@localhost) by mylex.ssi.cl (8.11.6/8.9.3) id g3NNPNe25107 for pgsql-php@postgresql.org; Tue, 23 Apr 2002 19:25:23 -0400 From: Dinko Yaksic X-Authentication-Warning: mylex.ssi.cl: www set sender to dinko@ssi.cl using -f Received: from 66.96.60.20 ( [66.96.60.20]) as user dinko@mail.ssi.cl by webmail.ssi.cl with HTTP; Tue, 23 Apr 2002 19:25:23 -0400 Message-ID: <1019604323.3cc5ed63aa4a6@webmail.ssi.cl> Date: Tue, 23 Apr 2002 19:25:23 -0400 To: pgsql-php@postgresql.org Subject: Apache timeouts MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.0 X-Originating-IP: 66.96.60.20 X-Archive-Number: 200204/87 X-Sequence-Number: 1111 Hi! I'm using a server with Redhat 7.2, Apache 1.3.22, Php 4.0.6 & PostgreSQL 7.1.3. PROBLEM: When I execute a long PostgreSQL query via PHP code (involves joining 12 tables), I can't access any other webpage of the server while is processing the query & displaying the results (opening a new webpage causes that remains blank until the classic "page not found" appears). SYNTOMPS: Doing a 'top' shows postmaster has 98% of the processor. The strange fact is the frontend (psql) lets do another queries in the meanwhile, but Apache won't display any other page of the server until the whole query and page displays finishes. That behaviour is catastrophic for the rest of the users, moreover when the query takes almost 1 minute. MEASURES: I've already applied many optimizations like vacuuming before, and adding the indexes for the primaries & foreign keys involved, and the ones from the article http://www.phpbuilder.com/columns/smith20010821.php3 (128MB in shm_max). I'm not using persistent connections to the db, and I'm allowing 32 connections on postgresql.conf (max_connections) & php.ini (pgsql.max_links). Any suggestion how to solve the "greedy behaviour" of the web server ? Thanx in advance, Dinko