Re: One process per session lack of sharing

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: AMatveev(at)bitec(dot)ru, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: One process per session lack of sharing
Date: 2016-07-15 11:03:11
Message-ID: CAMsr+YE=kizDZ4XZRd13aeSOzttwuWh7Q1UZWrxHoVRAYgcT-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15 July 2016 at 18:05, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:

> There is only few use cases - mostly related to Oracle emulation when
> multi threading is necessary - and few can be solved better - PLpgSQL to C
> compilation and similar techniques.
>
>
Right.

If amatveev (username, unsure of full name) wants to improve PL/PgSQL
performance and the ability of a JVM to share resources between backends,
then it would be more productive to focus on that than on threading.

As for "fixing" the FAQ... for the great majority of people the FAQ entry
on memory use is accurate. Sure, if you load a JVM into each backend and
load a bunch of cached data in it, you'll get bad memory use. So don't do
that. You're not measuring PostgreSQL, you're measuring
PostgreSQL-plus-my-JVM-extension. Why does it use so much memory? 'cos it
loads a whole bunch of stuff into each backend.

Now, there are other cases where individual PostgreSQL backends use lots of
memory. But that FAQ entry refers to the common misconception that each
PostgreSQL process's reported memory use is the actual system memory it
uses. That isn't the case because most systems account badly for shared
memory, and it confuses a lot of people. The FAQ entry doesn't need fixing.

Maybe the FAQ entry needs rewording to qualify it so it says that "in most
cases" it's just shared memory mis-accounting. But that's about it.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message AMatveev 2016-07-15 11:25:20 Re: One process per session lack of sharing
Previous Message Pavel Stehule 2016-07-15 10:38:28 Re: One process per session lack of sharing