From: Shianmiin <Shianmiin@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: [BUGS] PostgreSQL backend process high memory usage issue
Date: Wed, 13 Apr 2011 13:07:16 -0700 (PDT)
Message-ID: <1302725236634-4301552.post@n5.nabble.com> (raw)
In-Reply-To: <26138.1302672583@sss.pgh.pa.us>
References: <1302266587288-4290723.post@n5.nabble.com>
<1302276600400-4291173.post@n5.nabble.com>
<BANLkTi=oKpzWDcew+J-c+p1anUv=gLjHOw@mail.gmail.com>
<1302289242961-4291699.post@n5.nabble.com>
<BANLkTimwd389+f63Tztn5YcDRcsfsLYaww@mail.gmail.com>
<1302300463012-4292010.post@n5.nabble.com>
<BANLkTinPOBAV+Cjuc0q5GduiLmqQzA=Hpw@mail.gmail.com>
<1302630534510-4298807.post@n5.nabble.com>
<BANLkTikTY=o2s4HzE0L5+wiqUDVEu-EaKQ@mail.gmail.com>
<26138.1302672583@sss.pgh.pa.us>
Tom Lane-2 wrote:
>
>
> I don't think it's a leak, exactly: it's just that the "relcache" entry
> for each one of these views occupies about 100K. A backend that touches
> N of the views is going to need about N*100K in relcache space. I can't
> get terribly excited about that. Trying to reduce the size of the
> relcache would be a net loss for most usage patterns (ie, we'd end up
> increasing the amount of re-fetching from the system catalogs that
> backends would have to do). And I don't think that this test case has
> much of anything to do with sane application design, anyway. Do you
> really need that many complex views? Do you really need to have most
> sessions touching all of them?
>
>
Thanks for the clarification, that answers our question and gives us a good
direction where to look for further information. We have gained more
confidence on moving toward using PostgreSQL as our multitenant database
backend.
The tests were designed to show the high memory usage findings while we are
evaluating PostgreSQL, and yes, it's far from real world scenario. However,
the concern is not come from nothing - current our system is running on
Microsoft SQL Server with one db per tenant multitenancy model. We have one
db server that has 5000 tenant databases, each with 200 tables and 500
views. There are quite a few views that are much more complex than the one
shown in the test. When a request comes in, the application servers will
randomly pick a connection from the pool to query the db, so theoretically
every connection could eventually hit all views, in real wold it may take
quite a while to fill-up the memory until it reaches an unacceptable size.
However, it just feel a little weird that there isn't a convenient way for
PostgreSQL to control the cache memory usage of backend process. :)
We are still at early staging of moving to a different multitenant db model
and there are plenty of options that we can go or get around issues like
this. Thanks again.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/PostgreSQL-backend-process-high-memory-usage-issue-tp4289407...
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: Shianmiin@gmail.com, pgsql-general@postgresql.org
Subject: Re: [BUGS] PostgreSQL backend process high memory usage issue
In-Reply-To: <1302725236634-4301552.post@n5.nabble.com>
References: <1302266587288-4290723.post@n5.nabble.com> <1302276600400-4291173.post@n5.nabble.com> <BANLkTi=oKpzWDcew+J-c+p1anUv=gLjHOw@mail.gmail.com> <1302289242961-4291699.post@n5.nabble.com> <BANLkTimwd389+f63Tztn5YcDRcsfsLYaww@mail.gmail.com> <1302300463012-4292010.post@n5.nabble.com> <BANLkTinPOBAV+Cjuc0q5GduiLmqQzA=Hpw@mail.gmail.com> <1302630534510-4298807.post@n5.nabble.com> <BANLkTikTY=o2s4HzE0L5+wiqUDVEu-EaKQ@mail.gmail.com> <26138.1302672583@sss.pgh.pa.us> <1302725236634-4301552.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox