PHP memory usage

This is a multi-part message in MIME format.

------=_NextPart_000_002E_01C44716.F909FB10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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'v=
e seen our server start to crawl after some queries returning very large re=
sult sets. Although large result sets aren't exactly what we want to be de=
aling with, I really want to avoid a situation where a user could disrupt o=
ur 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 exce=
ss 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
------=_NextPart_000_002E_01C44716.F909FB10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>We've been running into some issues with P=
HP and
Postgres, and memory usage.  On a dual athlon 64, w/ 4 gigs of RAM, PH=
P
4.3.6, and Postgres 7.4.2 I've seen our server start to crawl after some qu=
eries
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.  </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I did a quick commandline test, and it loo=
ks 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.&nb=
sp;
(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?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>-Adam Palmblad</FONT></DIV></BODY></HTML>

------=_NextPart_000_002E_01C44716.F909FB10--
Adam Palmblad [ Mo, 31 Mai 2004 22:55 ] [ ID #141822 ]
Datenbanken » gmane.comp.db.postgresql.php » PHP memory usage

Vorheriges Thema: Question about checkboxes in forms
Nächstes Thema: PHP/PostGreSQL Articles