Skip site navigation (1) Skip section navigation (2)

Re: PHP memory usage

From: Robby Russell <rrussell(at)commandprompt(dot)com>
To: A Palmblad <adampalmblad(at)yahoo(dot)ca>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: PHP memory usage
Date: 2004-06-02 20:17:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-php
A Palmblad typed this on 05/31/2004 02:22 PM:
> We've been running into some issues with PHP and Postgres, and memory usage.
> On a dual athlon 64, w/ 4 gigs of RAM, PHP 4.3.6, and Postgres 7.4.2 I've
> seen our server start to crawl after some queries returning very large
> result sets.  Although large result sets aren't exactly what we want to be
> dealing with, I really want to avoid a situation where a user could disrupt
> our server with certain options to some searches.
> I did a quick commandline test, and it looks like PHP starts to eat memory
> during its call to pg_query.  By eat memory, I mean use memory well in
> excess of php.ini's memory_limit of 8 megs.  (I stop it around 90% of
> available memory usage)  Is this acceptable behaviour, or should I report it
> to PHP as a bug?  If not, are my only solutions to wrap my selects in
> cursors and/or to use limit?
> -Adam Palmblad

I am going to take a quick guess and suggest that test those queries in 
psql itself. You might be running into some issues with your queries.

Test your queries with psql, EXPLAIN.


Robby Russell,  |  Sr. Administrator / Lead Programmer
Command Prompt, Inc.   |
rrussell(at)commandprompt(dot)com | Telephone: (503) 667.4564

In response to


pgsql-php by date

Next:From: A PalmbladDate: 2004-06-02 20:41:33
Subject: Re: PHP memory usage
Previous:From: Nick BarrDate: 2004-05-31 22:50:43
Subject: Re: PHP memory usage

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group