Re: [GENERAL] plpyhton - Mailing list pgsql-admin

From Joshua Tolley
Subject Re: [GENERAL] plpyhton
Date
Msg-id 4cefdab2.16958e0a.588d.ffff9748@mx.google.com
Whole thread Raw
In response to Re: [GENERAL] plpyhton  (c k <shreeseva.learning@gmail.com>)
List pgsql-admin
On Fri, Nov 26, 2010 at 05:28:52PM +0530, c k wrote:
> Thanks for your reply.
> But if a database has 100+ connections then isn't loading any such
> interpreter consumes more memory and requires more CPU? Does all PL
> languages behave in the same fashion?

If there are lots of connections, and each calls a plpython function (for
example), then each will load a python interpreter, and certainly that could
add up to serious memory usage. I can't speak for *every* PL; C functions
don't load any special interpreter, for instance, and I don't think there's
anything special you have to load to run SQL functions, beyond what gets
loaded anyway.

If you have problems with hundreds of connections using too much memory when
each loads an interpreter, you ought to consider getting more memory, using a
connection pooler, changing how you do things, or some combination of the
above.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Attachment

pgsql-admin by date:

Previous
From: c k
Date:
Subject: Re: [GENERAL] plpyhton
Next
From: Dimitri Fontaine
Date:
Subject: Re: Pre-Allocate tablespace on disk