pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Interpreting shared_buffers setting
6+ messages / 4 participants
[nested] [flat]

* Interpreting shared_buffers setting
@ 2019-01-29 12:32  Bob Jolliffe <bobjolliffe@gmail.com>
  0 siblings, 3 replies; 6+ messages in thread

From: Bob Jolliffe @ 2019-01-29 12:32 UTC (permalink / raw)
  To: pgsql-performance@lists.postgresql.org

Excuse me if this is a silly question.  I am trying to fiddle with
shared_buffers setting on postgresql 10.6 on ubuntu 18.04 server.

I have this at bottom of my config file:
shared_buffers = 1GB

Yet when I check the setting from pg_setting I see something quite different:

postgres=# SELECT name, setting FROM pg_settings where name = 'shared_buffers';
      name      | setting
----------------+---------
 shared_buffers | 131072

Is this a question of units?  It looks like 128M.  Note when I change
the setting to 2GB in conf file I see 262144 from pg_setting.  I am
now unsure what the actual shared_buffers allocation is.  I cant see
anything in the docs which tells me how to interpret the integer.

Any clarification welcome.

Regards
Bob




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Interpreting shared_buffers setting
@ 2019-01-29 12:35  Thomas Markus <t.markus@proventis.net>
  parent: Bob Jolliffe <bobjolliffe@gmail.com>
  2 siblings, 0 replies; 6+ messages in thread

From: Thomas Markus @ 2019-01-29 12:35 UTC (permalink / raw)
  To: pgsql-performance@lists.postgresql.org

Hi,

check for blocksize (8k) as factor.

8k*131072=1G

regards
Thomas

Am 29.01.19 um 13:32 schrieb Bob Jolliffe:
> Excuse me if this is a silly question.  I am trying to fiddle with
> shared_buffers setting on postgresql 10.6 on ubuntu 18.04 server.
>
> I have this at bottom of my config file:
> shared_buffers = 1GB
>
> Yet when I check the setting from pg_setting I see something quite different:
>
> postgres=# SELECT name, setting FROM pg_settings where name = 'shared_buffers';
>        name      | setting
> ----------------+---------
>   shared_buffers | 131072
>
> Is this a question of units?  It looks like 128M.  Note when I change
> the setting to 2GB in conf file I see 262144 from pg_setting.  I am
> now unsure what the actual shared_buffers allocation is.  I cant see
> anything in the docs which tells me how to interpret the integer.
>
> Any clarification welcome.
>
> Regards
> Bob
>





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Interpreting shared_buffers setting
@ 2019-01-29 13:07  Andrew Gierth <andrew@tao11.riddles.org.uk>
  parent: Bob Jolliffe <bobjolliffe@gmail.com>
  2 siblings, 1 reply; 6+ messages in thread

From: Andrew Gierth @ 2019-01-29 13:07 UTC (permalink / raw)
  To: Bob Jolliffe <bobjolliffe@gmail.com>; +Cc: pgsql-performance@lists.postgresql.org

>>>>> "Bob" == Bob Jolliffe <bobjolliffe@gmail.com> writes:

 Bob> Excuse me if this is a silly question. I am trying to fiddle with
 Bob> shared_buffers setting on postgresql 10.6 on ubuntu 18.04 server.

 Bob> I have this at bottom of my config file:
 Bob> shared_buffers = 1GB

 Bob> Yet when I check the setting from pg_setting I see something quite
 Bob> different:

 Bob> postgres=# SELECT name, setting FROM pg_settings where name = 'shared_buffers';
 Bob>       name      | setting
 Bob> ----------------+---------
 Bob>  shared_buffers | 131072

pg_settings can tell you more than you asked for:

postgres=# select * from pg_settings where name='shared_buffers';
-[ RECORD 1 ]---+-------------------------------------------------------------
name            | shared_buffers
setting         | 16384
unit            | 8kB
category        | Resource Usage / Memory
short_desc      | Sets the number of shared memory buffers used by the server.
extra_desc      | 
context         | postmaster
vartype         | integer
source          | configuration file
min_val         | 16
max_val         | 1073741823
enumvals        | 
boot_val        | 1024
reset_val       | 16384
sourcefile      | /home/andrew/work/pgsql/inst/9.5/data/postgresql.conf
sourceline      | 113
pending_restart | f

notice that "unit 8kB" line; the displayed integer value is in units of
8kB (which is the block size your server was compiled with, which you
can also see as the block_size parameter).

-- 
Andrew (irc:RhodiumToad)




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Interpreting shared_buffers setting
@ 2019-01-29 15:42  Bob Jolliffe <bobjolliffe@gmail.com>
  parent: Andrew Gierth <andrew@tao11.riddles.org.uk>
  0 siblings, 0 replies; 6+ messages in thread

From: Bob Jolliffe @ 2019-01-29 15:42 UTC (permalink / raw)
  To: pgsql-performance@lists.postgresql.org

Thank you Andrew and Thomas.  All is now clear :-)

