Re: Tuning Postgres for Single connection use - Mailing list pgsql-performance

From Tom Lane
Subject Re: Tuning Postgres for Single connection use
Date
Msg-id 30687.1397581534@sss.pgh.pa.us
Whole thread Raw
In response to Re: Tuning Postgres for Single connection use  (Jeff Janes <jeff.janes@gmail.com>)
Responses Tuning Postgres for Single connection use
List pgsql-performance
Jeff Janes <jeff.janes@gmail.com> writes:
> On Tue, Apr 15, 2014 at 9:12 AM, Nick Eubank <nickeubank@gmail.com> wrote:
>> Quick followup Jeff: it seems that I can't set work_mem above about 1gb
>> (can't get to 2gb. When I update config, the values just don't change in
>> "SHOW ALL" -- integer constraint?). Is there a work around, or should I
>> tweak something else accordingly?

> What version are you using?  What is the exact line you put in your config
> file?  Did you get any errors when using that config file?  Are you sure
> you actually reloaded the server, so that it reread the config file, rather
> than just changing the file and then not applying the change?

> I usually set work_mem within a psql connection, in which case you need to
> quote the setting if you use units:
> set work_mem="3GB";

FWIW, it's generally considered a seriously *bad* idea to set work_mem as
high as 1GB in postgresql.conf: you're promising that each query running
on the server can use 1GB per sort or hash step.  You probably don't have
the machine resources to honor that promise.  (If you do, I'd like to have
your IT budget ;-))  Recommended practice is to keep the global setting
conservatively small, and bump it up locally in your session (with SET)
for individual queries that need the very large value.

But having said that, Postgres doesn't try to enforce any such practice.
My money is on what Jeff is evidently thinking: you forgot to do "pg_ctl
reload", or else the setting is too large for your platform, in which case
there should have been a complaint in the postmaster log.  As noted
elsewhere, the limit for Windows is a hair under 2GB even if it's 64-bit
Windows.

            regards, tom lane


pgsql-performance by date:

Previous
From: "Schnabel, Robert D."
Date:
Subject: Re: Tuning Postgres for Single connection use
Next
From: Nick Eubank
Date:
Subject: Tuning Postgres for Single connection use