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

PHP memory usage

From: "Adam Palmblad" <adam(at)aers(dot)ca>
To: <pgsql-php(at)postgresql(dot)org>
Subject: PHP memory usage
Date: 2004-05-31 20:55:46
Message-ID: 003101c44751$a5fef890$97019696@AERS04 (view raw or flat)
Thread:
Lists: pgsql-php
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

pgsql-php by date

Next:From: A PalmbladDate: 2004-05-31 21:22:18
Subject: PHP memory usage
Previous:From: Nick FankhauserDate: 2004-05-27 13:39:50
Subject: Re: [PHP] PHP/PostGreSQL Articles

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