On Tue, 29 Jan 2019 at 13:07, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
>
> >>>>> "Bob" == Bob Jolliffe <bobjolliffe@gmail.com> writes:
>
>  Bob> Excuse me if this is a silly question. I am trying to fiddle with
>  Bob> shared_buffers setting on postgresql 10.6 on ubuntu 18.04 server.
>
>  Bob> I have this at bottom of my config file:
>  Bob> shared_buffers = 1GB
>
>  Bob> Yet when I check the setting from pg_setting I see something quite
>  Bob> different:
>
>  Bob> postgres=# SELECT name, setting FROM pg_settings where name = 'shared_buffers';
>  Bob>       name      | setting
>  Bob> ----------------+---------
>  Bob>  shared_buffers | 131072
>
> pg_settings can tell you more than you asked for:
>
> postgres=# select * from pg_settings where name='shared_buffers';
> -[ RECORD 1 ]---+-------------------------------------------------------------
> name            | shared_buffers
> setting         | 16384
> unit            | 8kB
> category        | Resource Usage / Memory
> short_desc      | Sets the number of shared memory buffers used by the server.
> extra_desc      |
> context         | postmaster
> vartype         | integer
> source          | configuration file
> min_val         | 16
> max_val         | 1073741823
> enumvals        |
> boot_val        | 1024
> reset_val       | 16384
> sourcefile      | /home/andrew/work/pgsql/inst/9.5/data/postgresql.conf
> sourceline      | 113
> pending_restart | f
>
> notice that "unit 8kB" line; the displayed integer value is in units of
> 8kB (which is the block size your server was compiled with, which you
> can also see as the block_size parameter).
>
> --
> Andrew (irc:RhodiumToad)




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Interpreting shared_buffers setting
@ 2019-01-29 18:31  Jerry Sievers <gsievers19@comcast.net>
  parent: Bob Jolliffe <bobjolliffe@gmail.com>
  2 siblings, 1 reply; 6+ messages in thread

From: Jerry Sievers @ 2019-01-29 18:31 UTC (permalink / raw)
  To: Bob Jolliffe <bobjolliffe@gmail.com>; +Cc: pgsql-performance@lists.postgresql.org

Bob Jolliffe <bobjolliffe@gmail.com> writes:

> Excuse me if this is a silly question.  I am trying to fiddle with
> shared_buffers setting on postgresql 10.6 on ubuntu 18.04 server.
>
> I have this at bottom of my config file:
> shared_buffers = 1GB
>
> Yet when I check the setting from pg_setting I see something quite different:
>
> postgres=# SELECT name, setting FROM pg_settings where name = 'shared_buffers';
>       name      | setting
> ----------------+---------
>  shared_buffers | 131072

Why not use the show command which is good about output in human
terms...

psql (11.1 (Ubuntu 11.1-1.pgdg16.04+1))
Type "help" for help.

meta_a:postgres# select name, setting from pg_settings where name = 'shared_buffers');
ERROR:  syntax error at or near ")"
LINE 1: ...me, setting from pg_settings where name = 'shared_buffers');
                                                                     ^
meta_a:postgres# 

>
> Is this a question of units?  It looks like 128M.  Note when I change
> the setting to 2GB in conf file I see 262144 from pg_setting.  I am
> now unsure what the actual shared_buffers allocation is.  I cant see
> anything in the docs which tells me how to interpret the integer.
>
> Any clarification welcome.
>
> Regards
> Bob
>
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Interpreting shared_buffers setting
@ 2019-01-29 18:40  Jerry Sievers <gsievers19@comcast.net>
  parent: Jerry Sievers <gsievers19@comcast.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Jerry Sievers @ 2019-01-29 18:40 UTC (permalink / raw)
  To: Jerry Sievers <gsievers19@comcast.net>; +Cc: Bob Jolliffe <bobjolliffe@gmail.com>; pgsql-performance@lists.postgresql.org

Jerry Sievers <gsievers19@comcast.net> writes:

> Bob Jolliffe <bobjolliffe@gmail.com> writes:
>
>> Excuse me if this is a silly question.  I am trying to fiddle with
>> shared_buffers setting on postgresql 10.6 on ubuntu 18.04 server.
>>
>> I have this at bottom of my config file:
>> shared_buffers = 1GB
>>
>> Yet when I check the setting from pg_setting I see something quite different:
>>
>> postgres=# SELECT name, setting FROM pg_settings where name = 'shared_buffers';
>>       name      | setting
>> ----------------+---------
>>  shared_buffers | 131072

Aaaaay!  Pasted junk...  Here's what I meant.


meta_a:postgres# select setting from pg_settings where name='shared_buffers';
 setting 
---------
 131072
(1 row)

meta_a:postgres# show shared_buffers;
 shared_buffers 
----------------
 1GB
(1 row)


>
> Why not use the show command which is good about output in human
> terms...
>
> psql (11.1 (Ubuntu 11.1-1.pgdg16.04+1))
> Type "help" for help.
>
> meta_a:postgres# select name, setting from pg_settings where name = 'shared_buffers');
> ERROR:  syntax error at or near ")"
> LINE 1: ...me, setting from pg_settings where name = 'shared_buffers');
>                                                                      ^
> meta_a:postgres# 
>
>>
>> Is this a question of units?  It looks like 128M.  Note when I change
>> the setting to 2GB in conf file I see 262144 from pg_setting.  I am
>> now unsure what the actual shared_buffers allocation is.  I cant see
>> anything in the docs which tells me how to interpret the integer.
>>
>> Any clarification welcome.
>>
>> Regards
>> Bob
>>
>>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net




^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2019-01-29 18:40 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-29 12:32 Interpreting shared_buffers setting Bob Jolliffe <bobjolliffe@gmail.com>
2019-01-29 12:35 ` Thomas Markus <t.markus@proventis.net>
2019-01-29 13:07 ` Andrew Gierth <andrew@tao11.riddles.org.uk>
2019-01-29 15:42   ` Bob Jolliffe <bobjolliffe@gmail.com>
2019-01-29 18:31 ` Jerry Sievers <gsievers19@comcast.net>
2019-01-29 18:40   ` Jerry Sievers <gsievers19@comcast.net>

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